diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/health/provider.vim | 4 | ||||
-rw-r--r-- | runtime/doc/pi_netrw.txt | 4 | ||||
-rw-r--r-- | runtime/doc/syntax.txt | 12 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 12 | ||||
-rw-r--r-- | runtime/doc/usr_42.txt | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/buf.lua | 24 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/util.lua | 51 | ||||
-rw-r--r-- | runtime/tutor/tutor.tutor | 2 |
8 files changed, 42 insertions, 71 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index de540405e6..001379c85d 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -423,10 +423,6 @@ function! s:check_python(version) abort \ ' This could lead to confusing error messages.') endif - if a:version == 3 && str2float(pyversion) < 3.3 - call health#report_warn('Python 3.3+ is recommended.') - endif - call health#report_info('Python version: ' . pyversion) if s:is_bad_response(status) diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 5adafd7877..4b61cd4c25 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -3181,8 +3181,8 @@ window, then the one window will be horizontally split (by default). If there's more than one window, the previous window will be re-used on the selected file/directory. If the previous window's associated buffer has been modified, and there's only one window with that buffer, then -the user will be asked if s/he wishes to save the buffer first (yes, -no, or cancel). +the user will be asked if they wish to save the buffer first (yes, no, or +cancel). Related Actions |netrw-cr| |netrw-o| |netrw-t| |netrw-v| Associated setting variables: diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 95e00720b1..b159f655fa 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1969,7 +1969,7 @@ LEX *lex.vim* *ft-lex-syntax* Lex uses brute-force synchronizing as the "^%%$" section delimiter gives no clue as to what section follows. Consequently, the value for > :syn sync minlines=300 -may be changed by the user if s/he is experiencing synchronization +may be changed by the user if they are experiencing synchronization difficulties (such as may happen with large lex files). @@ -3009,11 +3009,11 @@ variables in your vimrc: < (dash users should use posix) -If there's no "#! ..." line, and the user hasn't availed himself/herself of a -default sh.vim syntax setting as just shown, then syntax/sh.vim will assume -the Bourne shell syntax. No need to quote RFCs or market penetration -statistics in error reports, please -- just select the default version of the -sh your system uses and install the associated "let..." in your <.vimrc>. +If there's no "#! ..." line, and the user hasn't availed themself of a default +sh.vim syntax setting as just shown, then syntax/sh.vim will assume the Bourne +shell syntax. No need to quote RFCs or market penetration statistics in error +reports, please -- just select the default version of the sh your system uses +and install the associated "let..." in your <.vimrc>. The syntax/sh.vim file provides several levels of syntax-based folding: > diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 4cba5a33d0..f92cb3c509 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1875,7 +1875,7 @@ NOT LOADING It's possible that a user doesn't always want to load this plugin. Or the system administrator has dropped it in the system-wide plugin directory, but a -user has his own plugin he wants to use. Then the user must have a chance to +user has their own plugin they want to use. Then the user must have a chance to disable loading this specific plugin. This will make it possible: > 6 if exists("g:loaded_typecorr") @@ -1908,7 +1908,7 @@ item can be used: > The "<Plug>TypecorrAdd;" thing will do the work, more about that further on. -The user can set the "mapleader" variable to the key sequence that he wants +The user can set the "mapleader" variable to the key sequence that they want this mapping to start with. Thus if the user has done: > let mapleader = "_" @@ -1919,7 +1919,7 @@ will be used, which is a backslash. Then a map for "\a" will be defined. Note that <unique> is used, this will cause an error message if the mapping already happened to exist. |:map-<unique>| -But what if the user wants to define his own key sequence? We can allow that +But what if the user wants to define their own key sequence? We can allow that with this mechanism: > 21 if !hasmapto('<Plug>TypecorrAdd;') @@ -1928,7 +1928,7 @@ with this mechanism: > This checks if a mapping to "<Plug>TypecorrAdd;" already exists, and only defines the mapping from "<Leader>a" if it doesn't. The user then has a -chance of putting this in his vimrc file: > +chance of putting this in their vimrc file: > map ,c <Plug>TypecorrAdd; @@ -2033,7 +2033,7 @@ Now let's add a user command to add a correction: > The user command is defined only if no command with the same name already exists. Otherwise we would get an error here. Overriding the existing user command with ":command!" is not a good idea, this would probably make the user -wonder why the command he defined himself doesn't work. |:command| +wonder why the command they defined themself doesn't work. |:command| SCRIPT VARIABLES @@ -2285,7 +2285,7 @@ An example of how to define functionality in a filetype plugin: > |hasmapto()| is used to check if the user has already defined a map to <Plug>JavaImport;. If not, then the filetype plugin defines the default mapping. This starts with |<LocalLeader>|, which allows the user to select -the key(s) he wants filetype plugin mappings to start with. The default is a +the key(s) they want filetype plugin mappings to start with. The default is a backslash. "<unique>" is used to give an error message if the mapping already exists or overlaps with an existing mapping. diff --git a/runtime/doc/usr_42.txt b/runtime/doc/usr_42.txt index 99da1359c2..ff3ae7057a 100644 --- a/runtime/doc/usr_42.txt +++ b/runtime/doc/usr_42.txt @@ -209,8 +209,8 @@ argument: > :amenu <silent> Mine.Next\ File :call <SID>NextFile()<CR> Don't use "<silent>" too often. It is not needed for short commands. If you -make a menu for someone else, being able to see the executed command will give -him a hint about what he could have typed, instead of using the mouse. +make a menu for someone else, being able to see the executed command will +give them a hint about what they could have typed, instead of using the mouse. LISTING MENUS diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 341a3e82fc..5dd7109bb0 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -297,26 +297,30 @@ local function pick_call_hierarchy_item(call_hierarchy_items) return choice end +local function call_hierarchy(method) + local params = util.make_position_params() + request('textDocument/prepareCallHierarchy', params, function(err, _, result) + if err then + vim.notify(err.message, vim.log.levels.WARN) + return + end + local call_hierarchy_item = pick_call_hierarchy_item(result) + vim.lsp.buf_request(0, method, { item = call_hierarchy_item }) + end) +end + --- Lists all the call sites of the symbol under the cursor in the --- |quickfix| window. If the symbol can resolve to multiple --- items, the user can pick one in the |inputlist|. function M.incoming_calls() - local params = util.make_position_params() - request('textDocument/prepareCallHierarchy', params, function(_, _, result) - local call_hierarchy_item = pick_call_hierarchy_item(result) - vim.lsp.buf_request(0, 'callHierarchy/incomingCalls', { item = call_hierarchy_item }) - end) + call_hierarchy('callHierarchy/incomingCalls') end --- Lists all the items that are called by the symbol under the --- cursor in the |quickfix| window. If the symbol can resolve to --- multiple items, the user can pick one in the |inputlist|. function M.outgoing_calls() - local params = util.make_position_params() - request('textDocument/prepareCallHierarchy', params, function(_, _, result) - local call_hierarchy_item = pick_call_hierarchy_item(result) - vim.lsp.buf_request(0, 'callHierarchy/outgoingCalls', { item = call_hierarchy_item }) - end) + call_hierarchy('callHierarchy/outgoingCalls') end --- List workspace folders. diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 57919e907c..e403a8ee1b 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -566,13 +566,15 @@ end --@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion local function get_completion_word(item) if item.textEdit ~= nil and item.textEdit.newText ~= nil and item.textEdit.newText ~= "" then - if protocol.InsertTextFormat[item.insertTextFormat] == "PlainText" then + local insert_text_format = protocol.InsertTextFormat[item.insertTextFormat] + if insert_text_format == "PlainText" or insert_text_format == nil then return item.textEdit.newText else return M.parse_snippet(item.textEdit.newText) end elseif item.insertText ~= nil and item.insertText ~= "" then - if protocol.InsertTextFormat[item.insertTextFormat] == "PlainText" then + local insert_text_format = protocol.InsertTextFormat[item.insertTextFormat] + if insert_text_format == "PlainText" or insert_text_format == nil then return item.insertText else return M.parse_snippet(item.insertText) @@ -914,23 +916,6 @@ function M.make_floating_popup_options(width, height, opts) } end -local function _should_add_to_tagstack(new_item) - local stack = vim.fn.gettagstack() - - -- Check if we're at the bottom of the tagstack. - if stack.curidx <= 1 then return true end - - local top_item = stack.items[stack.curidx-1] - - -- Check if the item at the top of the tagstack is exactly the - -- same as the one we want to push. - if top_item.tagname ~= new_item.tagname then return true end - for i, v in ipairs(top_item.from) do - if v ~= new_item.from[i] then return true end - end - return false -end - --- Jumps to a location. --- --@param location (`Location`|`LocationLink`) @@ -939,36 +924,22 @@ function M.jump_to_location(location) -- location may be Location or LocationLink local uri = location.uri or location.targetUri if uri == nil then return end - - local from_bufnr = vim.fn.bufnr('%') - local from = {from_bufnr, vim.fn.line('.'), vim.fn.col('.'), 0} - local item = {tagname=vim.fn.expand('<cword>'), from=from} - + local bufnr = vim.uri_to_bufnr(uri) -- Save position in jumplist - vim.cmd("mark '") + vim.cmd "normal! m'" + + -- Push a new item into tagstack + local from = {vim.fn.bufnr('%'), vim.fn.line('.'), vim.fn.col('.'), 0} + local items = {{tagname=vim.fn.expand('<cword>'), from=from}} + vim.fn.settagstack(vim.fn.win_getid(), {items=items}, 't') --- Jump to new location (adjusting for UTF-16 encoding of characters) - local bufnr = vim.uri_to_bufnr(uri) api.nvim_set_current_buf(bufnr) api.nvim_buf_set_option(0, 'buflisted', true) local range = location.range or location.targetSelectionRange local row = range.start.line local col = get_line_byte_from_position(0, range.start) - -- This prevents the tagstack to be filled with items that provide - -- no motion when CTRL-T is pressed because they're both the source - -- and the destination. - local motionless = - bufnr == from_bufnr and - row+1 == from[2] and col+1 == from[3] - if not motionless and _should_add_to_tagstack(item) then - local winid = vim.fn.win_getid() - local items = {item} - vim.fn.settagstack(winid, {items=items}, 't') - end - - -- Jump to new location api.nvim_win_set_cursor(0, {row + 1, col}) - return true end diff --git a/runtime/tutor/tutor.tutor b/runtime/tutor/tutor.tutor index b46fcc4836..c2d5268e3d 100644 --- a/runtime/tutor/tutor.tutor +++ b/runtime/tutor/tutor.tutor @@ -216,7 +216,7 @@ starting with "$". ## INTERACTIVE ELEMENTS *interactive* As visible in this very document, vim-tutor-mode includes some interactive -elements to provide feedback to the user about his progress. If the text in +elements to provide feedback to the user about their progress. If the text in these elements satisfies some set condition, a ✓ sign will appear in the gutter to the left. Otherwise, a ✗ sign is displayed. |