diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2021-07-23 17:42:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-23 11:42:37 -0400 |
| commit | 79644ab67731c7ba956c354bf0545282f34e10cc (patch) | |
| tree | e65dbf73b3442ab1aa9fc59fc56a35b4c9edf1e0 /lua/telescope/pickers/entry_display.lua | |
| parent | 664690029fdb302bee8d3f27a458383e8477add7 (diff) | |
chore: use stylua for formatting (#1040)
* chore: stylua job and config
* reformat with stylua
Diffstat (limited to 'lua/telescope/pickers/entry_display.lua')
| -rw-r--r-- | lua/telescope/pickers/entry_display.lua | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lua/telescope/pickers/entry_display.lua b/lua/telescope/pickers/entry_display.lua index e2be8c0..0982e87 100644 --- a/lua/telescope/pickers/entry_display.lua +++ b/lua/telescope/pickers/entry_display.lua @@ -1,4 +1,4 @@ -local strings = require('plenary.strings') +local strings = require "plenary.strings" local entry_display = {} entry_display.truncate = strings.truncate @@ -9,7 +9,7 @@ entry_display.create = function(configuration) if v.width then local justify = v.right_justify table.insert(generator, function(item) - if type(item) == 'table' then + if type(item) == "table" then return strings.align_str(entry_display.truncate(item[1], v.width), v.width, justify), item[2] else return strings.align_str(entry_display.truncate(item, v.width), v.width, justify) @@ -17,7 +17,7 @@ entry_display.create = function(configuration) end) else table.insert(generator, function(item) - if type(item) == 'table' then + if type(item) == "table" then return item[1], item[2] else return item @@ -37,7 +37,7 @@ entry_display.create = function(configuration) for j = 1, (i - 1) do hl_start = hl_start + #results[j] + (#configuration.separator or 1) end - local hl_end = hl_start + #str:gsub('%s*$', '') + local hl_end = hl_start + #str:gsub("%s*$", "") if type(hl) == "function" then for _, hl_res in ipairs(hl()) do @@ -66,7 +66,7 @@ entry_display.create = function(configuration) local final_str = table.concat(results, configuration.separator or "│") if configuration.hl_chars then for i = 1, #final_str do - local c = final_str:sub(i,i) + local c = final_str:sub(i, i) local hl = configuration.hl_chars[c] if hl then table.insert(highlights, { { i - 1, i }, hl }) @@ -78,21 +78,20 @@ entry_display.create = function(configuration) end end - entry_display.resolve = function(self, entry) local display, display_highlights - if type(entry.display) == 'function' then - self:_increment("display_fn") + if type(entry.display) == "function" then + self:_increment "display_fn" display, display_highlights = entry:display(self) - if type(display) == 'string' then + if type(display) == "string" then return display, display_highlights end else display = entry.display end - if type(display) == 'string' then + if type(display) == "string" then return display, display_highlights end end |
