aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* vim-patch:8.2.4140: maparg() does not indicate the type of scriptzeertzjq2023-11-09
| | | | | | | | | 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>
* vim-patch:9.0.2095: statusline may look different than expected (#25941)zeertzjq2023-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* fix(clipboard): increase OSC 52 wait timeout (#25936)Gregory Anders2023-11-08
| | | | | | | | 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.
* refactor: move defaults into separate module (#25929)Gregory Anders2023-11-08
| | | | Move default mappings and autocommands into a separate module and add comments and docstrings to document each of the defaults.
* Merge pull request #25767 from luukvbaal/signdelbfredl2023-11-08
|\ | | | | feat(extmarks): add 'invalidate' property
| * feat(extmarks): add 'invalidate' property to extmarksLuuk van Baal2023-11-08
| | | | | | | | | | | | | | | | 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.
* | feat(clipboard): add OSC 52 clipboard supportGregory Anders2023-11-07
| | | | | | | | | | This is opt-in as not all terminal emulators support OSC 52, so it is up to the user to enable it explicitly.
* | fix(lua): correct return value for on_key with no arguments (#25911)altermo2023-11-07
| |
* | feat(tui): use TermResponse event for OSC responses (#25868)Gregory Anders2023-11-06
|/ | | | | | | | | | | | | 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
* docs(treesitter): add disclaimer about needing to parse before `get_node()`L Lllvvuu2023-11-04
| | | | | | | | | | | 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.
* vim-patch:2f54c13292afChristian Clason2023-11-04
| | | | | | | | | | | | | | | | | runtime(script.vim): make strace ft check less strict (vim/vim#13482) Strace output, depending on parameters (-ttf this time), can dump both times and pid: 1038 07:14:20.959262 execve("./e.py", ["./e.py"], 0x7ffca1422840 /* 51 vars */) = 0 <0.000150> So loose the regexp matching this, so that the above is matched too. Fixes vim/vim#13481. https://github.com/vim/vim/commit/2f54c13292af053ec00c18e5fded87b1bc602822 Co-authored-by: Jiri Slaby <jirislaby@gmail.com> Co-authored-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
* fix(lsp): create per client params in lsp.buf.code_actionMathias Fussenegger2023-11-04
| | | | | | | | | `code_action` used the same parameters for all clients, which led to the following warning and incorrect start/end column locations if using clients with mixed encodings: warning: multiple different client offset_encodings detected for buffer, this is not supported yet
* docs: small fixes (#25831)dundargoc2023-11-03
| | | Co-authored-by: Peter Aronoff <peter@aronoff.org>
* feat(stdlib): add vim.base64 module (#25843)Gregory Anders2023-10-31
| | | Add base64 encode() and decode() functions to a vim.base64 module.
* fix(lsp): call `on_list()` even for single location (#25830)Evgeni Chasnovski2023-10-31
| | | | | | | | Problem: Currently there is no way of customizing behavior of `declaration`, `definition`, `typeDefinition`, and `implementation` methods in `vim.lsp.buf` when LSP server returns `Location`. Instead, cursor jumps to that location directly. Solution: Normalize LSP response to be `Location[]` for those four cases.
* fix(lsp): do not cancel snippet when selecting placeholder (#25835)Maria José Solano2023-10-30
|
* docs: small fixes (#25585)dundargoc2023-10-29
| | | | Co-authored-by: tmummert <doczook@gmx.de> Co-authored-by: parikshit adhikari <parikshitadhikari@gmail.com>
* vim-patch:9.0.2079: Not all Dart files detectedChristian Clason2023-10-29
| | | | | | | | | | | Problem: Not all Dart files detected Solution: Add shebang filetype detection for Dart closes: vim/vim#13449 https://github.com/vim/vim/commit/c1c177a47bfe1b9a524ede2743a689e461668d14 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:8ebdbc9e6d80 (#25816)zeertzjq2023-10-29
| | | | | | | | | | runtime(doc): all secure options should note this restriction in the documentation (vim/vim#13448) Problem: Not all secure options document their status Solution: Describe secure context :set restrictions in each help entry https://github.com/vim/vim/commit/8ebdbc9e6d80b707c2b2d923e702dc86bf902923 Co-authored-by: dkearns <dougkearns@gmail.com>
* fix(diagnostic): virtual_text prefix function should have index and total ↵Jongwook Choi2023-10-27
| | | | | | | | | | | | | (#25801) The prefix option of the diagnostic virtual text can be a function, but previously it was only a function of diagnostic. This function should also have additional parameters index and total, more consistently and similarily as in the prefix function for `vim.diagnostic.open_float()`. These additional parameters will be useful when there are too many number of diagnostics in a single line.
* vim-patch:9.0.2071: objdump files not recognizedChristian Clason2023-10-27
| | | | | | | | | | | | | Problem: objdump files not recognized Solution: detect *.objdump files, add a filetype plugin Added the objdump file/text format closes: vim/vim#13425 https://github.com/vim/vim/commit/10407df7a95d0311c7d2eb920d3b72020db5b301 Co-authored-by: Colin Kennedy <colinvfx@gmail.com>
* fix(lsp): fix omnicomplete in middle of the line (#25787)Lajos Koszti2023-10-26
| | | | | | | | Fixes a regression from 5e5f5174e3faa862a9bc353aa7da41487911140b Until that commit we had a logic like this: `local prefix = startbyte and line:sub(startbyte + 1) or line_to_cursor:sub(word_boundary)` The commit changed the logic and no longer cut off the line at the cursor, resulting in a prefix that included trailing characters
* fix(lsp): cancel session when leaving snippet region (#25762)Maria José Solano2023-10-26
|
* vim-patch:partial:5985879e3c36 (#25780)zeertzjq2023-10-26
| | | | | | | | | | | | | runtime(doc): Fix typos in several documents (vim/vim#13420) * Fix typos in several documents * Update runtime/doc/terminal.txt https://github.com/vim/vim/commit/5985879e3c36383155f84649fa42d06813a1893e Skip runtime/doc/indent.txt: not ported yet Co-authored-by: h_east <h.east.727@gmail.com> Co-authored-by: K.Takata <kentkt@csc.jp>
* vim-patch:9.0.2063: pacman hooks are detected as conf filetypeChristian Clason2023-10-24
| | | | | | | | | | | | | | | | | | | | Problem: pacman hooks are detected as conf filetype Solution: make it consistent to pacman.conf and detect those hooks as confini Because confini has much better syntax highlighting than conf. For reference, I identified pacman.conf and pacman hooks as dosini in https://github.com/vim/vim/pull/6335, then https://github.com/vim/vim/pull/10213 changed them to conf, then https://github.com/vim/vim/pull/10518 changed pacman.conf to confini but forgot to change hooks. closes: vim/vim#13399 https://github.com/vim/vim/commit/7d254dbc2db35badc65668db85f826f605486986 Co-authored-by: Guido Cella <guido@guidocella.xyz>
* vim-patch:9.0.2062: Janet files are not recognisedChristian Clason2023-10-24
| | | | | | | | | | | | | | | Problem: Janet files are not recognised Solution: Add filename and shebang detection (without adding an extra filetype plugin) Those are used by the Janet language: http://www.janet-lang.org closes: vim/vim#13400 https://github.com/vim/vim/commit/c038427d2a27445e612761f19c92b2b8b05afdea Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:9.0.2061: not able to detect xkb filetypesChristian Clason2023-10-24
| | | | | | | | | | | | | | Problem: not able to detect xkb filetypes Solution: Detect files below /u/s/X11/xkb as xkb files (without adding an extra filetype) Those files are used from the X11 xkb extension closes: vim/vim#13401 https://github.com/vim/vim/commit/ae9021a840db3253b0e0cb84186faae73368afd7 Co-authored-by: Guido Cella <guido@guidocella.xyz>
* vim-patch:9.0.2060: *.{gn,gni} files are not recognizedChristian Clason2023-10-24
| | | | | | | | | | | | | Problem: *.{gn,gni} files are not recognized Solution: Detect some as gn filetype (without adding an extra filetype) Those come from: https://gn.googlesource.com/gn/ closes: vim/vim#13405 https://github.com/vim/vim/commit/84394f2be4a750f1e26b478e36de041663f4b5a4 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
* fix(lsp): do not add extra indentationMaria José Solano2023-10-23
|
* fix(lsp): track snippet deletionMaria José Solano2023-10-23
|
* fix(lsp): fix off-by-one error for omnifunc word boundaryMathias Fussenegger2023-10-23
| | | | | | | | Fixes https://github.com/neovim/neovim/issues/25177 I initially wanted to split this into a refactor commit to make it more testable, but it appears that already accidentally fixed the issue by normalizing lnum/col to 0-indexing
* feat(complete): support f flag for complete buffer partglepnir2023-10-21
|
* refactor(lsp): deprecate completion util methodsMathias Fussenegger2023-10-21
| | | | Relates to https://github.com/neovim/neovim/issues/25272
* refactor(lsp): move completion logic into _completion moduleMathias Fussenegger2023-10-21
| | | | | To reduce cross-chatter between modules and for https://github.com/neovim/neovim/issues/25272 Also preparing for https://github.com/neovim/neovim/issues/25714
* feat(lsp): add snippet API (#25301)Maria José Solano2023-10-21
|
* fix(lsp): log unknown diagnostic tags instead of showing a warning (#25705)Jorge Mederos2023-10-21
| | | | | To be more in line with the specification: > To support the evolution of enumerations the using side of an enumeration shouldn’t fail on an enumeration value it doesn’t know. It should simply ignore it as a value it can use and try to do its best to preserve the value on round trips
* vim-patch:e08bfef88bd0Gregory Anders2023-10-19
| | | | | | | | | | | runtime(zig): Update Zig runtime files (vim/vim#13388) Update runtime files from upstream (https://github.com/zig/zig.vim) at commit 54c216e5306a5c3878a60596aacb94dca8652ab9. https://github.com/vim/vim/commit/e08bfef88bd05a9d27ee16c57cd10173e280f600 Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
* fix(treesitter): set cursor position when opening inspectorMaria José Solano2023-10-19
|
* fix(docs): fix TSNode incorrect signaturesPham Huy Hoang2023-10-19
|
* vim-patch:9.0.2041: trim(): hard to use default mask (#25692)zeertzjq2023-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: trim(): hard to use default mask (partly revert v9.0.2040) Solution: use default mask when it is empty The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. Currently, an empty 'mask' will make 'trim()' call return 'text' value that is passed in unmodified. It is unlikely that someone is using it, so the chances of scripts being broken by this change are low. Also, this reverts commit 9.0.2040 (which uses v:none for the default and requires to use an empty string instead). closes: vim/vim#13358 https://github.com/vim/vim/commit/8079917447e7436dccc2e4cd4a4a56ae0a4712f2 vim-patch:9.0.2040: trim(): hard to use default mask Problem: trim(): hard to use default mask Solution: Use default 'mask' when it is v:none The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. 'v:none' is already used to mean "use the default argument value" in user defined functions. See |none-function_argument| in help. closes: vim/vim#13363 https://github.com/vim/vim/commit/6e6386716f9494ae86027c6d34f657fd03dfec42 Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
* fix(treesitter): check that buf is loaded in autocommands (#25679)Maria José Solano2023-10-17
|
* vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security] use-after-free with wildmenu Solution: properly clean up the wildmenu when exiting Fix wildchar/wildmenu/pum memory corruption with special wildchar's Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a memory corruption if using wildmenu+pum, or wrong states if only using wildmenu. This is due to the code only using one single place inside the cmdline process loop to perform wild menu clean up (by checking `end_wildmenu`) but there are other odd situations where the loop could have exited and we need a post-loop clean up just to be sure. If the clean up was not done you would have a stale popup menu referring to invalid memory, or if not using popup menu, incorrect status line (if `laststatus=0`). For example, if you hit `<Esc>` two times when it's wildchar, there's a hard-coded behavior to exit command-line as a failsafe for user, and if you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean up code would not have hit because of specialized `<C-\>` handling. Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also used for 'wildchar'/'wildcharm'. Currently they don't behave properly, and also have potentially memory unsafe behavior as the logic is currently not accounting for this situation and try to do both. (Previous patch that addressed this: vim/vim#11677) Also, correctly document Escape key behavior (double-hit it to escape) in wildchar docs as it's previously undocumented. In addition, block known invalid chars to be set in `wildchar` option, such as Ctrl-C and `<CR>`. This is just to make it clear to the user they shouldn't be set, and is not required for this bug fix. closes: vim/vim#13361 https://github.com/vim/vim/commit/8f4fb007e4d472b09ff6bed9ffa485e0c3093699 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* fix(diagnostics): if buffer not loaded, skip handlers that set extmark (#25628)Jaehwang Jung2023-10-16
| | | | | | | | | | Problem: When enabling diagnostics, there can be diagnostics for unloaded buffer, but some handlers nevertheless attempt to set extmarks in such buffers. Solution: * Exit underline/virtual_text handler if buffer is not loaded. * Don't require is_loaded as precondition for show(), because handlers don't necessarily depend on it.
* fix(man.lua): hardwrapped manpage is not resized #25646James Barford-Evans2023-10-16
| | | | | | | | | | | Problem: If a manpage is opened, its hardwrapped dimensions are not recalculated after closing then revisiting the same manpage. Solution: Unload the manpage when it is hidden. This forces it to be reloaded, which forces the hard-wrapping to be recalculated when it is revisited. Fixes: #25457
* fix(lsp): highlight active parameter in signature help #25663Maria José Solano2023-10-16
| | | Fixes #25662
* docs: do not hardcode LSP version in URL #25648Maria José Solano2023-10-16
|
* vim-patch:9.0.2032: cannot get mouse click pos for tab or virt text (#25653)zeertzjq2023-10-15
| | | | | | | | | Problem: Cannot accurately get mouse clicking position when clicking on a TAB or with virtual text. Solution: Add a "coladd" field to getmousepos() result. closes: vim/vim#13335 https://github.com/vim/vim/commit/f5a94d5165bb9e390797da50a1fa7a87df3fbee4
* vim-patch:9.0.2030: no max callback recursion limit (#25655)zeertzjq2023-10-15
| | | | | | | | | | | | | | | Problem: no max callback recursion limit Solution: bail out, if max call recursion for callback functions has been reached. This checks the 'maxfuncdepth' setting and throws E169 when a callback function recursively calls itself. closes: vim/vim#13337 closes: vim/vim#13339 https://github.com/vim/vim/commit/47510f3d6598a1218958c03ed11337a43b73f48d Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs: restore accidentally removed line in :h 'ignorecase' (#25651)zeertzjq2023-10-15
|
* vim-patch:9.0.2024: no filetype detection for Debian sourcesChristian Clason2023-10-14
| | | | | | | | | | | Problem: no filetype detection for Debian sources Solution: Add new deb822sources filetype closes: vim/vim#13320 https://github.com/vim/vim/commit/bd734c3bead9e167eb6875f62cc06fab2379c422 Co-authored-by: James McCoy <jamessan@jamessan.com>