Apply semantic token modifiers as separate extmarks with corresponding
highlight groups (e.g., `@readonly`). This is a low-effort PR to enable
the most common use cases (applying, e.g., italics or backgrounds on top
of type highlights; language-specific fallbacks like `@global.lua` are
also available). This can be replaced by more complicated selector-style
themes later on.
Instead of testing for every possible modifier type, only test bits up
to the highest set in the token array. Saves many bit ops and
comparisons when there are no modifiers or when the highest set bit is a
lower bit than the highest possible in the legend on average.
Can be further simplified when non-luaJIT gets the full bit module (see #21222)
Problem: Matchparen is slow.
Solution: Actually use the position where the match started, not the
position where the search started. (closesvim/vim#11644)
79336e19cb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
The spec indicates that the response may be `null`, but it doesn't
really say what a `null` response means. Since neovim raises an error if
the response is `null`, I figured that ignoring it would be the safest
bet.
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
Unlike split windows, creating a new floating window does not cause
other windows to resize, so it doesn't make much sense to trigger
WinScrolled or WinResized when creating a new floating window.
1. The algorithm for applying edits was slightly incorrect. It needs to
preserve the original token list as the edits are applied instead of
mutating it as it iterates. From the spec:
Semantic token edits behave conceptually like text edits on
documents: if an edit description consists of n edits all n edits are
based on the same state Sm of the number array. They will move the
number array from state Sm to Sm+1.
2. Schedule the semantic token engine start() call in the
client._on_attach() function so that users who schedule_wrap() their
config.on_attach() functions (like nvim-lspconfig does) can still
disable semantic tokens by deleting the semanticTokensProvider from
their server capabilities.
Problem: Shift-Tab shows matches on cmdline when 'wildmenu' is off.
Solution: Only show matches when 'wildmode' contains "list". (closesvim/vim#10951)
300175fd7f
Code change has already been ported.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Command line completion doesn't always work properly.
Solution: Adjust triggering after a "|". Add more tests. (Yegappan
Lakshmanan, closesvim/vim#9779)
e3846cf1eb
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Not enough tests for command line completion.
Solution: Add a few more tests. (Yegappan Lakshmanan, closesvim/vim#9771)
9773db6f9b
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: Not enough tests for command line completion.
Solution: Add a few more tests. (Yegappan Lakshmanan, closesvim/vim#9760)
4d03d87000
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Problem: `chansend()` on Windows sends lines in reverse order.
Cause: Using \n instead of \r\n for newlines on Windows.
Solution: on Windows, use CRLF newline characters.
Fixes#18501
Problem: Using freed memory with the cmdline popup menu.
Solution: Clear the popup menu when clearing the matches. (closesvim/vim#11677)
038e6d20e6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
* credit to @smolck and @theHamsta for their contributions in laying the
groundwork for this feature and for their work on some of the helper
utility functions and tests
Add a "show_tree" function to view a textual representation of the
nodes in a language tree in a window. Moving the cursor in the
window highlights the corresponding text in the source buffer, and
moving the cursor in the source buffer highlights the corresponding
nodes in the window.
Update runtime files
86b4816766
vim-patch:9.0.1029: autoload directory missing from distribution
Problem: Autoload directory missing from distribution.
Solution: Add the autoload/zig directory to the list of distributed files.
84dbf855fb
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Problem: Loop to handle keys for the command line is too long.
Solution: Move a few more parts to separate functions. (Yegappan Lakshmanan,
closesvim/vim#6895)
9c929713b7
vim-patch:8.2.3564: invalid memory access when scrolling without valid screen
Problem: Invalid memory access when scrolling without a valid screen.
Solution: Do not set VALID_BOTLINE in w_valid.
777e7c21b7
Remove -Z flag when using RunVim().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Add introductory guide explaining how to use Lua in Neovim:
where to put Lua files, how to set variables and options, how
to create mappings, autocommands, and user commands.
Adapted with kind permission from
https://github.com/nanotee/nvim-lua-guide
`willSaveWaitUntil` allows servers to respond with text edits before
saving a document. That is used by some language servers to format a
document or apply quick fixes like removing unused imports.