Commit Graph

26046 Commits

Author SHA1 Message Date
Ibby
c5bf838f8a fix(ui): fix visual and search highlighting interfering with virtual text
vim-patch:9.0.0193: search and match highlgith interfere with virtual text

Problem:    Search and match highlgith interfere with virtual text highlight.
            (Ben Jackson)
Solution:   Check for match highlight after text properties.  Reset and
            restore search highlight when showing virtual text.
            (closes vim/vim#10892)

e38fc86180

vim-patch:9.0.0452: Visual highlighting extends into virtual text prop

Problem:    Visual highlighting extends into virtual text prop.
Solution:   Do not highlight what isn't actually selected.  Fix ordering of
            stored text props.

6eda17d881

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
Ibby
e12b5882af vim-patch:9.0.0183: extra space after virtual text when 'linebreak' is set
Problem:    Extra space after virtual text when 'linebreak' is set.
Solution:   Do not count virtual text when getting linebreak value.
            (closes vim/vim#10884)

52de3a8d39

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
Ibby
dee3af2122 vim-patch:9.0.0178: cursor position wrong with virtual text before Tab
Problem:    Cursor position wrong with virtual text before Tab.
Solution:   Use the byte length, not the cell with, to compare the column.
            Correct tab size after text prop. (closes vim/vim#10866)

e428fa04a7

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
Ibby
43c2eaada2 vim-patch:9.0.0179: cursor pos wrong with wrapping virtual text in empty line
Problem:    Cursor position wrong with wrapping virtual text in empty line.
Solution:   Adjust handling of an empty line. (closes vim/vim#10875)

49a90792d9

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-22 13:49:42 +02:00
Ibby
8eaf3c4f8c vim-patch:9.0.0143: cursor positioned after virtual text in empty line
Problem:    Cursor positioned after virtual text in empty line.
Solution:   Keep cursor in the first column. (closes vim/vim#10786)

afd2aa79ed
2023-05-22 13:49:42 +02:00
Ibby
0c7fa3bdcc fix(ui): fix multi-byte characters highlight in virtual text
This also fixes insert cursor position around virtual text

vim-patch:9.0.0132: multi-byte characters in virtual text not handled correctly

Problem:    Multi-byte characters in virtual text not handled correctly.
Solution:   Count screen cells instead of bytes.

09ff4b54fb
2023-05-22 13:49:42 +02:00
Ibby
389f5ca39d fix(ui): adjust the cursor when inserting virtual text
Credit to: Jesse Bakker

https://github.com/neovim/neovim/pull/20130#issuecomment-1369652743

Co-authored-by: Jesse Bakker <github@jessebakker.com>
2023-05-22 13:49:42 +02:00
Ibby
0e1f3b5acf vim-patch:9.0.0130: cursor position wrong when inserting around virtual text
Problem:    Cursor position wrong when inserting around virtual text.
Solution:   Update the cursor position properly.

1f4ee19eef

Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com>
2023-05-22 13:49:42 +02:00
Ibby
a38d7f9984 fix(ui): fix cursor position with multiple inline virtual text
vim-patch9.0.0121: cannot put virtual text after or below a line

Problem:    Cannot put virtual text after or below a line.
Solution:   Add "text_align" and "text_wrap" arguments.

b7963df98f

This only patches the fix, not the whole thing.
2023-05-22 13:49:42 +02:00
Ibby
efa9b299a7 feat(ui): inline virtual text
vim-patch:9.0.0067: cannot show virtual text

Problem:    Cannot show virtual text.
Solution:   Initial changes for virtual text support, using text properties.

7f9969c559

vim-patch:9.0.0116: virtual text not displayed if 'signcolumn' is "yes"

Problem:    Virtual text not displayed if 'signcolumn' is "yes".
Solution:   Set c_extra and c_final to NUL.
711483cd13

Co-authored-by: bfredl <bjorn.linse@gmail.com>
2023-05-22 13:49:42 +02:00
luukvbaal
b11a8c1b5d
fix(highlight): remove unnecessary assignment to char_attr for 'spell' (#23713) 2023-05-22 17:07:55 +08:00
Null Chilly
b7708eac24
fix(api): nvim_get_hl should return default flag 2023-05-22 09:49:01 +01:00
dundargoc
4f1d75daf8
ci: enable colors by default when testing
Test colors were disabled in be7290d214
due to color codes interfering with the logs. I believe the solution to
disable colors is too aggressive. Reading raw logs isn't common compared
to reading CI results from the github UI. We should optimize the most
common use case.

It is also possible to interpret the colors codes in logs from neovim
with a plugin that interprets ansi escape sequences.
2023-05-22 09:47:40 +01:00
Lewis Russell
01ea42c32a
refactor(vim.secure): move to lua/secure.c 2023-05-22 09:24:36 +01:00
bfredl
62a80c36c1
Merge pull request #23712 from famiu/refactor/test/buf0
test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value
2023-05-22 10:19:47 +02:00
Famiu Haque
576dddb461 test: don't unnecessarily specify win/buf for nvim_(get|set)_option_value
`nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
2023-05-22 13:02:07 +06:00
dundargoc
8b8e607284
build: move luarocks and rocks installation to main build
This will ensure luacheck and busted are only installed when they're
actually needed. This cuts total build time by over 50%.

Closes https://github.com/neovim/neovim/issues/22797.
2023-05-21 20:57:39 +02:00
bfredl
384a3bc308
Merge pull request #23670 from famiu/refactor/deprecate_opt_api
refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
2023-05-21 20:16:05 +02:00
Christian Clason
edf9a897f0
fix(treesitter): update highlights for query (#23699)
captures for `; extends` and `; inherits`
2023-05-21 19:22:28 +02:00
luukvbaal
60f69014a8
fix(redraw): multibyte characters are wrapped at the end of a line (#23696)
Problem:    Multibyte characters may be wrapped at the end of a line
            when 'statuscolumn' and 'spell' are set.
Solution:   Update line pointerdiff "v" before fetching the line pointer
            after evaluating 'statuscolumn'.
2023-05-21 19:00:37 +08:00
Christian Clason
387c8ceb28
Merge pull request #23697 from clason/bump-luv
build(deps): bump luv to HEAD - c1497c0
2023-05-21 12:06:35 +02:00
Christian Clason
3b66f92d0e docs(luv): update to HEAD 2023-05-21 11:29:47 +02:00
Lewis Russell
1fe1bb084d refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-05-21 15:14:01 +06:00
Christian Clason
bbedbc347f build(deps): bump luv to HEAD - c1497c0ff 2023-05-21 10:52:50 +02:00
Christian Clason
e3e6fadfd8
feat(fs): expose join_paths as vim.fs.joinpath (#23685)
This is a small function but used a lot in some plugins.
2023-05-20 17:30:48 +02:00
Jon Huhn
073035a030
fix(lsp): don't register didChangeWatchedFiles when capability not set (#23689)
Some LSP servers (tailwindcss, rome) are known to request registration
for `workspace/didChangeWatchedFiles` even when the corresponding client
capability does not advertise support. This change adds an extra check
in the `client/registerCapability` handler not to start a watch unless
the client capability is set appropriately.
2023-05-20 07:45:39 +02:00
zeertzjq
413d57ae71
vim-patch:partial:9.0.1570: some tests are slow (#23688)
Problem:    Some tests are slow.
Solution:   Make a few test cases faster.

bf63011a52

Cherry-pick related test_cmdline.vim changes from patch 9.0.0418.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-20 08:21:48 +08:00
zeertzjq
d86a737df1
Merge pull request #23686 from luukvbaal/smoothscroll
vim-patch:9.0.{1564,1568}
2023-05-20 08:21:04 +08:00
Luuk van Baal
cf0f83ebf0 vim-patch:9.0.1568: with 'smoothscroll' cursor may move below botline
Problem:    With 'smoothscroll' cursor may move below botline.
Solution:   Call redraw_later() if needed,  Compute cursor row with adjusted
            condition. (Luuk van Baal, closes vim/vim#12415)

d49f646bf5
2023-05-19 19:28:01 +02:00
Luuk van Baal
02ef104d5b vim-patch:9.0.1564: display moves up and down with 'incsearch' and 'smoothscroll'
Problem:    Display moves up and down with 'incsearch' and 'smoothscroll'.
Solution:   Do not check if w_skipcol changed. (Luuk van Baal, closes vim/vim#12410,
            closes vim/vim#12409)

0222c2d103
2023-05-19 18:42:23 +02:00
Christian Clason
4c05b1a6ab
build(deps): bump libuv to v1.45.0 (#23684) 2023-05-19 14:15:24 +02:00
Christian Clason
201f366b37
vim-patch:9.0.1565: json lines files are not recognized (#23677)
Problem:    Json lines files are not recognized.
Solution:   Add a pattern to detect "jsonl" files. (issue vim/vim#7520)

6fadbc1e8c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-19 09:11:22 +02:00
zeertzjq
3ae62c4706
fix(tui): make disabling title restore old title from stack (#23585)
This makes setting 'notitle' in Nvim behave more like Vim in terminals
that support title stacking.
2023-05-19 07:30:22 +08:00
dundargoc
24b60b0f71
build: don't format deleted files
Trying to format deleted files will otherwise throw an error.
2023-05-18 16:28:46 +02:00
dundargoc
826b95203a
build: bundle uncrustify
Uncrustify is sensitive to version changes, which causes friction for
contributors that doesn't have that exact version. It's also simpler to
download and install the correct version than to have bespoke version
checking.
2023-05-18 16:27:47 +02:00
dundargoc
c40872acbd
build: remove duplicate include directories in --version output
Having the same directory listed multiple times makes the --version
output needlessly complicated to visualize. This deduplication will only
work for cmake version 3.15 and above, which should be the majority of
neovim builds by now. For older cmake versions we default to the
previous behavior of listing duplicate include directories.
2023-05-18 16:27:05 +02:00
Lewis Russell
ef64e225f6
fix(treesitter): allow foldexpr without highlights (#23672)
Ref nvim-treesitter/nvim-treesitter#4748
2023-05-18 10:52:01 +01:00
zeertzjq
c9f47fca8b
fix(messages): ensure msg_grid is at top at more prompt (#23584) 2023-05-17 21:06:27 +08:00
bfredl
67176c3f20
Merge pull request #15534 from bfredl/monomap
refactor(map): avoid duplicated khash_t implementations for values and support sets
2023-05-17 13:00:32 +02:00
Lewis Russell
189fb62032
feat(treesitter): improved logging (#23638)
- Add bindings to Treesitter ts_parser_set_logger and ts_parser_logger
- Add logfile with path STDPATH('log')/treesitter.c
- Rework existing LanguageTree loggin to use logfile
- Begin implementing log levels for vim.g.__ts_debug
2023-05-17 11:42:18 +01:00
bfredl
e2fdd53d8c refactor(map): avoid duplicated khash_t types for values
This reduces the total number of khash_t instantiations from 22 to 8.

Make the khash internal functions take the size of values as a runtime
parameter. This is abstracted with typesafe Map containers which
are still specialized for both key, value type.

Introduce `Set(key)` type for when there is no value.

Refactor shada.c to use Map/Set instead of khash directly.
This requires `map_ref` operation to be more flexible.
Return pointers to both key and value, plus an indicator for new_item.
As a bonus, `map_key` is now redundant.

Instead of Map(cstr_t, FileMarks), use a pointer map as the FileMarks struct is
humongous.

Make `event_strings` actually work like an intern pool instead of wtf it
was doing before.
2023-05-17 12:26:21 +02:00
Lewis Russell
6b19170d44
fix(treesitter): correctly calculate bytes for text sources (#23655)
Fixes #20419
2023-05-16 16:41:47 +01:00
ii14
d36dd2bae8
refactor: use xstrl{cpy,cat} on IObuff (#23648)
Replace usage of STR{CPY,CAT} with xstrl{cpy,cat} when using on IObuff

Co-authored-by: ii14 <ii14@users.noreply.github.com>
2023-05-16 11:33:03 +08:00
zeertzjq
66b7f62542
vim-patch:8.2.2858: test fails because of changed error message (#23647)
Problem:    Test fails because of changed error message.
Solution:   Adjust the expected error message.

6b02b38ed0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-16 10:00:40 +08:00
luukvbaal
5887ecab6d
vim-patch:9.0.1561: display wrong when moving cursor to above the top line (#23644)
Problem:    Display wrong when moving cursor to above the top line and
            'smoothscroll' is set.
Solution:   Call adjust_skipcol() in more places and make it work better.
            (Luuk van Baal, closes vim/vim#12395)

798fa76dbf
2023-05-16 07:56:06 +08:00
ii14
bd247d835f
ci: remove redundant asan and ubsan options
We now have default options for ASAN and UBSAN (#23259)
2023-05-15 23:21:04 +02:00
Christian Clason
8e3124493c
Merge pull request #23606 from clason/bump-tree-sitter-lua
fix(treesitter): update parser and queries
2023-05-15 19:46:47 +02:00
bfredl
88a202a010
Merge pull request #23259 from ii14/build/ubsan_default_options
build: add asan and ubsan default options
2023-05-15 17:24:00 +02:00
ii14
4cc69f45b4 build: add ubsan default options
Use print_stacktrace=1 for UBSAN by default.
2023-05-15 16:50:58 +02:00
Christian Clason
9ff59517cb fix(treesitter): update c queries 2023-05-15 14:13:42 +02:00