mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	fix(lsp): allow apply_text_edits and set_lines to insert text after the last line. Fixes #14017
This commit is contained in:
		@@ -73,7 +73,7 @@ function M.set_lines(lines, A, B, new_lines)
 | 
			
		||||
  -- way the LSP describes the range including the last newline is by
 | 
			
		||||
  -- specifying a line number after what we would call the last line.
 | 
			
		||||
  local i_n = math.min(B[1] + 1, #lines)
 | 
			
		||||
  if not (i_0 >= 1 and i_0 <= #lines and i_n >= 1 and i_n <= #lines) then
 | 
			
		||||
  if not (i_0 >= 1 and i_0 <= #lines + 1 and i_n >= 1 and i_n <= #lines) then
 | 
			
		||||
    error("Invalid range: "..vim.inspect{A = A; B = B; #lines, new_lines})
 | 
			
		||||
  end
 | 
			
		||||
  local prefix = ""
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user