chore: use plenary.strings and remove strings functions from utils (#690)

Co-authored-by: Simon Hauser <Simon-Hauser@outlook.de>
This commit is contained in:
JINNOUCHI Yasushi
2021-06-15 03:47:33 +09:00
committed by GitHub
parent 398a0d391a
commit 0c1bc129da
6 changed files with 25 additions and 139 deletions

View File

@@ -6,6 +6,7 @@ local pickers = require('telescope.pickers')
local previewers = require('telescope.previewers')
local utils = require('telescope.utils')
local entry_display = require('telescope.pickers.entry_display')
local strings = require('plenary.strings')
local conf = require('telescope.config').values
@@ -138,7 +139,7 @@ git.branches = function(opts)
entry.name = string.sub(entry.refname, string.len(prefix)+1)
for key, value in pairs(widths) do
widths[key] = math.max(value, utils.strdisplaywidth(entry[key] or ''))
widths[key] = math.max(value, strings.strdisplaywidth(entry[key] or ''))
end
if string.len(entry.upstream) > 0 then
widths.upstream_indicator = 2

View File

@@ -5,6 +5,7 @@ local make_entry = require('telescope.make_entry')
local pickers = require('telescope.pickers')
local entry_display = require('telescope.pickers.entry_display')
local utils = require('telescope.utils')
local strings = require('plenary.strings')
local a = require('plenary.async_lib')
local async, await = a.async, a.await
local channel = a.util.channel
@@ -172,7 +173,7 @@ lsp.code_actions = function(opts)
}
for key, value in pairs(widths) do
widths[key] = math.max(value, utils.strdisplaywidth(entry[key]))
widths[key] = math.max(value, strings.strdisplaywidth(entry[key]))
end
table.insert(results, entry)