fix(pickers): improve CRLF line splitting support for windows (#3127)
* fix(help_tags): show help tags on windows (#3126) On Windows, `builtin.help_tags` picker does not show any help tags. To fix this, the following changes are needed: 1. `util.path_tail` checks unix separator `/` on Windows and leave the original implementation intact on unix systems. 2. Line endings should be taken carefully on Windows. `vim.split` with only newline `\n` character as separator may result in unexpected crash when parsing large files. When splits on lines are needed, call it with `\r?\n`, or even set up a wrapper function in utils is more prefered. Fixes #3126 * fix: handle cross platform line splits
This commit is contained in:
@@ -1090,7 +1090,7 @@ previewers.highlights = defaulter(function(_)
|
||||
|
||||
define_preview = function(self, entry)
|
||||
if not self.state.bufname then
|
||||
local output = vim.split(vim.fn.execute "highlight", "\n")
|
||||
local output = utils.split_lines(vim.fn.execute "highlight")
|
||||
local hl_groups = {}
|
||||
for _, v in ipairs(output) do
|
||||
if v ~= "" then
|
||||
|
||||
Reference in New Issue
Block a user