aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
| * fix(treesitter): don't update fold if tree is unchangedJaehwang Jung2023-09-13
| | | | | | | | | | | | | | | | | | | | | | Problem: Folds are opened when the visible range changes even if there are no modifications to the buffer, e.g, when using zM for the first time. If the parsed tree was invalid, on_win re-parses and gets empty tree changes, which triggers fold updates. Solution: Don't update folds in on_changedtree if there are no changes.
| * fix(treesitter): fixup for InspectTreeLewis Russell2023-09-12
| | | | | | | | Fixes #25120
| * fix(treesitter): remove more double recursionLewis Russell2023-09-12
| | | | | | | | Do not call `for_each_child` in functions that are already recursive.
| * feat(extmark): support proper multiline rangesbfredl2023-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The removes the previous restriction that nvim_buf_set_extmark() could not be used to highlight arbitrary multi-line regions The problem can be summarized as follows: let's assume an extmark with a hl_group is placed covering the region (5,0) to (50,0) Now, consider what happens if nvim needs to redraw a window covering the lines 20-30. It needs to be able to ask the marktree what extmarks cover this region, even if they don't begin or end here. Therefore the marktree needs to be augmented with the information covers a point, not just what marks begin or end there. To do this, we augment each node with a field "intersect" which is a set the ids of the marks which overlap this node, but only if it is not part of the set of any parent. This ensures the number of nodes that need to be explicitly marked grows only logarithmically with the total number of explicitly nodes (and thus the number of of overlapping marks). Thus we can quickly iterate all marks which overlaps any query position by looking up what leaf node contains that position. Then we only need to consider all "start" marks within that leaf node, and the "intersect" set of that node and all its parents. Now, and the major source of complexity is that the tree restructuring operations (to ensure that each node has T-1 <= size <= 2*T-1) also need to update these sets. If a full inner node is split in two, one of the new parents might start to completely overlap some ranges and its ids will need to be moved from its children's sets to its own set. Similarly, if two undersized nodes gets joined into one, it might no longer completely overlap some ranges, and now the children which do needs to have the have the ids in its set instead. And then there are the pivots! Yes the pivot operations when a child gets moved from one parent to another.
| * fix(languagetree): remove double recursion in LanguageTree:parseL Lllvvuu2023-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `LanguageTree:parse` is recursive, and calls `LanguageTree:for_each_child`, which is also recursive. That means that, starting from the third level (child of child of root), nodes will be parsed twice. Which then means that if the tree is N layers deep, there will be ~2^N parses even if the branching factor is 1. Now, why was the tree deepening with each character inserted? And why did this only regress in #24647? These are mysteries for another time. Fixes: #25104
| * fix(decorations): better approximation of botline #24794Jaehwang Jung2023-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: * The guessed botline might be smaller than the actual botline e.g. when there are folds and the user is typing in insert mode. This may result in incorrect treesitter highlights for injections. * botline can be larger than the last line number of the buffer, which results in errors when placing extmarks. Solution: * Take a more conservative approximation. I am not sure if it is sufficient to guarantee correctness, but it seems to be good enough for the case mentioned above. * Clamp it to the last line number. Co-authored-by: Lewis Russell <me@lewisr.dev>
| * Merge pull request #24901 from faergeek/more-intuitive-cursor-updatebfredl2023-09-11
| |\ | | | | | | fix(api): more intuitive cursor updates in nvim_buf_set_text
| | * fix(api): more intuitive cursor updates in nvim_buf_set_textSergey Slipchenko2023-09-11
| | | | | | | | | | | | Fixes #22526
| * | vim-patch:9.0.1891: No runtime support for MojoChristian Clason2023-09-11
| |/ | | | | | | | | | | | | | | | | | | | | | | Problem: No runtime support for Mojo Solution: Add basic filetype and syntax plugins closes: vim/vim#13062 closes: vim/vim#13063 https://github.com/vim/vim/commit/0ce2c594d0704f27a16d2c13fce85d596cc91489 Co-authored-by: Mahmoud Abduljawad <mahmoud@masaar.com>
| * feat(lsp): improve control over placement of floating windows (#24494)Grace Petryk2023-09-10
| |
| * fix(highlight): add create param in nvim_get_hlglepnir2023-09-09
| |
| * feat(runtime): highlight hl groups in syntax.txt (#25050)zeertzjq2023-09-08
| | | | | | | | | | | | - Add runtime/lua/vim/vimhelp.lua, which is a translation of Vim's runtime/import/dist/vimhelp.vim. - Unlike Vim, run the highlighting from an ftplugin file instead of a syntax file, so that it is run even if using treesitter.
| * feat(lsp): add original LSP Location as item's user_data in ↵Tom Praschan2023-09-07
| | | | | | | | locations_to_items (#23743)
| * fix(diagnostic): always return copies of diagnostic items (#25010)Evgeni Chasnovski2023-09-06
| |
| * fix: windows timeouts have exit code 1Lewis Russell2023-09-05
| |
| * refactor(vim.system): factor out on_exit handlingLewis Russell2023-09-05
| |
| * fix(vim.system): make timeout work properlyLewis Russell2023-09-05
| | | | | | | | Mimic the behaviour of timeout(1) from coreutils.
| * fix(vim.system): let on_exit handle cleanup after killLewis Russell2023-09-05
| | | | | | | | Fixes #25000
| * build: bump lpeg to 1.1.0 (#25016)dundargoc2023-09-04
| | | | | | | | Release notes indicates it has better UTF8 handling which is relevant for us.
| * vim-patch:9.0.1856: issues with formatting positional arguments (#25013)zeertzjq2023-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: issues with formatting positional arguments Solution: fix them, add tests and documentation closes: vim/vim#12140 closes: vim/vim#12985 Tentatively fix message_test. Check NULL ptr. https://github.com/vim/vim/commit/aa90d4f031f73a34aaef5746931ea746849a2231 Co-authored-by: Christ van Willegen <cvwillegen@gmail.com>
| * fix(lsp): wrong iterator in registerCapability handler (#24971)TheBlob422023-09-01
| |
| * refactor(lsp): add type annotation for lsp.Client.server_capabilities (#24925)Jongwook Choi2023-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The class `lsp.Client` has a public member `server_capabilities`, which is assumed to be non-nil once initialized, as documented in `:help vim.lsp.client`. Due to the possibility that it may be nil before initialization, `lsp.Client` was not having a proper lua type annotations on the field `server_capabilities`. Instead of having a nil `server_capabilities` until initialized in the RPC response callback, we can have an initial value of empty table. This CHANGES the behavior of the `server_capabilities` field in a way that it is no longer `nil` until initialization. Note that, as already documented, `server_capabilities` should never be nil when it is once initialized and thus ready to be used in user configs.
| * fix(lsp): only disable inlay hints / diagnostics if no other clients are ↵Chris AtLee2023-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connected (#24535) This fixes the issue where the LspNotify handlers for inlay_hint / diagnostics would end up refreshing all attached clients. The handler would call util._refresh, which called vim.lsp.buf_request, which calls the method on all attached clients. Now util._refresh takes an optional client_id parameter, which is used to specify a specific client to update. This commit also fixes util._refresh's handling of the `only_visible` flag. Previously if `only_visible` was false, two requests would be made to the server: one for the visible region, and one for the entire file. Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com> Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
| * vim-patch:9.0.1820: Rexx files may not be recognised (#24956)zeertzjq2023-08-31
| | | | | | | | | | | | | | | | | | | | | | Problem: Rexx files may not be recognised Solution: Add shebang detection and improve disambiguation of *.cls files closes: vim/vim#12951 https://github.com/vim/vim/commit/e06afb7860805537ccd69966bc03169852c9b378 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * vim-patch:9.0.1797: Vimball/Visual Basic filetype detection conflict (#24947)zeertzjq2023-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Vimball/Visual Basic filetype detection conflict Solution: runtime(vb): Improve Vimball and Visual Basic detection logic Only run Vimball Archiver's BufEnter autocommand on Vimball archives. Fixes vim/vim#2694. closes: vim/vim#12899 https://github.com/vim/vim/commit/f97f6bbf56408c0c97b4ddbe81fba858d7455b0d Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * vim-patch:9.0.1807: runtime: crystal scripts not recognised (#24949)zeertzjq2023-08-31
| | | | | | | | | | | | | | | | | | | | Problem: runtime: crystal scripts not recognised Solution: Filetype detect Crystal scripts by shebang line closes: vim/vim#12935 https://github.com/vim/vim/commit/9b73902dbe6f7940326bcd8dbc89d010d85d69c5 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * vim-patch:9.0.1803: runtime(filetype): Add norg language detection (#24948)zeertzjq2023-08-31
| | | | | | | | | | | | | | | | | | runtime(filetype): Add norg markup language detection closes: vim/vim#12913 https://github.com/vim/vim/commit/03e44a1d70e914504e6151fe88ad1e574cbf0a59 Co-authored-by: NTBBloodbath <bloodbathalchemist@protonmail.com>
| * fix(builtin): fix incorrect optional fields for fn.sign_defineJongwook Choi2023-08-30
| | | | | | | | The field `icon` is not a mandatory field.
| * fix(treesitter): update folds only once on InsertLeaveJaehwang Jung2023-08-29
| | | | | | | | | | | | | | | | | | | | Problem: With treesitter fold, InsertLeave can be slow, because a single session of insert mode may schedule multiple fold updates in on_bytes and on_changedtree. Solution: Don't create duplicate autocmds.
| * feat(builtin): improve typesLewis Russell2023-08-27
| |
| * fix(types): add some return/parameter type annotations (#24867)Maria José Solano2023-08-27
| | | | | | | | | | * fix(types): add some return/parameter type annotations * fix(types): narrow stdpath parameter further
| * fix(treesitter): validate window before updating preview highlightsMaria José Solano2023-08-27
| |
| * feat(highlight): add `FloatFooter` highlight groupEvgeni Chasnovski2023-08-26
| | | | | | | | | | | | Problem: No clear separation of floating title and footer highlighting. Solution: Add new `FloatFooter` highlight group.
| * feat(float): implement footerEvgeni Chasnovski2023-08-26
| | | | | | | | | | | | | | | | Problem: Now way to show text at the bottom part of floating window border (a.k.a. "footer"). Solution: Allows `footer` and `footer_pos` config fields similar to `title` and `title_pos`.
| * docs(msgpack_rpc): add "msgpack-rpc" client typeAlisue2023-08-26
| |
| * docs: various clarifications (#24876)zeertzjq2023-08-26
| |
| * feat(treesitter): add a query editor (#24703)Maria José Solano2023-08-25
| |
| * fix(filetype): return on_detect function when matching by file contentsGregory Anders2023-08-24
| |
| * fix(filetype): call on_detect before setting buffer filetypeGregory Anders2023-08-24
| | | | | | | | | | | | | | | | | | | | | | | | The on_detect functions returned by filetype.lua set buffer local variables which are often used by filetype plugins. For example, the on_detect function for shell buffers sets variables such as b:is_bash or b:is_sh, which are used by the sh ftplugin. When called after setting the buffer's filetype, these variables cannot be used by the ftplugin (because they are not yet defined). Instead, call on_detect before setting the buffer filetype so that any buffer variables set by on_detect can be used in the ftplugin.
| * docs(builtin): small fixes (#24861)Sean Dewar2023-08-24
| | | | | | | | Also make gen_eval_files.lua render vimdoc helpExamples properly if the line begins with the `>` marker.
| * feat(treesitter): add 'injection.self' and 'injection.parent'Amaan Qureshi2023-08-24
| | | | | | | | Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
| * vim-patch:9.0.1773: cannot distinguish Forth and Fortran *.f files (#24841)zeertzjq2023-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: cannot distinguish Forth and Fortran *.f files Solution: Add Filetype detection Code Also add *.4th as a Forth filetype closes: vim/vim#12251 https://github.com/vim/vim/commit/19a3bc3addf9b4aa8150a01b11b4249c67d15d3b Don't remove filetype files from Vim patches: - filetype.vim, script.vim, ft.vim usually contain useful changes - script.vim and ft.vim don't even have their paths spelled correctly Co-authored-by: Doug Kearns <dougkearns@gmail.com>
| * fix(types): add more annotations to eval.luaLewis Russell2023-08-23
| |
| * vim-patch:9.0.0837: append() reports failure when not appending anythingzeertzjq2023-08-22
| | | | | | | | | | | | | | | | | | Problem: append() reports failure when not appending anything. Solution: Only report failure when appending something. (closes vim/vim#11498) https://github.com/vim/vim/commit/cd9c8d400c1eb9cbb4ff6a33be02f91a30ab13b2 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:e46a44050562zeertzjq2023-08-21
| | | | | | | | | | | | | | | | Runtime file updates https://github.com/vim/vim/commit/e46a4405056276b4cbdacee76b11f85c8ea1830b Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:589edb340454zeertzjq2023-08-21
| | | | | | | | | | | | | | | | Updte runtime files https://github.com/vim/vim/commit/589edb340454e7f1b19358f129287a636d53d0e1 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.1.2053: SafeStateAgain not triggered if callback uses feedkeys()zeertzjq2023-08-21
| | | | | | | | | | | | | | | | | | | | | | | | Problem: SafeStateAgain not triggered if callback uses feedkeys(). Solution: Check for safe state in the input loop. Make log messages easier to find. Add 'S' flag to state(). https://github.com/vim/vim/commit/d103ee78432f9036d243b18dd5aac1263d3b7dc9 Include misc1.c change from patch 8.1.2062. Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:8.1.2047: cannot check the current statezeertzjq2023-08-21
| | | | | | | | | | | | | | | | | | Problem: Cannot check the current state. Solution: Add the state() function. https://github.com/vim/vim/commit/0e57dd859ecb1e8a3b91509d2f4343e839340eb8 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:9.0.1768: Runtime: no support for bicep filesChristian Clason2023-08-21
| | | | | | | | | | | | | | | | | | | | | | Problem: Runtime: no support for bicep files Solution: Add filetype support for bicepparam closes: vim/vim#12784 https://github.com/vim/vim/commit/2d0988ef93c6e8e59381c9cd123efbc2cd1faf92 Co-authored-by: Scott McKendry <scott.c.mckendry@gmail.com>
| * vim-patch:9.0.1766: Runtime: Missing QML supportChristian Clason2023-08-21
| | | | | | | | | | | | | | | | | | | | | | Problem: Runtime: Missing QML support Solution: Add QML support to Vim closes: vim/vim#12810 https://github.com/vim/vim/commit/bedc69f9d67b117ab05aa735c701cd3899d1ae2d Co-authored-by: ChaseKnowlden <haroldknowlden@gmail.com>