summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim
AgeCommit message (Collapse)AuthorFiles
2023-11-28Merge pull request #26249 from bfredl/concealcharbfredl1
feat(decoration): allow conceal_char to be a composing char
2023-11-28feat(decoration): allow conceal_char to be a composing charbfredl1
decor->text.str pointer must go. This removes it for conceal char, in preparation for a larger PR which will also handle the sign case. By actually allowing composing chars for a conceal chars, this becomes a feature and not just a refactor, as a bonus.
2023-11-28docs(lua): don't include remote-only API functions (#26266)zeertzjq1
2023-11-28vim-patch:9.0.2133: Cannot detect overstrike mode in Cmdline mode (#26263)zeertzjq1
Problem: Cannot detect overstrike mode in Cmdline mode Solution: Make mode() return "cr" for overstrike closes: vim/vim#13569 https://github.com/vim/vim/commit/d1c3ef1f47c87d1da056c56564e1985fe6f2931d
2023-11-28vim-patch:9.0.2131: not all nushell files detected (#26260)Christian Clason1
Problem: not all nushell files detected Solution: use *.nu to detect nushell files closes: vim/vim#13586 https://github.com/vim/vim/commit/b9efc72c2432f2d2a633c12d3a5b9fc3efb7b6e7 Co-authored-by: Daniel Buch Hansen <boogiewasthere@gmail.com>
2023-11-27docs: support @since for api level #25574LW1
close #25416
2023-11-27fix(treesitter): don't invalidate parser when discovering injectionsDmytro Soltys1
When parsing with a range, languagetree looks up injections and adds them if needed. This explicitly invalidates parser, making `is_valid` report `false` both when including and excluding children. This is an attempt to describe desired behaviour of `is_valid` in tests, with what ended up being a single line change to satisfy them.
2023-11-27fix(lua): disallow vim.wait() in fast contextsLewis Russell2
`vim.wait()` cannot be called in a fast callback since the main loop cannot be run in that context as it is not reentrant Fixes #26122
2023-11-26vim-patch:9.0.2128: runtime(swig): add syntax and filetype pluginsChristian Clason2
Add syntax and filetype plugins for SWIG (Simplified Wrapper Interface Generator) description files. The default syntax for .i files highlights comments in a reverse color scheme which doesn't look well. This syntax builds on vim's c++ syntax by adding highlighting for common swig directives and user defined directives. For an alternative syntax, see vimscript vim/vim#1247 (which I found after writing this). closes: vim/vim#13562 https://github.com/vim/vim/commit/2e31065a650015892179e520038bf2083a9519b6 Co-authored-by: Julien Marrec <julien.marrec@gmail.com> Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2023-11-25docs: vim.iter #26169Justin M. Keyes1
closes #24141 closes #24746
2023-11-22vim-patch:596a9f29c83a (#26146)zeertzjq1
runtime(doc): Fix whitespace and formatting of some help files (vim/vim#13549) https://github.com/vim/vim/commit/596a9f29c83af85ace1a2702c88591851ad14df8 N/A patch: vim-patch:aabca259fa48 Co-authored-by: h_east <h.east.727@gmail.com>
2023-11-21perf(lsp): use async fs_stat for file watching on linux (#26123)Mathias Fußenegger1
2023-11-21fix(vim.region): handle multibyte inclusive selection properly (#26129)zeertzjq1
2023-11-20refactor(lsp): add type annotations to _watchfiles (#26109)Mathias Fußenegger1
2023-11-19perf(lsp): replace file polling on linux with per dir watcher (#26108)Mathias Fußenegger1
Should help with https://github.com/neovim/neovim/issues/23291 On linux `new_fs_event` doesn't support recursive watching, but we can still use it to watch folders. The downside of this approach is that we may end up sending some false `Deleted` events. For example, if you save a file named `foo` there will be a intermediate `foo~` due to the save mechanism of neovim. The events we get from vim.uv in that case are: - rename: foo~ - rename: foo~ - rename: foo - rename: foo - change: foo - change: foo The mechanism in this PR uses a debounce to reduce this to: - deleted: foo~ - changed: foo `foo~` will be the false positive. I suspect that for the LSP case this is good enough. If not, we may need to follow up on this and keep a table in memory that tracks available files.
2023-11-18Merge pull request #25724 from luukvbaal/signmergebfredl2
refactor(sign): move legacy signs to extmarks
2023-11-17feat(lsp): support for choice snippet nodesMaria José Solano1
2023-11-17refactor(sign): move legacy signs to extmarksLuuk van Baal2
Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
2023-11-17refactor(grid): make screen rendering more multibyte than ever beforebfredl1
Problem: buffer text with composing chars are converted from UTF-8 to an array of up to seven UTF-32 values and then converted back to UTF-8 strings. Solution: Convert buffer text directly to UTF-8 based schar_T values. The limit of the text size is now in schar_T bytes, which is currently 31+1 but easily could be raised as it no longer multiplies the size of the entire screen grid when not used, the full size is only required for temporary scratch buffers. Also does some general cleanup to win_line text handling, which was unnecessarily complicated due to multibyte rendering being an "opt-in" feature long ago. Nowadays, a char is just a char, regardless if it consists of one ASCII byte or multiple bytes.
2023-11-16fix(osc52): use `p` for primary selection instead of `s` (#26076)Tomasz N1
Co-authored-by: Gregory Anders <greg@gpanders.com>
2023-11-16refactor: use optional base argument of tonumber (#26070)Gregory Anders1
2023-11-16feat(clipboard): enable OSC 52 clipboard provider by default (#26064)Gregory Anders2
Use the XTGETTCAP sequence to determine if the host terminal supports the OSC 52 sequence and, if it does, enable the OSC 52 clipboard provider by default. This is only done automatically when all of the following are true: 1. Nvim is running in the TUI 2. 'clipboard' is not set to unnamed or unnamedplus 3. g:clipboard is unset 4. Nvim is running in an SSH connection ($SSH_TTY is set) 5. Nvim is not running inside tmux ($TMUX is unset)
2023-11-16feat: add vim.text module (#26069)Gregory Anders2
2023-11-16feat(tui): support DCS responses in TermResponse event (#26061)Gregory Anders1
2023-11-14fix: only attempt to close timer if not already closing (#26047)Gregory Anders1
This fixes an error that can occur in certain pathological cases when the autocommand fires at just the right time such that it attempts to close the timer after the timer has already exited, but before the scheduled callback has fired. We now let the timer continue to run even when the autocommand deletes itself to avoid having to repeat the cleanup code multiple times. There is no harm in letting the timer execute if the autocommand does not exist, as the pcall will catch the error.
2023-11-14vim-patch:9.0.2104: wast filetype should be replaced by wat filetypeChristian Clason1
Problem: wast filetype should be replaced by wat filetype Solution: start using the official wat filetype name runtime: rename `wast` filetype to `wat` (Wasm text format) The problem is the name of the current filetype wast. When the plugin was initially created, the file extension for Wasm text format was not fixed and .wast was more popular. However, recently .wat became the official file extension for WebAssembly text (WAT) format and .wast is now a file extension for the unofficial WAST format, which is a superset of .wat for the convenience to describe the Wasm specification conformance tests. https://webassembly.js.org/docs/contrib-wat-vs-wast.html However for now, let's keep using the `wat` filetype even for the .wast extension, so that we at least do not lose the filetype settings and syntax highlighting. This can be adjusted later, if it turns out to have a separate need for. closes: vim/vim#13533 https://github.com/vim/vim/commit/bc8f79d36a456054ed29f46585830af6d71f57c8 Co-authored-by: rhysd <lin90162@yahoo.co.jp>
2023-11-14feat(tui): add 'termsync' option (#25871)Gregory Anders1
The 'termsync' option enables a mode (provided the underlying terminal supports it) where all screen updates during a redraw cycle are buffered and drawn together when the redraw is complete. This eliminates tearing or flickering in cases where Nvim redraws slower than the terminal redraws the screen.
2023-11-14refactor: vim.ui.clipboard #26040Justin M. Keyes1
Problem: Platform-specific UI providers should live in `vim.ui.*`. #24164 Solution: - Move `vim.clipboard.osc52` module to `vim.ui.clipboard.osc52`. - TODO: move all of `clipboard.vim` to `vim.ui.clipboard`. ref #25872
2023-11-13refactor: move background color detection into LuaGregory Anders1
2023-11-13fix(lsp): advertise workspace.didChangeConfiguration capability (#26028)Chris Simon1
This ensures workspace/didChangeConfiguration notification sent after init is correctly handled
2023-11-13fix(clipboard): make osc52 work with PUC Lua (#26014)zeertzjq1
2023-11-13vim-patch:9.0.2103: recursive callback may cause issues on some archs (#26013)zeertzjq1
Problem: recursive callback may cause issues on some archs Solution: Decrease the limit drastically to 20 Recursive callback limit causes problems on some architectures Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test that causes a recursive popup callback function to be executed. However it seems the current limit of 'maxfuncdepth' option value is still too recursive for some 32bit architectures (e.g. 32bit ARM). So instead of allowing a default limit of 100 (default value for 'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a use case where one would need such a high recursive callback limit and a limit of 20 seems reasonable (although it is currently hard-coded). closes: vim/vim#13495 closes: vim/vim#13502 https://github.com/vim/vim/commit/2076463e383901cef44685aaf4b63e4306444f9e Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12feat(lsp)!: vim.lsp.inlay_hint.get(), enable(), is_enabled() #25512LW3
refactor!: `vim.lsp.inlay_hint()` -> `vim.lsp.inlay_hint.enable()` Problem: The LSP specification allows inlay hints to include tooltips, clickable label parts, and code actions; but Neovim provides no API to query for these. Solution: Add minimal viable extension point from which plugins can query for inlay hints in a range, in order to build functionality on top of. Possible Next Steps --- - Add `virt_text_idx` field to `vim.fn.getmousepos()` return value, for usage in mappings of `<LeftMouse>`, `<C-LeftMouse>`, etc
2023-11-12vim-patch:9.0.2098: No filetype support for xcompose files (#25983)ObserverOfTime1
Problem: No filetype support for xcompose files Solution: Add filetype detection closes: vim/vim#13508 https://github.com/vim/vim/commit/4f9074b96cc7efb1c829ca74902a851551dcf4e8
2023-11-12vim-patch:1b08d2cd0789 (#25993)zeertzjq1
runtime(doc): clarify when formatoptions applies closes: vim/vim#13503 https://github.com/vim/vim/commit/1b08d2cd0789fd9aaae148a64ff46342730022d7 Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-12vim-patch:9.0.2097: No support for cypher filesChristian Clason1
Problem: No support for cypher files Solution: Add cypher filetype detection Cypher query language support to work with (mostly) graph databases. Already existing lsp support in Neovim's nvim-lspconfig: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#cypher_ls closes: vim/vim#13516 https://github.com/vim/vim/commit/8f0fe20ff1a13b468fdfaf85c434475f75c7a615 Co-authored-by: Gerrit Meier <meistermeier@gmail.com>
2023-11-09vim-patch:8.2.4932: not easy to filter the output of maplist()zeertzjq1
Problem: Not easy to filter the output of maplist(). Solution: Add mode_bits to the dictionary. (Ernie Rael, closes vim/vim#10356) https://github.com/vim/vim/commit/d8f5f766219273a8579947cc80b92580b6988a4b Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09vim-patch:8.2.4861: it is not easy to restore saved mappingszeertzjq1
Problem: It is not easy to restore saved mappings. Solution: Make mapset() accept a dict argument. (Ernie Rael, closes vim/vim#10295) https://github.com/vim/vim/commit/51d04d16f21e19d6eded98f9530d84089102f925 Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09vim-patch:8.2.4825: can only get a list of mappingszeertzjq1
Problem: Can only get a list of mappings. Solution: Add the optional {abbr} argument. (Ernie Rael, closes vim/vim#10277) Rename to maplist(). Rename test file. https://github.com/vim/vim/commit/09661203ecefbee6a6f09438afcff1843e9dbfb4 Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09vim-patch:8.2.4820: not simple programmatic way to find a specific mappingzeertzjq1
Problem: Not simple programmatic way to find a specific mapping. Solution: Add getmappings(). (Ernie Rael, closes vim/vim#10273) https://github.com/vim/vim/commit/659c240cf769925ff432b88df8719e7ace4629b0 Co-authored-by: Ernie Rael <errael@raelity.com>
2023-11-09vim-patch:8.2.4140: maparg() does not indicate the type of scriptzeertzjq1
Problem: maparg() does not indicate the type of script where it was defined. Solution: Add "scriptversion". https://github.com/vim/vim/commit/a9528b39a666dbaa026320f73bae4b1628a7fe51 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-11-09vim-patch:9.0.2095: statusline may look different than expected (#25941)zeertzjq1
Problem: statusline may look different than expected Solution: do not check for highlighting of stl and stlnc characters statusline fillchar may be different than expected If the highlighting group for the statusline for the current window |hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared (or do not differ from each other), than Vim will use the hard-coded fallback values '^' (for the non-current windows) or '=' (for the current window). I believe this was done, to make sure the statusline will always be visible and be distinguishable from the rest of the window. However, this may be unexpected, if a user explicitly defined those fillchar characters just to notice that those values are then not used by Vim. So, let's assume users know what they are doing and just always return the configured stl and stlnc values. And if they want the statusline to be non-distinguishable from the rest of the window space, so be it. It is their responsibility and Vim shall not know better what to use. fixes: vim/vim#13366 closes: vim/vim#13488 https://github.com/vim/vim/commit/6a650bf696f1df3214b3d788947447c5bbf1a77d Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-08fix(clipboard): increase OSC 52 wait timeout (#25936)Gregory Anders1
When pasting with OSC 52 some terminals show a prompt to the user asking for permission to read from the system clipboard. When this prompt appears, 1s is not long enough to wait. Increase the timeout to 10s and show a message to the user indicating how to interrupt the wait after 1s.
2023-11-08refactor: move defaults into separate module (#25929)Gregory Anders2
Move default mappings and autocommands into a separate module and add comments and docstrings to document each of the defaults.
2023-11-08Merge pull request #25767 from luukvbaal/signdelbfredl2
feat(extmarks): add 'invalidate' property
2023-11-08feat(extmarks): add 'invalidate' property to extmarksLuuk van Baal2
Problem: No way to have extmarks automatically removed when the range it is attached to is deleted. Solution: Add new 'invalidate' property that will hide a mark when the entirety of its range is deleted. When "undo_restore" is set to false, delete the mark from the buffer instead.
2023-11-07feat(clipboard): add OSC 52 clipboard supportGregory Anders1
This is opt-in as not all terminal emulators support OSC 52, so it is up to the user to enable it explicitly.
2023-11-07fix(lua): correct return value for on_key with no arguments (#25911)altermo1
2023-11-06feat(tui): use TermResponse event for OSC responses (#25868)Gregory Anders1
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. The escape sequence is also included in the "data" field of the autocommand callback when the autocommand is defined in Lua. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: https://github.com/neovim/neovim/issues/25856
2023-11-04docs(treesitter): add disclaimer about needing to parse before `get_node()`L Lllvvuu1
Problem: --- Misuse of `get_node()` is common: https://github.com/search?q=get_node_at_cursor+language%3Alua&type=code Solution: --- Add a note clarifying proper usage.