aboutsummaryrefslogtreecommitdiff
path: root/runtime
Commit message (Collapse)AuthorAge
* fix(semantic_tokens.lua): Fix nil tokens/data in semantic_tokens.luafix_semantic_tokens_pullJosh Rahm2023-01-19
| | | | | | | Some (poorly-implemented) LSPs can return an empty JSON object in LSP responses, which could cause tokens to be nil, which would eventually cause an error and a bad UI experience. This fix makes sure that the tokens variable is always set to a non-nil value.
* vim-patch:8.2.1698: cannot lock a variable in legacy Vim script like in Vim9 ↵zeertzjq2023-01-19
| | | | | | | | | | (#21883) Problem: Cannot lock a variable in legacy Vim script like in Vim9. Solution: Make ":lockvar 0" work. https://github.com/vim/vim/commit/a187c43cfe8863d48b2159d695fedcb71f8525c1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)zeertzjq2023-01-18
| | | | | | | | Problem: Cannot read back what setcellwidths() has done. Solution: Add getcellwidths(). (Kota Kato, closes vim/vim#11837) https://github.com/vim/vim/commit/66bb9ae70f7371456ed76518076d2a344f8ab417 Co-authored-by: Kota Kato <github@kat0h.com>
* fix(treesitter): really restore syntaxLewis Russell2023-01-17
| | | | | - also unset b:ts_highlight on stop() Fixes: #21836
* vim-patch:8.2.4617: no completion for :scriptnameszeertzjq2023-01-17
| | | | | | | | | | Problem: No completion for :scriptnames. Solution: Implement :scriptnames completion. (Yegappan Lakshmanan, closes vim/vim#10005) https://github.com/vim/vim/commit/454ce6737cadb82886f1fc0eb9e8666cc59ae42b Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.4482: no fuzzy cmdline completion for user defined completionzeertzjq2023-01-17
| | | | | | | | | | | | | | | | | Problem: No fuzzy cmdline completion for user defined completion. Solution: Add fuzzy completion for user defined completion. (Yegappan Lakshmanan, closes vim/vim#9858) https://github.com/vim/vim/commit/afd4ae35d66b2e7732eceb5ad9f6b4ece6b7c64c Cherry-pick related docs from Vim runtime. N/A patches for version.c: vim-patch:8.2.4485: compiler warning for uninitialized variable vim-patch:8.2.4732: duplicate code to free fuzzy matches Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.4608: getcompletion() does not work when 'wildoptions' has "fuzzy"zeertzjq2023-01-17
| | | | | | | | | | | Problem: getcompletion() does not work properly when 'wildoptions contains "fuzzy". Solution: Do not use addstar(). (Yegappan Lakshmanan, closes vim/vim#9992, closes vim/vim#9986) https://github.com/vim/vim/commit/e7dd0fa2c61fe71f12c72b0dcb7bb6415eb048fb Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:8.2.4463: completion only uses strict matchingSean Dewar2023-01-17
| | | | | | | | | | | | | Problem: Completion only uses strict matching. Solution: Add the "fuzzy" item for 'wildoptions'. (Yegappan Lakshmanan, closes vim/vim#9803) https://github.com/vim/vim/commit/38b85cb4d7216705058708bacbc25ab90cd61595 Use MAX_FUZZY_MATCHES in fuzzy_match_str(). Omit fuzmatch_str_free() as it is only used on allocation failure. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* Merge pull request #21768 from luukvbaal/test-virtlinezeertzjq2023-01-17
|\ | | | | | | | | | | | | | | fix(column)!: ensure 'statuscolumn' works with virtual and wrapped lines BREAKING CHANGE: In 'statuscolumn' evaluation, `v:wrap` has been replaced by `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
| * fix(column)!: ensure 'statuscolumn' works with virtual and wrapped linesLuuk van Baal2023-01-16
| | | | | | | | | | | | | | | | | | | | Problem: The `'statuscolumn'` was not re-evaluated for wrapped lines, when preceded by virtual/filler lines. There was also no way to distinguish virtual and wrapped lines in the status column. Solution: Make sure to rebuild the statuscolumn, and replace variable `v:wrap` with `v:virtnum`. `v:virtnum` is negative when drawing virtual lines, zero when drawing the actual buffer line, and positive when drawing the wrapped part of a buffer line.
* | feat(health): detect tmux RGB support via `client_termfeatures`Sean Dewar2023-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: On tmux v3.2+, the `terminal-features` option may be used to enable RGB capabilities over `terminal-overrides`. However, `show-messages` cannot be used to detect if RGB capabilities are enabled using `terminal-features`. Solution: Try to use `display-message -p #{client_termfeatures}` instead. The returned features include "RGB" if either "RGB" is set in `terminal-features`, or if "Tc" or "RGB" is set in `terminal-overrides` (as before). Nothing is returned by tmux versions older than v3.2, so fallback to checking `show-messages` in that case. Also, un-Vimscriptify the previous logic a bit, and change the error message to point to using the `terminal-features` option instead for newer tmux versions.
* | fix(health): fix `tmux_esc_time` comparisonSean Dewar2023-01-16
|/ | | | | | | Regression from the health.vim to .lua changes. Unlike Vim script, Lua does not implicitly convert strings to numbers, so this comparison threw an error.
* docs: treesitter.add_directive, add_predicate #21206Ching Pei Yang2023-01-16
|
* refactor: remove E5500, adjust testszeertzjq2023-01-16
| | | | | | Now with try_end() including more exception info, E5500 looks like redundant information. Adjust tests for more exception information.
* health: migrate to Lua #21661TJ DeVries2023-01-16
| | | | * refactor: remove all vimscript from nvim/health * fixup: previous method broke if you had a folder named 'x-lua'
* docs(news): graduation of msgsep #21826zeertzjq2023-01-16
|
* docs(lua): use luaref tag instead of www.lua.org #21813Naru2023-01-15
|
* refactor: format with stylua (#21821)dundargoc2023-01-15
|
* docs(lua): lua-guide: <Nop> is for rhs of vim.keymap.set(), not lhs (#21814)Naru2023-01-15
|
* vim-patch:8.2.4565: no command line completion for :breakadd and :breakdelzeertzjq2023-01-15
| | | | | | | | Problem: No command line completion for :breakadd and :breakdel. Solution: Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan, closes vim/vim#9950) https://github.com/vim/vim/commit/6e2e2cc95b913e33145047e0fade5193da6e4379
* docs: builtin TUI is no longer channel 0 (#21794)zeertzjq2023-01-15
|
* vim-patch:9.0.1191: some Bazel files are not recognized (#21784)Christian Clason2023-01-13
| | | | | | | | Problem: Some Bazel files are not recognized. Solution: Add an extra Bazel pattern. (Keith Smily, closes vim/vim#11807) https://github.com/vim/vim/commit/3213952966896ffb1d8fa186bcf8c43359fca0f0 Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
* feat(diagnostic): vim.diagnostic.is_disabled() #21527Raphael2023-01-12
|
* docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)Chris Kipp2023-01-12
| | | | | This small changes just ensures that if you're using `convert_input_to_markdown_lines` without `contents` you don't get a warning (when using something like neodev) that there is an expected second param, since it can be nil.
* vim-patch:9.0.1182: go checksum files are not recognized (#21758)Christian Clason2023-01-12
| | | | | | | | | Problem: go checksum files are not recognized. Solution: Add the name of go checksum files. (Amaan Qureshi, closes vim/vim#11803) https://github.com/vim/vim/commit/043d7b2c84cda275354aa023b5769660ea70a168 Co-authored-by: Amaan Q <amaanq12@gmail.com>
* fix(lsp): revert semantic token gravity change from #21574 (#21763)jdrouhard2023-01-12
|
* docs(lsp): update buf_notify and rpc.notify params types (#21753)Chris Kipp2023-01-11
| | | | | | | | Small, but I was getting warnings about my usage of `vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs say that `params` must be a string, however this can really be anything when it's passed to `rpc.notify` since we just end up calling `vim.json.encode(payload)` on it. This fixes the docs in those two places and regenerates them.
* vim-patch:9.0.1176: smithy files are not recognized (#21751)Christian Clason2023-01-11
| | | | | | | | | Problem: smithy files are not recognized. Solution: Add a pattern for Smithy files. (Chris Kipp, closes vim/vim#11804) https://github.com/vim/vim/commit/f68cddabffcbc5b8fbfe9003182cb4b55ff8d72c Co-authored-by: Chris Kipp <ckipp@pm.me>
* vim-patch:9.0.1174: smali files are not recognized (#21734)Amaan Qureshi2023-01-10
| | | | Problem: Smali files are not recognized. Solution: Add a pattern for Smali files. (Amaan Qureshi, closes vim/vim#11801)
* feat(float): open float relative to mouse #21531Sebastian Lyng Johansen2023-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No easy way to position a LSP hover window relative to mouse. Solution: Introduce another option to the `relative` key in `nvim_open_win()`. With this PR it should be possible to override the handler and do something similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674 to have hover information displayed from the mouse. Test case: ```lua local util = require('vim.lsp.util') local function make_position_param(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) local row, col local mouse = vim.fn.getmousepos() row = mouse.line col = mouse.column offset_encoding = offset_encoding or util._get_offset_encoding(buf) row = row - 1 local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1] if not line then return { line = 0, character = 0 } end if #line < col then return { line = 0, character = 0 } end col = util._str_utfindex_enc(line, col, offset_encoding) return { line = row, character = col } end local make_params = function(window, offset_encoding) window = window or 0 local buf = vim.api.nvim_win_get_buf(window) offset_encoding = offset_encoding or util._get_offset_encoding(buf) return { textDocument = util.make_text_document_params(buf), position = make_position_param(window, offset_encoding), } end local hover_timer = nil vim.o.mousemoveevent = true vim.keymap.set({ '', 'i' }, '<MouseMove>', function() if hover_timer then hover_timer:close() end hover_timer = vim.defer_fn(function() hover_timer = nil local params = make_params() vim.lsp.buf_request( 0, 'textDocument/hover', params, vim.lsp.with(vim.lsp.handlers.hover, { silent = true, focusable = false, relative = 'mouse', }) ) end, 500) return '<MouseMove>' end, { expr = true }) ```
* vim-patch:1b5f03ec9c55 (#21715)Christian Clason2023-01-10
| | | | | | | | Update runtime files https://github.com/vim/vim/commit/1b5f03ec9c5551047d5de8d845541dd3201abe7c Co-authored-by: Bram Moolenaar <Bram@vim.org>
* fix(ui): set stc to empty in floatwin with minimal style (#21720)Raphael2023-01-10
| | | fix(ui): set stc to emtpy in floatwin with minimal style
* feat(ui): add 'statuscolumn' optionluukvbaal2023-01-09
| | | | | | | | Problem: Unable to customize the column next to a window ('gutter'). Solution: Add 'statuscolumn' option that follows the 'statusline' syntax, allowing to customize the status column. Also supporting the %@ click execute function label. Adds new items @C and @s which will print the fold and sign columns. Line numbers and signs can be clicked, highlighted, aligned, transformed, margined etc.
* dist: transpile cfilter.vim => cfilter.lua #21662TJ DeVries2023-01-08
| | | | Vim has changed cfilter.vim from vimscript to vim9script. Nvim supports only vimscript, not vim9script.
* feat(lsp): show active clients in :checkhealth vim.lsp (#21670)Mathias Fußenegger2023-01-08
| | | | | For users using vim.lsp.start it can be useful to get an overview of active client that is less verbose than a full `:lua =vim.lsp.get_active_clients()`
* fix(lsp): partially revert semantic token gravity change from #21574 (#21680)jdrouhard2023-01-08
|
* fix(editorconfig): do not highlight unknown properties as errors (#21673)Gregory Anders2023-01-07
| | | | | | | | | Other plugins may define their own custom properties outside of Neovim's builtin EditorConfig support. Instead of highlighting these unknown properties as errors, do not highlight them at all. This still differentiates between known and unknown properties, which helps to catch typos or mistakes, but does not use the garish "error" highlight that signals something is wrong.
* refactor(editorconfig)!: change editorconfig_enable to editorconfigGregory Anders2023-01-07
|
* feat(editorconfig): allow editorconfig to be toggled dynamicallyGregory Anders2023-01-07
| | | | | | | | | Rather than only check `editorconfig_enable` when the plugin is loaded, check it each time the autocommand fires, so that users may enable or disable it dynamically. Also check for a buffer local version of the variable, so that editorconfig can be enabled or disabled per-buffer.
* feat(lua): store "nvim -l" scriptname in _G.arg[0]Justin M. Keyes2023-01-07
|
* fix(lsp): correct callHierarchy capability to fix lsp.buf.incoming_calls() ↵2023-01-06
| | | | | (#21665) Co-authored-by: maozhongzhou <maozhongzhou@wps.cn>
* feat(lua): execute stdin ("-") as LuaJustin M. Keyes2023-01-05
|
* feat(lua): send "--" literally to Lua "-l" scriptJustin M. Keyes2023-01-05
| | | | | | | | | | | | Problem: When "-l" is followed by "--", we stop sending args to the Lua script and treat "--" in the usual way. This was for flexibility but didn't have a strong use-case, and has these problems: - prevents Lua "-l" scripts from handling "--" in their own way. - complicates the startup logic (must call nlua_init before command_line_scan) Solution: Don't treat "--" specially if it follows "-l".
* feat(lua)!: execute Lua with "nvim -l"Justin M. Keyes2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim has Lua but the "nvim" CLI can't easily be used to execute Lua scripts, especially scripts that take arguments or produce output. Solution: - support "nvim -l [args...]" for running scripts. closes #15749 - exit without +q - remove lua2dox_filter - remove Doxyfile. This wasn't used anyway, because the doxygen config is inlined in gen_vimdoc.py (`Doxyfile` variable). - use "nvim -l" in docs-gen CI job Examples: $ nvim -l scripts/lua2dox.lua --help Lua2DoX (0.2 20130128) ... $ echo "print(vim.inspect(_G.arg))" | nvim -l - --arg1 --arg2 $ echo 'print(vim.inspect(vim.api.nvim_buf_get_text(1,0,0,-1,-1,{})))' | nvim +"put ='text'" -l - TODO? -e executes Lua code -l loads a module -i enters REPL _after running the other arguments_.
* dist: generated version of ccomplete.vim (#21623)TJ DeVries2023-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first PR featuring a conversion of an upstream vim9script file into a Lua file. The generated file can be found in `runtime/autoload/ccomplete.vim` in the vim repository. Below is a limited history of the changes of that file at the time of conversion. ``` ❯ git log --format=oneline runtime/autoload/ccomplete.vim c4573eb12dba6a062af28ee0b8938d1521934ce4 Update runtime files a4d131d11052cafcc5baad2273ef48e0dd4d09c5 Update runtime files 4466ad6baa22485abb1147aca3340cced4778a66 Update runtime files d1caa941d876181aae0ebebc6ea954045bf0da24 Update runtime files 20aac6c1126988339611576d425965a25a777658 Update runtime files. 30b658179962cc3c9f0a98f071b36b09a36c2b94 Updated runtime files. b6b046b281fac168a78b3eafdea9274bef06882f Updated runtime files. 00a927d62b68a3523cb1c4f9aa3f7683345c8182 Updated runtime files. 8c8de839325eda0bed68917d18179d2003b344d1 (tag: v7.2a) updated for version 7.2a ... ``` The file runtime/lua/_vim9script.lua only needs to be updated when vim9jit is updated (for any bug fixes or new features, like implementing class and interface, the latest in vim9script). Further PRs will improve the DX of generated the converted lua and tracking which files in the neovim's code base have been generated.
* docs(lua): adjust some type annotationsnotomo2023-01-04
|
* docs: fix typos (#21427)dundargoc2023-01-04
| | | | | | Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Tomas Nemec <nemi@skaut.cz>
* Merge pull request #21633 from gpanders/editorconfigGregory Anders2023-01-03
|\ | | | | Builtin EditorConfig support
| * docs(editorconfig): add editorconfig.txtGregory Anders2023-01-03
| |
| * docs(editorconfig): update news.txtGregory Anders2023-01-03
| |