aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* refactor(lsp): deprecate util methods (#25400)Maria José Solano2023-09-29
|
* vim-patch:9.0.1950: Vim9: error codes spread out (#25405)zeertzjq2023-09-29
| | | | | | | | | | | | | | Problem: Vim9: error codes spread out Solution: group them together and reserve 100 more for future use Reserve 100 error codes for future enhancements to the Vim9 class support closes: vim/vim#13207 https://github.com/vim/vim/commit/413f83990f15d5d59d27ab741670f527a7a3feb8 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
* vim-patch:5277cfaf8afe (#25397)zeertzjq2023-09-28
| | | | | runtime(doc): mention mouse scrolling in scrollbind-quickadj (vim/vim#13190) https://github.com/vim/vim/commit/5277cfaf8afe847b7d4dcde6057fbecb001ab64e
* Merge pull request #25229 from glepnir/20323bfredl2023-09-26
|\ | | | | fix(highlight): add force in nvim_set_hl
| * fix(highlight): add force in nvim_set_hlglepnir2023-09-26
| |
* | fix(meta): add nil return types to lpeg functionsMaria José Solano2023-09-26
| |
* | fix(meta): cleanup lpeg operatorsMaria José Solano2023-09-26
| |
* | refactor(options)!: graduate some more shortmess flagsbfredl2023-09-25
| | | | | | | | | | | | | | | | A lot of updated places in the docs were already incorrect since long since they did not reflect the default behaviour. "[dos format]" could've been argued being better for discoverability but that ship has already sailed as it is no longer displayed by default.
* | Merge pull request #25344 from gpanders/doc-shortmessbfredl2023-09-25
|\ \ | | | | | | docs: remove "f" from default 'shortmess' value
| * | docs: remove "f" from default 'shortmess' valueGregory Anders2023-09-24
| | | | | | | | | | | | | | | | | | | | | The "f" flag was removed in f7da4722570617bd8927e7aa533fa9a608c45bba. The value of the "f" flag is no longer listed in the 'shortmess' description and it cannot be disabled, so having it in the default value is pointless and confusing.
* | | docs: do not use deprecated functions #25334Maria José Solano2023-09-24
| | |
* | | vim-patch:790f9a890ceezeertzjq2023-09-25
| | | | | | | | | | | | | | | | | | | | | | | | runtime(doc): Add a missing '<' to the help of strutf16len() (vim/vim#13168) https://github.com/vim/vim/commit/790f9a890ceeb9539776265cba0f026fb2c96790 Co-authored-by: a5ob7r <12132068+a5ob7r@users.noreply.github.com>
* | | feat(meta): add types for vim.lpegMaria José Solano2023-09-24
| | |
* | | feat(health): list attached buffers in LSP report #23561Bogdan Grigoruță2023-09-24
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Users using `vim.lsp.start` directly (instead of nvim-lspconfig) need more visibility for troubleshooting. For example, troubleshooting unnecesary servers or servers that aren't attaching to expected buffers. Solution: Mention attached buffers in the `:checkhealth lsp` report. Example: vim.lsp: Active Clients ~ - clangd (id=1, root_dir=~/dev/neovim, attached_to=[7]) - lua_ls (id=2, root_dir=~/dev/neovim, attached_to=[10])
* | fix(ui): always use stl/stlnc fillchars when drawing statusline (#25267)tj-moody2023-09-24
| |
* | docs: fix type warningsMaria José Solano2023-09-23
| |
* | refactor(options)!: graduate shortmess+=f flagbfredl2023-09-23
| | | | | | | | | | | | | | Not everything needs to be crazy overconfigurable. Also fixes a warning in latest clang which didn't approve of the funky math switch statement in append_arg_number
* | Merge pull request #25286 from rktjmp/doc-vim-schedule-wrapzeertzjq2023-09-23
|\ \ | | | | | | docs: add more context to vim.schedule_wrap
| * | docs: update vim.schedule param name and typeOliver Marriott2023-09-23
| | | | | | | | | | | | | | | Per https://github.com/neovim/neovim/pull/25286#discussion_r1332861721 and https://github.com/neovim/neovim/pull/25286#discussion_r1334318352
| * | docs: clarify vim.schedule_wrap behaviourOliver Marriott2023-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove the usage of the term "defer" to avoid confusion with `vim.defer_fn`, which also calls `vim.schedule_wrap` internally. - Explicitly state that `vim.schedule_wrap` returns a function in the text. - Mention that arguments are passed along. - Include a usage example. - Rename param to `fn`.
* | | fix(meta): include vim.jsonMaria José Solano2023-09-22
| | |
* | | fix(languagetree): don't treat unparsed nodes as occupying full rangeL Lllvvuu2023-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is incorrect in the following scenario: 1. The language tree is Lua > Vim > Lua. 2. An edit simultaneously wipes out the `_regions` of all nodes, while taking the Vim injection off-screen. 3. The Vim injection is not re-parsed, so the child Lua `_regions` is still `nil`. 4. The child Lua is assumed, incorrectly, to occupy the whole document. 5. This causes the injections to be parsed again, resulting in Lua > Vim > Lua > Vim. 6. Now, by the same process, Vim ends up with its range assumed over the whole document. Now the parse is broken and results in broken highlighting and poor performance. It should be fine to instead treat an unparsed node as occupying nothing (i.e. effectively non-existent). Since, either: - The parent was just parsed, hence defining `_regions` - The parent was not just parsed, in which case this node doesn't need to be parsed either. Also, the name `has_regions` is confusing; it seems to simply mean the opposite of "root" or "full_document". However, this PR does not touch it.
* | | fix(lsp): handle absence of a trailing newline #25194Sergey Slipchenko2023-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #24339 rust-analyzer sends "Invalid offset" error in such cases. Some other servers handle it specially. LSP spec mentions that "A range is comparable to a selection in an editor". Most editors don't handle trailing newlines the same way Neovim/Vim does, it's clearly visible if it's present or not. With that in mind it's understandable why sending end position as simply the start of the line after the last one is considered invalid in such cases.
* | | fix(lsp): clear codelens on LspDetach (#24903)Jaehwang Jung2023-09-21
|/ / | | | | Also fix incorrect parameters in on_detach callback.
* | vim-patch:9.0.1921: not possible to use the jumplist like a stack (#25278)zeertzjq2023-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: not possible to use the jumplist like a stack Solution: Add the 'jumpoptions' setting to make the jumplist a stack. Add an option for using jumplist like tag stack related: vim/vim#7738 closes: vim/vim#13134 ported from NeoVim: - https://neovim.io/doc/user/motion.html#jumplist-stack - neovim/neovim@39094b3 - https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior Based on the feedback in the previous PR, it looks like many people like this option. https://github.com/vim/vim/commit/87018255e3ad0f4dfa03e20318836d24af721caf Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com> Co-authored-by: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com>
* | vim-patch:9.0.1918Christian Clason2023-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | patch 9.0.1918: No filetype detection for Authzed filetypes Problem: No filetype detection for Authzed filetypes Solution: Detect the *.zed file extension as authzed filetype closes: vim/vim#13129 https://github.com/vim/vim/commit/5790a54166793554d16f6a85d8824632860b8b37 Co-authored-by: Matt Polzin <mpolzin@workwithopal.com>
* | feat(lua): add vim.func._memoizeLewis Russell2023-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memoizes a function, using a custom function to hash the arguments. Private for now until: - There are other places in the codebase that could benefit from this (e.g. LSP), but might require other changes to accommodate. - Invalidation of the cache needs to be controllable. Using weak tables is an acceptable invalidation policy, but it shouldn't be the only one. - I don't think the story around `hash_fn` is completely thought out. We may be able to have a good default hash_fn by hashing each argument, so basically a better 'concat'.
* | docs: misc #24561Justin M. Keyes2023-09-20
| | | | | | | | fix #24699 fix #25253
* | 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: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.
* | 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
* | 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>