mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
fix(lsp): respect all of 'fixeol', 'eol', and 'binary' applying edits (#17574)
This commit is contained in:
parent
482ea0cc17
commit
d477788cd5
@ -480,7 +480,7 @@ function M.apply_text_edits(text_edits, bufnr, offset_encoding)
|
||||
|
||||
-- Remove final line if needed
|
||||
local fix_eol = has_eol_text_edit
|
||||
fix_eol = fix_eol and api.nvim_buf_get_option(bufnr, 'fixeol')
|
||||
fix_eol = fix_eol and (api.nvim_buf_get_option(bufnr, 'eol') or (api.nvim_buf_get_option(bufnr, 'fixeol') and not api.nvim_buf_get_option('binary')))
|
||||
fix_eol = fix_eol and get_line(bufnr, max - 1) == ''
|
||||
if fix_eol then
|
||||
vim.api.nvim_buf_set_lines(bufnr, -2, -1, false, {})
|
||||
|
Loading…
Reference in New Issue
Block a user