aboutsummaryrefslogtreecommitdiff
path: root/runtime
Commit message (Collapse)AuthorAge
* 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
* fix(provider): cannot detect python3.12 #25316Jongwook Choi2023-09-23
| | | | | | | | | | | | | | | | | | | PROBLEM: The builtin python3 provider cannot auto-detect python3.12 when g:python3_host_prog is not set. As a result, when python3 on $PATH is currently python 3.12, neovim will fail to load python3 provider and result in `has("python3") == 0`, e.g., "Failed to load python3 host. You can try to see what happened by ..." ROOT CAUSE: the `system()` call from `provider#pythonx#DetectByModule` does not ignore python warnings, and `pkgutil.get_loader` will print a warning message in the very first line: ``` <string>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec() instead ``` SOLUTION: - Use `importlib.util.find_spec` instead (python >= 3.4) - Use `-W ignore` option to prevent any potential warning messages
* 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.
* | docs: small improvements to compl-autocomplete example (#25299)zeertzjq2023-09-22
| | | | | | | | - Don't complete when there is pending input. - Use vim.list_contains() instead of vim.tbl_contains().
* | 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:a7aba6ca5033 (#25285)zeertzjq2023-09-21
|/ | | | | runtime(doc): format jumplist examples more consistently (vim/vim#13137) https://github.com/vim/vim/commit/a7aba6ca5033a85839d997d29d5ca88a1f2acf8f
* 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
* docs: document $XDG environment variables #25227Eduardo Rittner Coelho2023-09-20
|
* vim-patch:9.0.1915: r_CTRL-C works differently in visual mode (#25248)zeertzjq2023-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: r_CTRL-C works differently in visual mode Solution: Make r_CTRL-C behave consistent in visual mode in terminal and Windows GUI in visual mode, r CTRL-C behaves strange in Unix like environments. It seems to end visual mode, but still is waiting for few more chars, however it never seems to replace it by any characters and eventually just returns back into normal mode. In contrast in Windows GUI mode, r_CTRL-C replaces in the selected area all characters by a literal CTRL-C. Not sure why it behaves like this. It seems in the Windows GUI, got_int is not set and therefore behaves as if any other normal character has been pressed. So remove the special casing of what happens when got_int is set and make it always behave like in Windows GUI mode. Add a test to verify it always behaves like replacing in the selected area each selected character by a literal CTRL-C. closes: vim/vim#13091 closes: vim/vim#13112 https://github.com/vim/vim/commit/476733f3d06876c7ac105e064108c973a57984d3 Co-authored-by: Christian Brabandt <cb@256bit.org>
* 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.