Commit Graph

5854 Commits

Author SHA1 Message Date
Sean Dewar
c690f10194 vim-patch:8.2.1524: no longer get an error for string concatenation with float
Problem:    No longer get an error for string concatenation with float.
            (Tsuyoshi Cho)
Solution:   Only convert float for Vim9 script. (closes vim/vim#6787)

2e0866128b

Vim9script is N/A.

Required for v8.2.2949.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:04 +08:00
zeertzjq
3c4890d1ef
test(old): reorder test_substitute.vim to match upstream (#23994) 2023-06-12 11:44:01 +08:00
Justin M. Keyes
e688793253 feat: tostring(vim.version())
Problem:
tostring(vim.version()) returns "table: 0x…".

Solution:
Modify vim.version() to return a string prerelease instead of a boolean.

Fix #23863
2023-06-12 01:14:33 +02:00
treatybreaker
199a990c9e
feat: report "build" in vim.version() #23925
Problem:
Nvim version string typically has a "build" component
but vim.version() doesn't report it.

Solution:
Add the "build" field to vim.version().

Closes #23863
2023-06-11 14:57:23 -07:00
zeertzjq
bde59e8147
fix(remote): restore previous --remote-expr output formatting (#23988)
- Use tostring() as that's what print() uses internally.
- Do not append trailing new line.
2023-06-11 22:12:32 +08:00
Chinmay Dalal
643546b82b
feat(lsp): add handlers for inlay hints (#23736)
initial support; public API left for a follow-up PR
2023-06-11 11:53:37 +02:00
zeertzjq
cce9460524
fix(remote): make --remote-expr print to stdout (#23980) 2023-06-11 15:29:51 +08:00
zeertzjq
4229bbe514
fix(helptags): make multibyte help tags work properly (#23975) 2023-06-11 12:23:11 +08:00
zeertzjq
2237b384e4
vim-patch:9.0.1626: Visual area not shown when using 'showbreak' (#23978)
Problem:    Visual area not shown when using 'showbreak' and start of line is
            not visible. (Jaehwang Jung)
Solution:   Adjust "fromcol" for the space taken by 'showbreak'.
            (closes vim/vim#12514)

f578ca2c8f

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-11 11:29:39 +08:00
Mathias Fußenegger
302d3cfb96
feat(lua): use callable table as iterator in vim.iter (#23957)
A table passed to `vim.iter` can be a class instance with a `__call`
implementation for the iterator protocol.
2023-06-10 20:33:23 +02:00
zeertzjq
b6d2f49b45
test: more tests for nvim_{set,del}_keymap with abbreviation (#23970) 2023-06-10 10:44:31 +08:00
Christian Clason
5959b3c922
vim-patch:9.0.1622: filetype name t32 is a bit obscure (#23967)
Problem:    Filetype name t32 is a bit obscure.
Solution:   Rename t32 to trace32. (Christoph Sax, closes vim/vim#12512)

740df76c90

Co-authored-by: Christoph Sax <christoph.sax@mailbox.org>
2023-06-09 23:48:31 +02:00
bfredl
42bbc4fabc feat(api): support abbreviations in nvim_set_keymap
closes #19198
2023-06-09 21:25:43 +02:00
zeertzjq
106922898a
vim-patch:9.0.1617: charidx() result is not consistent with byteidx() (#23963)
Problem:    charidx() and utf16idx() result is not consistent with byteidx().
Solution:   When the index is equal to the length of the text return the
            lenght of the text instead of -1. (Yegappan Lakshmanan,
            closes vim/vim#12503)

577922b917

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-09 17:43:46 +08:00
Christian Clason
f31dba93f9
vim-patch:9.0.1620: Nix files are not recognized from the hashbang line (#23961)
Problem:    Nix files are not recognized from the hashbang line.
Solution:   Add a hashbang check. (issue vim/vim#12507)

19548c6a74

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-09 08:59:28 +02:00
Christian Clason
be539f5fa8
vim-patch:9.0.1618: Trace32 files are not recognized (#23960)
Problem:    Trace32 files are not recognized.
Solution:   Add patterns for the t32 filetype. (Christoph Sax, closes vim/vim#12505)

7fbcee6f92

Co-authored-by: Christoph Sax <christoph.sax@mailbox.org>
2023-06-08 21:53:16 +02:00
Mathias Fußenegger
7c661207cc
feat(lua): add ringbuffer (#22894)
https://en.wikipedia.org/wiki/Circular_buffer
2023-06-08 12:11:24 +02:00
zeertzjq
38b0bb3c93
vim-patch:9.0.1616: quickfix text field is truncated (#23951)
Problem:    Quickfix text field is truncated.
Solution:   Fix output of text field after pattern field in quickfix buffer.
            (Shane Harper, closes vim/vim#12498)

5bf042810b

Co-authored-by: Shane Harper <shane@shaneharper.net>
2023-06-08 07:03:22 +08:00
Christian Clason
0329f5c2f4
vim-patch:9.0.1615: URL shortcut files are not recognized (#23950)
Problem:    URL shortcut files are not recognized.
Solution:   Add a pattern for URL shortcut files. (closes vim/vim#12474)

cdb7b4c508

Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
2023-06-07 20:53:02 +02:00
Lewis Russell
c0952e62fd
feat(lua): add vim.system()
feat(lua): add vim.system()

Problem:

  Handling system commands in Lua is tedious and error-prone:
  - vim.fn.jobstart() is vimscript and comes with all limitations attached to typval.
  - vim.loop.spawn is too low level

Solution:

  Add vim.system().
  Partly inspired by Python's subprocess module
  Does not expose any libuv objects.
2023-06-07 13:52:23 +01:00
Jonathon
0381f5af5b
feat(diff): grouping optimization for linematch algorithm 2023-06-07 13:29:23 +01:00
zeertzjq
dd24ea8195 fix(events): don't expand non-file as file name 2023-06-07 09:49:17 +08:00
zeertzjq
0e0a166a0c
refactor(api): adjust errors for setting options (#23942) 2023-06-07 09:00:55 +08:00
Famiu Haque
b3d5138fd0
refactor(options): remove getoption_T and introduce OptVal (#23850)
Removes the `getoption_T` struct and also introduces the `OptVal` struct
to unify the methods of getting/setting different option value types.
This is the first of many PRs to reduce code duplication in the Vim
option code as well as to make options easier to maintain. It also
increases the flexibility and extensibility of options. Which opens the
door for things like Array and Dictionary options.
2023-06-07 08:05:16 +08:00
Gregory Anders
fcfe535e98
refactor(defaults): do not use C specific default values for options (#22500)
The options 'path', 'include', and 'define' all use C-specific default
values. This may have made sense a long time ago when Vim was mostly
used just for writing C, but this is no longer the case, and we have
ample support for filetype specific configuration. Make the default
values of these options empty and move the C-specific values into a
filetype plugin where they belong.

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-06-06 11:26:29 -05:00
Alexandre Teoi
4382d2ed56
feat(health): fold successful healthchecks #22866
Problem:
checkhealth can be noisy, but we don't want to omit info.

Solution:
Fold OK results by default, if 'foldenable' is enabled.
Resolves #22796
2023-06-06 08:42:26 -07:00
zeertzjq
9d9af4fe27
vim-patch:9.0.1614: strlen() called too often for :spellrepall (#23940)
Problem:    strlen() called too often for :spellrepall.
Solution:   Store the result in a variable. (closes vim/vim#12497)

59f7038536
2023-06-06 23:31:29 +08:00
Gianmaria Bajo
ca887b80a9
fix: version-range < and <= #23539
vim.version.range() couldn't parse them correctly.
For example, vim.version.range('<0.9.0'):has('0.9.0') returned `true`.

fix: range:has() accepts vim.version()
So that it's possible to compare a range with:

    vim.version.range(spec):has(vim.version())
2023-06-06 06:38:45 -07:00
zeertzjq
7b973c71ea
fix(statusline): redraw when VIsual_mode changes (#23933) 2023-06-06 19:24:42 +08:00
zeertzjq
eceb2dffce
fix(spell): splice extmarks on :spellrepall (#23929) 2023-06-06 10:32:30 +08:00
Gregory Anders
43f3209b07
vim-patch:9.0.1613: some make output gets picked up by 'errorformat' (#23926)
Problem:    Some make output gets picked up by 'errorformat'.
Solution:   Ignore make output by default. (Gregory Anders, closes vim/vim#12481)

d1911a8e2b
2023-06-05 20:36:21 -05:00
zeertzjq
9deef1aa22
vim-patch:9.0.1612: "skipcol" not reset when using multi-byte characters (#23928)
Problem:    "skipcol" not reset when using multi-byte characters.
Solution:   Compare with w_virtcol instead of w_cursor.col. (closes vim/vim#12457)

15d4747ffd

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-06 07:13:08 +08:00
zeertzjq
fc908b5006 vim-patch:9.0.1610: display is wrong when 'smoothscroll' is set
Problem:    Display is wrong when 'smoothscroll' is set and scrolling multiple
            lines.
Solution:   Redraw with UPD_NOT_VALID when "skipcol" is or was set.
            (closes vim/vim#12490, closes vim/vim#12468)

d9a92dc70b
2023-06-06 06:37:27 +08:00
zeertzjq
9978a9996d vim-patch:9.0.1603: display wrong if scrolling multiple lines with 'smoothscroll'
Problem:    Display wrong when scrolling multiple lines with 'smoothscroll'
            set.
Solution:   Redraw when w_skipcol changed. (closes vim/vim#12477, closes vim/vim#12468)

3c80227760
2023-06-06 06:37:23 +08:00
Gregory Anders
cbbda3bcd7
fix(editorconfig): check that buffer is valid (#23922)
Fixes: https://github.com/neovim/neovim/issues/23921
2023-06-05 11:53:13 -05:00
zeertzjq
a3fba5cafc
fix(mouse): handle folded lines with virt_lines attached to line above (#23912) 2023-06-05 17:11:58 +08:00
zeertzjq
16561dac39
test(core/startup_spec): add a test for #13720 (#23910) 2023-06-05 14:09:25 +08:00
Jon Huhn
416fe8d185
refactor(lsp): use LPeg for watchfiles matching (#23788) 2023-06-05 07:19:31 +02:00
Raphael
3c6d971e54
fix(lsp): set extra info only when it has a value (#23868) 2023-06-05 07:17:38 +02:00
zeertzjq
7955c90621 fix(plines): folded lines with virt_lines attached to line above 2023-06-05 08:45:32 +08:00
zeertzjq
57fef392d2 vim-patch:9.0.1607: screenpos() returns wrong row with diff filler lines
Problem:    screenpos() returns wrong row with diff filler lines.
Solution:   Only add filler lines when appropriate.  Also don't add the
            'smoothscroll' marker when w_skipcol is zero. (closes vim/vim#12485,
            closes vim/vim#12484)

55daae3921
2023-06-05 07:49:44 +08:00
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