aboutsummaryrefslogtreecommitdiff
path: root/runtime
Commit message (Collapse)AuthorAge
...
* | fix(lsp)!: deprecate trim_empty_linesMaria José Solano2023-09-19
| |
* | feat(lsp): use treesitter for stylize markdownMaria José Solano2023-09-19
| |
* | Merge pull request #25214 from bfredl/glyphcachebfredl2023-09-19
|\ \ | | | | | | refactor(grid): change schar_T representation to be more compact
| * | refactor(grid): change schar_T representation to be more compactbfredl2023-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a screen cell would occupy 28+4=32 bytes per cell as we always made space for up to MAX_MCO+1 codepoints in a cell. As an example, even a pretty modest 50*80 screen would consume 50*80*2*32 = 256000, i e a quarter megabyte With the factor of two due to the TUI side buffer, and even more when using msg_grid and/or ext_multigrid. This instead stores a 4-byte union of either: - a valid UTF-8 sequence up to 4 bytes - an escape char which is invalid UTF-8 (0xFF) plus a 24-bit index to a glyph cache This avoids allocating space for huge composed glyphs _upfront_, while still keeping rendering such glyphs reasonably fast (1 hash table lookup + one plain index lookup). If the same large glyphs are using repeatedly on the screen, this is still a net reduction of memory/cache consumption. The only case which really gets worse is if you blast the screen full with crazy emojis and zalgo text and even this case only leads to 4 extra bytes per char. When only <= 4-byte glyphs are used, plus the 4-byte attribute code, i e 8 bytes in total there is a factor of four reduction of memory use. Memory which will be quite hot in cache as the screen buffer is scanned over in win_line() buffer text drawing A slight complication is that the representation depends on host byte order. I've tested this manually by compling and running this in qemu-s390x and it works fine. We might add a qemu based solution to CI at some point.
* | | Merge pull request #25148 from glepnir/fixed_optbfredl2023-09-19
|\ \ \ | | | | | | | | fix(float): add fixed option
| * | | fix(float): add fixd optionglepnir2023-09-18
| | | |
* | | | vim-patch:346ac1429c5a (#25239)zeertzjq2023-09-19
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | runtime(doc): add help tag describing object-selection closes: vim/vim#13114 https://github.com/vim/vim/commit/346ac1429c5afb23bace295106aea1b305443435 Co-authored-by: Christian Brabandt <cb@256bit.org>
* | | vim-patch:d8b86c937a41Christian Clason2023-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime(netrw): fix filetype detection for remote editing files closes: vim/vim#12990 closes: vim/vim#12992 this partially reverses commit 71badf9 by commenting out the line that intentionally sets the filetype to an empty string. https://github.com/vim/vim/commit/d8b86c937a419db69239a8bb879f0050be0f8e1d Co-authored-by: Christian Brabandt <cb@256bit.org>
* | | vim-patch:e30d8e4ce01dChristian Clason2023-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime(kotlin): Add Kotlin runtime files (vim/vim#13110) Closes udalov/kotlin-vimvim/vim#39 https://github.com/vim/vim/commit/e30d8e4ce01dc1aca95d25be9fd27c09855fd4be Co-authored-by: dkearns <dougkearns@gmail.com>
* | | vim-patch:9.0.1907: No support for liquidsoap filetypesChristian Clason2023-09-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: No support for liquidsoap filetypes Solution: Add liquidsoap filetype detection code closes: vim/vim#13111 https://github.com/vim/vim/commit/6b5efcdd8e976d2ab2554b22c4220c5e88de4717 Co-authored-by: Romain Beauxis <toots@rastageeks.org>
* | | fix(treesitter): _trees may not be list-likeJaehwang Jung2023-09-17
| |/ |/| | | | | | | | | | | | | | | | | | | Problem: With incremental injection parsing, injected languages' parsers parse only the relevant regions and stores the result in _trees with the index of the corresponding region. Therefore, there can be holes in _trees. Solution: * Use generic table functions where appropriate. * Fix type annotations and docs.
* | feat(folds): support virtual text format for 'foldtext' (#25209)zeertzjq2023-09-17
| | | | | | Co-authored-by: Lewis Russell <lewis6991@gmail.com>
* | docs: remove joke from pronouncedundargoc2023-09-17
| | | | | | | | N-Jim does not sounds like "Ninja", and the joke doesn't really land.
* | docs(tutor): clarify the meaning of ✗ and ✓ (#25204)zeertzjq2023-09-17
| | | | | | Also reformat tutor.tutor.json to use 2-space indent while at it.
* | fix(lua): not using global value in vim.opt_global (#25196)Phelipe Teles2023-09-17
| |
* | feat(treesitter): add lang parameter to the query editor (#25181)Maria José Solano2023-09-16
| |
* | fix(treesitter): properly combine injection.combined regionsJaehwang Jung2023-09-16
| | | | | | | | | | | | | | | | | | Problem: It doesn't make much sense to flatten each region (= list of ranges). This coincidentally worked for region with a single range. Solution: Custom function for combining regions.
* | fix(treesitter): fix trim predicateLewis Russell2023-09-16
| |
* | fix(typing): vim.fn.executeLewis Russell2023-09-16
| |
* | perf(treesitter): do not scan past given line for predicate matchL Lllvvuu2023-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem --- If a highlighter query returns a significant number of predicate non-matches, the highlighter will scan well past the end of the window. Solution --- In the iterator returned from `iter_captures`, accept an optional parameter `end_line`. If no parameter provided, the behavior is unchanged, hence this is a non-invasive tweak. Fixes: #25113 nvim-treesitter/nvim-treesitter#5057
* | fix(languagetree): apply `resolve_lang` to `metadata['injection.language']`L Lllvvuu2023-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | `resolve_lang` is applied to `@injection.language` when it's supplied as a capture: https://github.com/neovim/neovim/blob/f5953edbac14febce9d4f8a3c35bdec1eae26fbe/runtime/lua/vim/treesitter/languagetree.lua#L766-L768 If we want to support `metadata['injection.language']` (as per #22518 and [tree-sitter upstream](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection)) then the behavior should be consistent. Fixes: nvim-treesitter/nvim-treesitter#4918
* | vim-patch:c1f8bb37c6a8Christian Clason2023-09-16
| | | | | | | | | | | | | | | | | | | | runtime(forth): Fix :unlet error in ftplugin (vim/vim#13090) Fixes vim/vim#13089. https://github.com/vim/vim/commit/c1f8bb37c6a8e0babc2a41f16860763b57c23fa1 Co-authored-by: dkearns <dougkearns@gmail.com>
* | refactor(treesitter): remove duplicated diagnostic code (#24976)Maria José Solano2023-09-15
| | | | | | | | | | | | | | * refactor(treesitter): remove duplicated diagnostic code * fixup!: fix type errors * fixup!: add type namespace
* | refactor(treesitter): rename "preview" => "edit" #25161Maria José Solano2023-09-15
| | | | | | | | | | | | "Edit" more closely describes the generic application than "Preview", though the buffer contents don't (yet) map to an actual file on disk. https://github.com/neovim/neovim/pull/24703#discussion_r1321719133
* | docs: replace <pre> with ``` (#25136)Gregory Anders2023-09-14
| |
* | refactor(treesitter): deprecate for_each_child #25118LW2023-09-14
| | | | | | | | | | | | | | The name for_each_child is misleading and caused bugs. After #25111, #25115, there are no more usages of `for_each_child` in Nvim. In the future if we want to restore this functionality we can consider a generalized vim.traverse(node, key, visitor) function.
* | fix(treesitter): `language.add` - only register parser if it existsL Lllvvuu2023-09-14
| | | | | | | | Fixes: #24531
* | feat(lsp): remove notify from vim.lsp.buf_detach_client (#25140)Mathias Fußenegger2023-09-14
|/ | | Closes https://github.com/neovim/neovim/issues/19838
* docs: fix typos and other small fixes (#25005)dundargoc2023-09-14
| | | | | | | Co-authored-by: nuid64 <lvkuzvesov@proton.me> Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com> Co-authored-by: XTY <xty@xty.io> Co-authored-by: Empa <emanuel@empa.xyz> Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
* vim-patch:8b2457a38198Christian Clason2023-09-13
| | | | | | | | | | | runtime(swayconfig): improve syntax highlighting (vim/vim#13060) * syntax(swayconfig): improved highlighting * syntax(swayconfig): adapt to i3config structure https://github.com/vim/vim/commit/8b2457a3819826d90ad2b1677d213d9f924ec6c0 Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
* vim-patch:fc93594d562dChristian Clason2023-09-13
| | | | | | | | runtime(rust): sync rust runtime files with upstream (vim/vim#13075) https://github.com/vim/vim/commit/fc93594d562dbbd9da03c89754538f91efd0c7ca Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
* vim-patch:f5356bf6751fChristian Clason2023-09-13
| | | | | | | | | | | runtime(i3config): syntax structure cleanup (vim/vim#13080) * syntax(i3config): improved i3config highlighting * syntax(i3config): refactor structure https://github.com/vim/vim/commit/f5356bf6751fc1af77c8d27c7286639527fde3f2 Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
* feat(vimdoc): support Markdown code blocks (#25127)Gregory Anders2023-09-13
| | | | | | Support Markdown code blocks in addition to <pre> blocks in Doxygen doc comments. Update doc comments in iter.lua as a test.
* 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
* vim-patch:62145db91b10Christian Clason2023-09-12
| | | | | | | | syntax(i3config): improved i3config highlighting (vim/vim#13054) https://github.com/vim/vim/commit/62145db91b104075277cb3a940e18832ad106264 Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
* vim-patch:f787ee8451a1 (#25103)zeertzjq2023-09-12
| | | | | | | | | runtime(doc): Add g:c_syntax_for_h to filetype-overrule docs closes: vim/vim#13074 https://github.com/vim/vim/commit/f787ee8451a1f24de4ef3de48b78d5aa77d09829 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:596ad66d1ddb (#25102)zeertzjq2023-09-12
| | | | | | | | | | | | | | runtime(doc): documentation updates This is a collection of various improvements to the help pages closes vim/vim#12790 https://github.com/vim/vim/commit/596ad66d1ddb742ef349e98eb06b8e4052f68f51 Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Houl <anwoku@yahoo.de> Co-authored-by: Doug Kearns <dougkearns@gmail.com> Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
* 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>
* | vim-patch:e7833e73471aChristian Clason2023-09-11
| | | | | | | | | | | | | | | | runtime(masm): add support for AVX-2 and AVX-512 (vim/vim#13061) https://github.com/vim/vim/commit/e7833e73471a110c7c38c80935e1b840f254a3da Co-authored-by: Wu Yongwei <wuyongwei@gmail.com>
* | vim-patch:066103307534Christian Clason2023-09-11
|/ | | | | | | | | | | | | | | | | | | | | | | | | | runtime(scala): Fix Scala highlighting string literal as type param (vim/vim#13070) Since https://docs.scala-lang.org/sips/42.type.html which is implemented in Scala 2.13 and in Scala 3 it possible to use string literals as singleton types. So code like ``` someFunc["abc"] ``` is valid. Currently this code is not hightlighted correctly and worse if there is an unclosed `(` in the string it breaks the formating in the rest of the file. I also submitted this patch to the mentioned project for this runtime file: https://github.com/derekwyatt/vim-scala/pull/173 But there are no commits there over the last 2 years and no response in the week since I created it. Also the last change to the Scala syntax file: https://github.com/vim/vim/pull/9594 is yet to be backported to that repo. Therefore I am opening this PR as well to get some feedback on how to proceed to get this fixed. https://github.com/vim/vim/commit/066103307534f81de08a092aac3a15e864a5a25f Co-authored-by: Emil Ejbyfeldt <eejbyfeldt@liveintent.com>
* Merge pull request #25071 from bfredl/coxpcallbfredl2023-09-10
|\ | | | | build(lua): vendor coxpcall
| * build(lua): vendor coxpcallbfredl2023-09-10
| | | | | | | | Do not require luarocks on PUC lua CI just because of this single lua file
* | vim-patch:733bbcde776eChristian Clason2023-09-10
| | | | | | | | | | | | | | | | runtime(nasm): updated syntax file https://github.com/vim/vim/commit/733bbcde776e857b45bf4c713a3c9203ac728040 Co-authored-by: Andrii Sokolov <andriy145@gmail.com>