Commit Graph

5813 Commits

Author SHA1 Message Date
zeertzjq
49ede0a68f vim-patch:9.0.1600: screenpos() does not take w_skipcol into account
Problem:    screenpos() does not take w_skipcol into account.
Solution:   Subtract w_skipcol from column. (closes vim/vim#12486, closes vim/vim#12476)

f0e68c0e2a
2023-06-05 07:49:44 +08:00
Folke Lemaitre
5282d3299c
fix(lsp): restore marks after apply_text_edits() #14630
PROBLEM:
Whenever any text edits are applied to the buffer, the `marks` part of those
lines will be lost. This is mostly problematic for code formatters that format
the whole buffer like `prettier`, `luafmt`, ...

When doing atomic changes inside a vim doc, vim keeps track of those changes and
can update the positions of marks accordingly, but in this case we have a whole
doc that changed. There's no simple way to update the positions of all marks
from the previous document state to the new document state.

SOLUTION:
* save marks right before `nvim_buf_set_lines` is called inside `apply_text_edits`
* check if any marks were lost after doing `nvim_buf_set_lines`
* restore those marks to the previous positions

TEST CASE:
* have a formatter enabled
* open any file
* create a couple of marks
* indent the whole file to the right
* save the file
Before this change: all marks will be removed.
After this change: they will be preserved.

Fixes #14307
2023-06-04 16:45:01 -07:00
zeertzjq
67827edeef
vim-patch:9.0.1606: using freed memory when 'foldcolumn' is set (#23906)
Problem:    Using freed memory when 'foldcolumn' is set.
Solution:   Save extra pointer to free it later. (closes vim/vim#12492)

58e1e01045
2023-06-05 06:58:14 +08:00
zeertzjq
fdc8e966a9
fix(ui): don't send empty grid_line with redrawdebug=compositor (#23899) 2023-06-04 10:49:02 +08:00
zeertzjq
700cab0068
fix(events)!: trigger CursorMoved later on switching window (#23711) 2023-06-04 09:09:22 +08:00
zeertzjq
53f30de2be
vim-patch:9.0.1602: stray character visible if marker on top of double-wide char (#23897)
Problem:    Stray character is visible if 'smoothscroll' marker is displayed
            on top of a double-wide character.
Solution:   When overwriting a double-width character with the 'smoothscroll'
            marker clear the second half. (closes vim/vim#12469)

ecb87dd7d3
2023-06-04 07:39:05 +08:00
Christian Clason
0a439e3863
vim-patch:9.0.1601: filetype detection fails for *.conf file without comments (#23896)
Problem:    Filetype detection fails for *.conf file without comments.
            (Dmitrii Tcyganok)
Solution:   Use "conf" filetype as a fallback for an empty .conf file.
            (closes vim/vim#12487, closes vim/vim#12483)

664fd12aa2

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-04 00:39:46 +02:00
bfredl
72300feecf
Merge pull request #23864 from folke/nvim_win_set_height
fix(api): dont change curwin for nvim_win_set_height
2023-06-03 18:12:24 +02:00
zeertzjq
0e01e81552
fix(folds): allow overlay virtual text on folded line (#23892)
Also always check for fi_level before fi_lines.
2023-06-03 18:44:08 +08:00
Lewis Russell
2db719f6c2
feat(lua): rename vim.loop -> vim.uv (#22846) 2023-06-03 12:06:00 +02:00
luukvbaal
c45a111e35
vim-patch:9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor" (#23884)
Problem:    Cursor not adjusted when near top or bottom of window and
            'splitkeep' is not "cursor".
Solution:   Move boundary checks to outer cursor move functions, inner
            functions should only return valid cursor positions. (Luuk van
            Baal, closes vim/vim#12480)

a109f39ef5
2023-06-02 23:26:41 +08:00
zeertzjq
4b60267f82
feat(:source): source current ft=lua buffer as Lua code (#23802) 2023-06-02 21:00:55 +08:00
zeertzjq
9f3c4c1526
vim-patch:9.0.1597: cursor ends up below the window after a put (#23873)
Problem:    Cursor ends up below the window after a put.
Solution:   Mark w_crow and w_botline invalid when changing the cursor line.
            (closes vim/vim#12465)

8509014add

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-02 08:48:49 +08:00
zeertzjq
a0375b68c1
vim-patch:9.0.1598: screenchar() and others are wrong with DBCS 'encoding' (#23872)
Problem:    screenchar(), screenchars() and screenstring() do not work
            properly when 'encoding' is set to a double-byte encoding.
Solution:   Fix the way the bytes of the characters are obtained.
            (issue vim/vim#12469)

47eec6716b
2023-06-02 04:31:17 +08:00
Gregory Anders
fb54e6980e feat(lsp): set client offset_encoding if server supports positionEncoding
If the server sends the positionEncoding capability in its
initialization response, automatically set the client's offset_encoding
to use the value provided.
2023-06-01 11:34:23 -05:00
zeertzjq
afb70eba8c
Merge pull request #23789 from luukvbaal/spell
vim-patch:9.0.{1585,1595}
2023-06-01 21:29:14 +08:00
Luuk van Baal
ac1ad9651e vim-patch:9.0.1595: line pointer becomes invalid when using spell checking
Problem:    Line pointer becomes invalid when using spell checking.
Solution:   Call ml_get() at the right places. (Luuk van Baal, closes vim/vim#12456)

e84c773d42
2023-06-01 14:30:21 +02:00
zeertzjq
7801091062
vim-patch:9.0.1596: :registers command does not work in sandbox (#23866)
Problem:    :registers command does not work in sandbox.
Solution:   Add flag to the command. (closes vim/vim#12473)

eb43b7f053

Co-authored-by: Julio B <julio.bacel@gmail.com>
2023-06-01 20:28:16 +08:00
Folke Lemaitre
68e7a6a6dc
test: added tests for set_height with winminheight=0 and a winbar 2023-06-01 12:23:42 +02:00
zeertzjq
2bdef6dd2a
fix(column): don't overflow sign column with extmark signs (#23854) 2023-06-01 16:20:31 +08:00
zeertzjq
7e3ff8afa4
test(extmarks): folding inline virt_text on empty line (#23847) 2023-05-31 06:50:37 +08:00
jdrouhard
58618d208a
feat(lsp)!: promote LspRequest to a full autocmd and enrich with additional data (#23694)
BREAKING CHANGE: LspRequest is no longer a User autocmd but is now a
first class citizen.

LspRequest as a User autocmd had limited functionality. Namely, the only
thing you could do was use the notification to do a lookup on all the
clients' requests tables to figure out what changed.

Promoting the autocmd to a full autocmd lets us set the buffer the
request was initiated on (so people can set buffer-local autocmds for
listening to these events).

Additionally, when used from Lua, we can pass additional metadata about
the request along with the notification, including the client ID, the
request ID, and the actual request object stored on the client's
requests table. Users can now listen for these events and act on them
proactively instead of polling all of the requests tables and looking
for changes.
2023-05-30 20:56:29 +02:00
luukvbaal
70da793c5e
fix(statusline): corrupted screen with minwid sign item in 'statuscolumn' (#23823) 2023-05-30 20:56:12 +08:00
zeertzjq
55f6a1cab0
vim-patch:9.0.1588: Incsearch not triggered when pasting clipboard register (#23817)
Problem:    Incsearch not triggered when pasting clipboard register on the
            command line.
Solution:   Also set "literally" when using a clipboard register. (Ken Takata,
            closes vim/vim#12460)

9cf6ab1332

Co-authored-by: K.Takata <kentkt@csc.jp>
2023-05-30 07:18:12 +08:00
Omar El Halabi
e8776074f5
vim-patch:9.0.1591: some "gomod" files are not recognized (#23820)
Problem:    Some "gomod" files are not recognized.
Solution:   Check for "go.mod" file name before checking out the contents.
            (Omar El Halabi, closes vim/vim#12462)

c9fbd2560f
2023-05-30 06:44:23 +08:00
Christian Clason
b8a2220f5e
vim-patch:9.0.1587: Corn config files are not recognized (#23807)
Problem:    Corn config files are not recognized.
Solution:   Add a pattern for Corn config files. (Jake Stanger, closes vim/vim#12449)

05843e8960

Co-authored-by: Jake Stanger <mail@jstanger.dev>
2023-05-29 10:25:05 +02:00
zeertzjq
9dd48f7832
fix(substitute): properly check if preview is needed (#23809) 2023-05-29 08:44:52 +08:00
Ghjuvan Lacambre
5a3752889c
fix(NVIM_APPNAME): show error message if $NVIM_APPNAME is invalid
Closes https://github.com/neovim/neovim/issues/23056.
2023-05-28 16:04:54 +02:00
Christian Clason
8e17054a23
vim-patch:9.0.1584: not all meson files are recognized (#23797)
Problem:    Not all meson files are recognized.
Solution:   Add "meson.options". (Liam Beguin, closes vim/vim#12444)

1ba0b9e36f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-28 11:47:07 +02:00
zeertzjq
9c41a81dec
fix(extmarks): fix virt_text_hide off-by-one hiding (#23795) 2023-05-28 17:29:44 +08:00
zeertzjq
4dd43e31db
fix(extmarks): don't show virt lines for end mark (#23792) 2023-05-28 17:22:25 +08:00
zeertzjq
f29acc5073
test(extmarks): add tests for #14201 #20004 #20885 (#23794) 2023-05-28 16:28:10 +08:00
Folke Lemaitre
ddd92a70d2
feat(lsp): initial support for dynamic capabilities (#23681)
- `client.dynamic_capabilities` is an object that tracks client register/unregister
- `client.supports_method` will additionally check if a dynamic capability supports the method, taking document filters into account. But only if the client enabled `dynamicRegistration` for the capability
- updated the default client capabilities to include dynamicRegistration for:
    - formatting
    - rangeFormatting
    - hover
    - codeAction
    - hover
    - rename
2023-05-28 07:51:28 +02:00
zeertzjq
e41b2e34b4
test(extmarks): add test for virt_text_hide with 'smoothscroll' (#23791) 2023-05-28 11:09:25 +08:00
zeertzjq
b46f61ac05
vim-patch:9.0.1582: :stopinsert may not work in a popup close handler (#23785)
Problem:    :stopinsert may not work in a popup close handler. (Ben Jackson)
Solution:   Restore stop_insert_mode when appropriate. (closes vim/vim#12452,
            closes vim/vim#12434)

a40c0bcc83
2023-05-27 22:15:22 +08:00
zeertzjq
510e1f131b
fix(extmarks): make right_align and win_col work on wrapped line (#23759) 2023-05-27 21:36:16 +08:00
bfredl
68da87d2e7
Merge pull request #23742 from bfredl/neolight
fix(drawline): combine extmark highlight with area hl correctly
2023-05-26 11:48:05 +02:00
bfredl
a92d78d201
Merge pull request #23583 from zeertzjq/ui-attach-title
fix(ui-ext): send title to newly-attached UI
2023-05-26 11:29:56 +02:00
zeertzjq
a6dd67f5b6
fix(extmarks): fix virt_text_hide with 'nowrap' and multibyte (#23757) 2023-05-26 10:41:19 +08:00
luukvbaal
f733595e79
vim-patch:9.0.1578: SpellCap highlight not always updated when needed (#23755)
Problem:    SpellCap highlight not always updated when needed.
Solution:   Handle updating line below closed fold and other situations where
            only part of the window is redrawn. (Luuk van Baal, closes vim/vim#12428,
            closes vim/vim#12420)

2ac6497f0e
2023-05-26 08:08:18 +08:00
zeertzjq
43d66c0ebb fix(ui-ext): send title to newly-attached UI 2023-05-26 07:46:24 +08:00
bfredl
455bca1ba8 fix(drawline): combine extmark highligh with area hl correctly
fixes #23734

Get rid of the weird attr_pri dance which always seemed like a kludge:

    if (!attr_pri) {
      wlv.char_attr = hl_combine_attr(wlv.char_attr, extmark_attr);
    } else {
      wlv.char_attr = hl_combine_attr(extmark_attr, wlv.char_attr);
    }

Instead combine extmark attrs with (old-skool) syntax attrs in a consistent way and then combine that with attr_pri and the rest in an _unified_ code path

fixes #23722

Co-authored-by: luukvbaal <luukvbaal@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-05-25 18:40:26 +02:00
zeertzjq
ee986ee044
fix(folds): combined Folded and Visual highlights (#23752)
Also combine high-priority CursorLine with Folded.
2023-05-25 22:14:12 +08:00
zeertzjq
aa9d46b672
Merge pull request #23744 from luukvbaal/spell
vim-patch:9.0.{0175,0590,0608,0664}
2023-05-25 18:01:06 +08:00
Luuk van Baal
50efdd6ccf vim-patch:9.0.0664: bad redrawing with spell checking, using "C" and "$" in 'cpo'
Problem:    Bad redrawing with spell checking, using "C" and "$" in 'cpo'.
Solution:   Do not redraw the next line when "$" is in 'cpo'. (closes vim/vim#11285)

f3ef026c98

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-25 11:24:22 +02:00
Luuk van Baal
d2dc7cfa5b vim-patch:9.0.0608: with spelling, deleting a full stop does not update next line
Problem:    With spell checking, deleting a full stop at the end of a line
            does not update SpellCap at the start of the next line.
Solution:   Update the next line when characters have been deleted.  Also when
            using undo.

26f09ea54b

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-25 11:24:22 +02:00
Luuk van Baal
ad7cded1f3 vim-patch:9.0.0590: after exiting Insert mode spelling not checked in next line
Problem:    After exiting Insert mode spelling is not checked in the next
            line.
Solution:   When spelling is enabled redraw the next line after exiting Insert
            mode in case the spell highlight needs updating.

ee09fcc9b6

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-05-25 11:24:19 +02:00
Luuk van Baal
bff67c9fbe vim-patch:9.0.0175: spell checking for capital not working with trailing space
Problem:    Spell checking for capital not working with trailing space.
Solution:   Do not calculate cap_col at the end of the line. (Christian
            Brabandt, closes vim/vim#10870, issue vim/vim#10838)

afa23d1b99

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-05-25 01:13:47 +02:00
dundargoc
ebb10d6248
build: remove functionaltest-lua target
It's not needed anymore as it does the exact same thing as
functionaltest. The functionaltest target will test the lua type neovim
was built with, which can be toggled with the PREFER_LUA option.
2023-05-24 21:14:47 +02:00
zeertzjq
678548a2b4
fix(folds): show Folded highlight in Visual selection (#23741)
Note: CursorLine highlight is now combined with Folded.
2023-05-24 21:25:39 +08:00