mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	refactor(lsp): do not parse verbose output when overwriting options (#22810)
This commit is contained in:
		@@ -1101,21 +1101,16 @@ function lsp.start_client(config)
 | 
				
			|||||||
      return true
 | 
					      return true
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local last_set_from = vim.fn.gettext('\n\tLast set from ')
 | 
					    local info = vim.api.nvim_get_option_info2(option, { buf = bufnr })
 | 
				
			||||||
    local line = vim.fn.gettext(' line ')
 | 
					    local scriptinfo = vim.tbl_filter(function(e)
 | 
				
			||||||
    local scriptname
 | 
					      return e.sid == info.last_set_sid
 | 
				
			||||||
 | 
					    end, vim.fn.getscriptinfo())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vim.api.nvim_buf_call(bufnr, function()
 | 
					    if #scriptinfo ~= 1 then
 | 
				
			||||||
      scriptname = vim.fn
 | 
					 | 
				
			||||||
        .execute('verbose set ' .. option .. '?')
 | 
					 | 
				
			||||||
        :match(last_set_from .. '(.*)' .. line .. '%d+')
 | 
					 | 
				
			||||||
    end)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if not scriptname then
 | 
					 | 
				
			||||||
      return false
 | 
					      return false
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return vim.startswith(vim.fn.expand(scriptname), vim.fn.expand('$VIMRUNTIME'))
 | 
					    return vim.startswith(scriptinfo[1].name, vim.fn.expand('$VIMRUNTIME'))
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ---@private
 | 
					  ---@private
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user