aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
* vim-patch:cd39b69b0200zeertzjq2023-10-03
| | | | | | | | | | runtime(doc): add missing error numbers in the help. (vim/vim#13241) closes: vim/vim#13240 https://github.com/vim/vim/commit/cd39b69b0200005622db7291bbacff95bd03a3d0 Co-authored-by: Yegappan Lakshmanan <4298407+yegappan@users.noreply.github.com>
* vim-patch:20f48d5b2ddbzeertzjq2023-10-03
| | | | | | | | runtime(doc): mention how to disable folding in diff mode (vim/vim#13242) https://github.com/vim/vim/commit/20f48d5b2ddb9fdc29e83f0da6f31f895eaeab47 Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
* feat(lsp)!: replace snippet parser by lpeg grammarMaria José Solano2023-10-02
|
* feat(lsp): snippet parsing using lpegMaria José Solano2023-10-02
|
* feat(lsp): fallback to code-action command on resolve failure (#25464)Mathias Fußenegger2023-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The haskell-language-server supports resolve only for a subset of code actions. For many code actions trying to resolve the `edit` property results in an error, but the unresolved action already contains a command that can be executed without issue. The protocol specification is unfortunately a bit vague about this, and what the haskell-language-server does seems to be valid. Example: newtype Dummy = Dummy Int instance Num Dummy where Triggering code actions on "Num Dummy" and choosing "Add placeholders for all missing methods" resulted in: -32601: No plugin enabled for SMethod_CodeActionResolve, potentially available: explicit-fields, importLens, hlint, overloaded-record-dot With this change it will insert the missing methods: instance Num Dummy where (+) = _ (-) = _ (*) = _ negate = _ abs = _ signum = _ fromInteger = _
* feat(treesitter): add foldtext with treesitter highlighting (#25391)Till Bungert2023-10-01
|
* Merge pull request #25455 from bfredl/highlight_namespace_gettersbfredl2023-10-01
|\ | | | | feat(ui): allow to get the highlight namespace. closes #24390
| * feat(ui): allow to get the highlight namespaceDaniel Steinberg2023-10-01
| |
* | Merge pull request #25386 from glepnir/toggle_floatbfredl2023-09-30
|\ \ | |/ |/| feat(float): support toggle show float window
| * feat(float): support toggle show float windowglepnir2023-09-30
| |
* | 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: checkhealth warning even if init.lua exists #25306Tom Blake2023-09-24
|/ / | | | | | | | | | | | | | | | | Problem: `:checkhealth nvim` warns about missing vimrc if `init.lua` exists but `init.vim` does not. Solution: Check for any of: init.vim, init.lua, $MYVIMRC. Fix #25291
* | 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.