aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* vim-patch:17dca3cb97cd (#26584)zeertzjq2023-12-15
| | | | | | | | | runtime(doc): grammar & typo fixes closes: vim/vim#13654 https://github.com/vim/vim/commit/17dca3cb97cdd7835e334b990565c8c0b93b1284 Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
* refactor(diagnostic): use named namespaces (#26568)Gregory Anders2023-12-14
| | | | | Anonymous namespaces are more difficult to extend or hook into since they do not appear in the output of nvim_get_namespaces(). Use named namespaces instead.
* docs: add comment for OSC 11 tmux passthrough (#26566)Gregory Anders2023-12-14
|
* feat(lsp): more annotationsLewis Russell2023-12-14
|
* feat(nvim_open_term): convert LF => CRLF (#26384)Raphael2023-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Unlike termopen(), nvim_open_term() PTYs do not carriage-return the cursor on newline ("\n") input. nvim --clean :let chan_id = nvim_open_term(1, {}) :call chansend(chan_id, ["here", "are", "some", "lines"]) Actual behavior: here are some lines Expected behaviour: here are some lines Solution: Add `force_crlf` option, and enable it by default.
* fix(defaults): background detection in tmux (#26557)Jaehwang Jung2023-12-14
| | | Wrap the query with passthrough sequence
* feat(diagnostics): support numhl and linehl for diagnostic signsGregory Anders2023-12-13
|
* docs(diagnostic): fix typo in exampleGregory Anders2023-12-13
|
* fix(diagnostic): check for sign namespace instead of sign groupGregory Anders2023-12-13
|
* refactor(diagnostic): set sign by using extmark (#26193)Raphael2023-12-13
| | | | after sign implementation refactor by using extmark, we can use `nvim_buf_set_extmark` to set diagnostic sign instead use `sign_define`
* fix(termcap): only call callback for requested capabilities (#26546)Gregory Anders2023-12-13
| | | | | | | If multiple XTGETTCAP requests are active at once (for example, for requesting the Ms capability and truecolor capabilities), then the TermResponse autocommand may fire for capabilities that were not requested. Instead, make sure that the provided callback is only called for capabilities that were actually requested.
* feat(iter): add `Iter.take` (#26525)Will Hopkins2023-12-12
|
* Merge pull request #26506 from tomtomjhj/tsfoldLewis Russell2023-12-11
|\ | | | | fix(treesitter): improve vim.treesitter.foldexpr
| * fix(treesitter): improve vim.treesitter.foldexprJaehwang Jung2023-12-12
| | | | | | | | | | | | | | | | | | | | | | | | * Collect on_bytes and flush at the invocation of the scheduled callback to take account of commands that triggers multiple on_bytes. * More accurately track movement of folds so that foldexpr returns reasonable values even when the scheduled computation is not run yet. * Start computing folds from the line above (+ foldminlines) the changed lines to handle the folds that are removed due to the size limit. * Shrink folds that end at the line at which another fold starts to assign proper level to that line. * Use level '=' for lines that are not computed yet.
| * fix(treesitter): fix indexing in foldexprJaehwang Jung2023-12-12
| |
* | feat(gen_lsp.lua): validate CLI args #26514Jongwook Choi2023-12-11
|/ | | | | | | | - Improve CLI argument parsing, rejects invalid argument and commands as early as possible. Also prints USAGE in the command line. - No longer allows `--<outfile>`, use `--out <outfile>` instead. - Print a little bit of verbose messages to better know what's going on rather than remaining silent at all times. - Add type annotation `gen_lsp._opt` to avoid type warnings.
* fix(snippet): remove misleading comment about TM_FILENAME_BASE (#26465)Maria José Solano2023-12-08
|
* Merge pull request #26407 from gpanders/default-tgcGregory Anders2023-12-06
|\ | | | | feat(defaults): enable 'termguicolors' by default when supported by terminal
| * feat(defaults): enable 'termguicolors' by default when supported by terminalGregory Anders2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | Enable 'termguicolors' automatically when Nvim can detect that truecolor is supported by the host terminal. If $COLORTERM is set to "truecolor" or "24bit", or the terminal's terminfo entry contains capabilities for Tc, RGB, or setrgbf and setrgbb, then we assume that the terminal supports truecolor. Otherwise, the terminal is queried (using both XTGETTCAP and SGR + DECRQSS). If the terminal's response to these queries (if any) indicates that it supports truecolor, then 'termguicolors' is enabled.
* | fix(json): allow objects with empty keys #25564Emanuel2023-12-06
|/ | | | | | | | | | | | | | | | | | | | Problem: Empty string is a valid JSON key, but json_decode() treats an object with empty key as ":help msgpack-special-dict". #20757 :echo json_decode('{"": "1"}') {'_TYPE': [], '_VAL': [['', '1']]} Note: vim returns `{'': '1'}`. Solution: Allow empty string as an object key. Note that we still (currently) disallow empty keys in object_to_vim() (since 7c01d5ff9286d262097484c680e3a4eab49e2911): https://github.com/neovim/neovim/blob/f64e4b43e1191ff30d902730f752875aa55682ce/src/nvim/api/private/converter.c#L333-L334 Fix #20757 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* feat(lua): implement Iter:join() (#26416)Gregory Anders2023-12-05
|
* refactor(api): complete conversion from `Dictionary` to `Dict(opts)` (#26365)Riccardo Mazzarini2023-12-05
|
* vim-patch:9.0.2148: Vim does not detect pacman.log fileChristian Clason2023-12-05
| | | | | | | | | | | | | | Problem: Vim does not detect pacman.log file Solution: Detect pacmanlogs and add syntax highlighting pacman.log is a filetype common to Arch Liux and related distributions. Add some simple syntax highlighting for the pacmanlog filetype. closes: vim/vim#13618 https://github.com/vim/vim/commit/1e5d66408ef85c750a5af03bbf5cc19b5de7a6bc Co-authored-by: Ronan Pigott <ronan@rjp.ie>
* fix(treesitter): allow passing lang to vim.treesitter.get_node() now ↵Jongwook Choi2023-12-04
| | | | | | | | | | correctly takes opts.lang (#26360) PROBLEM: `vim.treesitter.get_node()` does not recognize the `lang` in the option table. This option was used in somewhere else, for instance, `vim.treesitter.dev` (for `inspect_tree`) but was never implemented. SOLUTION: Make `get_node()` correctly use `opts.lang` when getting a treesitter parser.
* vim-patch:9.0.2139: html.angular ft is problematic (#26357)zeertzjq2023-12-02
| | | | | | | | | | | | | | | | | | Problem: html.angular ft is problematic Solution: partly revert v9.0.2137 The html.angular filetype causes issues and does not trigger FileType autocommands for the html or angular filetypes. So let's roll back that particular change and detect this only as html file related: https://github.com/vim/vim/pull/13594#issuecomment-1834465890 closes: vim/vim#13604 https://github.com/vim/vim/commit/4f3480c94358e3b938594fc3574477e780525cd7 Co-authored-by: Christian Brabandt <cb@256bit.org>
* fix: use BEL to terminate OSC 11 request (#26335)Gregory Anders2023-11-30
|
* vim-patch:9.0.2137: Can't detect angular & mustache filetypesObserverOfTime2023-11-30
| | | | | | | | | | Problem: Can't detect angular & mustache filetypes Solution: Detect *.mustache as Mustache filetype; detect *.component.html as html.angular filetype closes: vim/vim#13594 https://github.com/vim/vim/commit/7bed263c343c62129c5d8f51796895a28db1b312
* fix: Remove nested for_each_tree in TSTreeView (#26328)Pham Huy Hoang2023-11-30
| | | | | | | | | | | Problem: `LanguageTree:for_each_tree` calls itself for child nodes, so when we calls `for_each_tree` inside `for_each_tree`, this quickly leads to exponential tree calls. Solution: Use `pairs(child:trees())` directly in this case, as we don't need the extra callback for each children, this is already handled from the outer `for_each_tree` call
* fix(treesitter): fix parens stacking in inspector display (#26304)Gregory Anders2023-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When first opened, the tree-sitter inspector traverses all of the nodes in the buffer to calculate an array of nodes. This traversal is done only once, and _all_ nodes (both named and anonymous) are included. Toggling anonymous nodes in the inspector only changes how the tree is drawn in the buffer, but does not affect the underlying data structure at all. When the buffer is traversed and the list of nodes is calculated, we don't know whether or not anonymous nodes will be displayed in the inspector or not. Thus, we cannot determine during traversal where to put closing parentheses. Instead, this must be done when drawing. When we draw, the tree structure has been flatted into a single array, so we lose parent-child relationships that would otherwise make determining the number of closing parentheses straightforward. However, we can instead rely on the fact that a delta between the depth of a node and the depth of the successive node _must_ mean that more closing parentheses are required: (foo (bar) (baz) ↑ │ └ (bar) and (baz) have different depths, so (bar) must have an extra closing parenthesis This does not depend on whether or not anonymous nodes are displayed and so works in both cases.
* fix(treesitter): adjust indentation in inspector highlights (#26302)Gregory Anders2023-11-29
|
* fix(termcap): escape escapes in passthrough sequence (#26301)Gregory Anders2023-11-29
| | | | When using the tmux passthrough sequence any escape characters in the inner sequence must be escaped by adding another escape character.
* fix(defaults): wait until VimEnter to set background (#26284)Gregory Anders2023-11-29
| | | | | | | The OptionSet autocommand does not fire until Vim has finished starting, so setting 'background' before the VimEnter event would not fire the OptionSet event. The prior implementation also waited until VimEnter to set 'background', so this was a regression introduced when moving background detection into Lua.
* docs: document TSNode:byte_length() (#26287)Gregory Anders2023-11-29
| | | | Also update the type annotation of TSNode:id(), which returns a string, not an integer.
* fix(treesitter): make InspectTree correctly handle nested injections (#26085)Pham Huy Hoang2023-11-29
| | | | | | | Problem: Only injections under the top level tree are found. Solution: Iterate through all trees to find injections. When two injections are contained within the same node in the parent tree, prefer the injection with the larger byte length.
* fix(treesitter): use proper query syntax for inspector (#26274)Gregory Anders2023-11-29
|
* refactor: move some constants out of vim_defs.h (#26298)zeertzjq2023-11-29
|
* vim-patch:9.0.2135: No test for mode() when executing Ex commands (#26282)zeertzjq2023-11-29
| | | | | | | | | Problem: No test for mode() when executing Ex commands Solution: Add some test cases and simplify several other test cases. Also add a few more test cases for ModeChanged. closes: vim/vim#13588 https://github.com/vim/vim/commit/fcaeb3d42b228e73c669b2fce78f1d3fe112769f
* fix(termcap): use tmux passthrough sequence when running in tmux (#26281)Gregory Anders2023-11-28
| | | | | | | tmux intercepts and ignores XTGETTCAP so wrap the query in the tmux passthrough sequence to make sure the query arrives at the "host" terminal. Users must still set the 'allow-passthrough' option in their tmux.conf.
* Merge pull request #26249 from bfredl/concealcharbfredl2023-11-28
|\ | | | | feat(decoration): allow conceal_char to be a composing char
| * feat(decoration): allow conceal_char to be a composing charbfredl2023-11-28
| | | | | | | | | | | | | | | | 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.
* | docs(lua): don't include remote-only API functions (#26266)zeertzjq2023-11-28
| |
* | vim-patch:9.0.2133: Cannot detect overstrike mode in Cmdline mode (#26263)zeertzjq2023-11-28
| | | | | | | | | | | | | | | | 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
* | vim-patch:9.0.2131: not all nushell files detected (#26260)Christian Clason2023-11-28
|/ | | | | | | | | | 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>
* docs: support @since for api level #25574LW2023-11-27
| | | close #25416
* fix(treesitter): don't invalidate parser when discovering injectionsDmytro Soltys2023-11-27
| | | | | | | | | 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.
* fix(lua): disallow vim.wait() in fast contextsLewis Russell2023-11-27
| | | | | | | `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
* vim-patch:9.0.2128: runtime(swig): add syntax and filetype pluginsChristian Clason2023-11-26
| | | | | | | | | | | | | | | | | | 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>
* docs: vim.iter #26169Justin M. Keyes2023-11-25
| | | | closes #24141 closes #24746
* vim-patch:596a9f29c83a (#26146)zeertzjq2023-11-22
| | | | | | | | | | 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>
* perf(lsp): use async fs_stat for file watching on linux (#26123)Mathias Fußenegger2023-11-21
|