Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ab5183c

Browse files
fix(listitems): Handle text edits order on Neovim nightly
1 parent 3e4dbeb commit ab5183c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/orgmode/org/mappings.lua

+5
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ function OrgMappings:meta_return(suffix)
656656
end
657657

658658
if #text_edits > 0 then
659+
-- Fix sorting for same position edits
660+
-- See: https://github.com/neovim/neovim/commit/2ce4a4d91e4abee0aab8b98c47eea9fbd4849ba6
661+
if vim.fn.has('nvim-0.11') > 0 then
662+
text_edits = utils.reverse(text_edits)
663+
end
659664
vim.lsp.util.apply_text_edits(text_edits, vim.api.nvim_get_current_buf(), constants.default_offset_encoding)
660665

661666
vim.fn.cursor(end_row + 1 + (add_empty_line and 1 or 0), 1) -- +1 for next line

0 commit comments

Comments
 (0)