Commit Graph

26270 Commits

Author SHA1 Message Date
Santos Gallegos
8c9dab3e0d
fix(treesitter): use vim.highlight.priorities instead of hardcoded 100 (#24052)
Problem: Treesitter highlighting base priority cannot be customized.

Solution: Use `vim.highlight.priorities.treesitter` instead of hard-coded value.
2023-06-18 16:42:17 +02:00
Evgeni Chasnovski
8a7e3353eb
fix(fs): make normalize() work with '/' path (#24047)
Problem: Current implementation of "remove trailing /" doesn't
account for the case of literal '/' as path.
Solution: Remove trailing / only if it preceded by something else.

Co-authored by: notomo <notomo.motono@gmail.com>
2023-06-18 06:49:33 -05:00
zeertzjq
7e301ed5b9
vim-patch:9.0.1638: crypt tests hang and cause memory errors (#24053)
Problem:    crypt tests hang and cause memory errors
Solution:   Move variable to start of function.

438d0c5e58

N/A patches for version.c:

vim-patch:9.0.1639: build failure without the crypt feature

Problem:    Build failure without the crypt feature.
Solution:   Adjust #ifdefs

bc385a150f

vim-patch:9.0.1640: compiler warning for unused variables without crypt feature

Problem:    Compiler warning for unused variables without the crypt feature.
Solution:   Adjust #ifdefs

7f29122c8c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-18 07:08:31 +08:00
Jonas Strittmatter
c07dceba33
fix(lsp): allow Lua pattern chars in code action filter (#24041)
Previously, filtering code actions with the "only" option failed
if the code action kind contained special Lua pattern chars such as "-"
(e.g. the ocaml language server supports a "type-annotate" code action).

Solution: use string comparison instead of string.find
2023-06-17 08:01:31 +02:00
zeertzjq
4e63104c47
vim-patch:9.0.1637: compiler warning for uninitialized variable (#24042)
Problem:    Compiler warning for uninitialized variable.
Solution:   Move the variable to an inner block and initialize it. (Christian
            Brabandt, closes vim/vim#12549)

54f50cbf6a

The "eof" variable is not present in Nvim because it is only used by
FEAT_CRYPT.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-06-17 06:23:07 +08:00
zeertzjq
8376e8700b
Merge pull request #24037 from zeertzjq/vim-9.0.1634
vim-patch:9.0.{1634,1635}: message is cleared when removing mode message
2023-06-16 09:20:41 +08:00
zeertzjq
11060793d6 vim-patch:9.0.1635: error message is cleared when removing mode message
Problem:    Error message is cleared when removing mode message.
Solution:   Also reset flags when the message is further down.

da51ad51bf

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-16 08:55:05 +08:00
zeertzjq
cba07dad49 vim-patch:9.0.1634: message is cleared when removing mode message
Problem:    Message is cleared when removing mode message (Gary Johnson).
Solution:   Do not clear the command line after displaying a message.

800cdbb7ca

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-16 08:55:03 +08:00
zeertzjq
ddba917efe
vim-patch:9.0.1636: expanding a pattern interferes with cmdline completion (#24034)
Problem:    Expanding a pattern interferes with command line completion.
Solution:   Set the file index only when appropriate. (closes vim/vim#12519)

094dd152fe
2023-06-16 07:02:21 +08:00
zeertzjq
1f8fb7c000
fix(:let): fix error when applying operator to boolean option (#24030) 2023-06-15 12:36:21 +08:00
zeertzjq
d81f78713b
test(decorations_spec): add test for extmark case of #21486 (#24028) 2023-06-15 11:14:50 +08:00
zeertzjq
a05bbc60ea
fix(extmarks): don't position overlay virt_text halfway a char (#24027) 2023-06-15 09:03:39 +08:00
zeertzjq
78d77c03de
vim-patch:9.0.1631: passing wrong variable type to option gives multiple errors (#24026)
Problem:    Passing a wrong variable type to an option gives multiple errors.
Solution:   Bail out early on failure. (closes vim/vim#12504)

4c7cb372c1
2023-06-15 08:05:26 +08:00
Erich Gubler
cf6cffda89
docs(ex_cmds): migration from "behave xterm" #24024 2023-06-14 15:23:15 -07:00
zeertzjq
bbb934e775
vim-patch:9.0.1629: having utf16idx() rounding up is inconvenient (#24019)
Problem:    Having utf16idx() rounding up is inconvenient.
Solution:   Make utf16idx() round down. (Yegappan Lakshmanan, closes vim/vim#12523)

95707037af

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-06-14 20:54:11 +08:00
Jon Huhn
79a5b89d66
perf(lsp): reduce polling handles for workspace/didChangeWatchedFiles (#23500)
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2023-06-14 12:40:11 +02:00
t0muxx
0ce065a332
fix(tui): v:argv does not report the original argv[0] #24015
Problem:
Since TUI was moved to another process 2448816956
v:argv and v:progname don't report the original argv[0].
    ["/usr/bin/nvim", "--embed", ...]

Solution:
Use argv[0] instead of VV_PROGPATH in ui_client_start_server().
Fix #23953
2023-06-14 02:39:14 -07:00
Rohit Sukumaran
bc67bbe446
fix(codelens): add buffer and line checks before displaying codelens (#23887)
Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
2023-06-13 16:17:35 +01:00
Mathias Fußenegger
91f67fabe6
fix(lsp): handle stale bufnr on LspRequest autocmd trigger (#24013)
Fixes a `Invalid buffer id: 123` race when the buffer gets deleted before
the callback triggered.

Alternative to https://github.com/neovim/neovim/pull/23981
2023-06-13 16:53:13 +02:00
Famiu Haque
a9968912b7
fix(api): redundant error when using nvim_cmd (#24010)
`nvim_cmd` shows multiple errors when attempting to edit another buffer
through a command when `curbuf->b_ro_locked` is set. This PR fixes that
by removing a redundant error in `execute_cmd`.
2023-06-13 13:55:20 +01:00
zeertzjq
4c7cec4e29
fix(extmarks): handle inline virt_text with empty chunk (#24005) 2023-06-13 11:30:19 +08:00
zeertzjq
a7e5d4238a
vim-patch:8.2.4600: Vim9: not enough test coverage for executing :def function (#24001)
Problem:    Vim9: not enough test coverage for executing :def function.
Solution:   Add a few more tests.  Fix inconsistencies.

6b8c7ba062

Cherry-pick a blank line in test_listdict.vim from patch 8.2.3842.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 21:58:40 +08:00
zeertzjq
564d2d20a3
Merge pull request #24000 from zeertzjq/vim-8.2.3332
vim-patch:8.2.{3332,3338}
2023-06-12 21:33:24 +08:00
zeertzjq
d86acfa149 vim-patch:8.2.3338: Vim9: no type check when assigning a list range
Problem:    Vim9: no type check when assigning a list range. (Naohiro Ono)
Solution:   Check the member type. (closes vim/vim#8750)

89071cb6a1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 21:05:56 +08:00
zeertzjq
aa92a04bee vim-patch:8.2.3332: Vim9: cannot assign to range in list
Problem:    Vim9: cannot assign to range in list.
Solution:   Implement overwriting a list range.

4f0884d6e2

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 21:05:22 +08:00
zeertzjq
0eb02ea90a
docs: various clarifications (#23999)
Close #18907
Close #20314
Close #23749
2023-06-12 20:08:08 +08:00
zeertzjq
758c418d12
Merge pull request #23998 from zeertzjq/vim-8.2.3852
vim-patch:8.2.{3852,3853}
2023-06-12 18:46:35 +08:00
zeertzjq
aa7c4b88dc vim-patch:8.2.3853: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Run more existing tests for Vim9 script.

700e6b1662

Cherry-pick test_listdict.vim change from patch 8.2.3854.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 18:17:40 +08:00
zeertzjq
d83a196716 vim-patch:8.2.3852: Vim9: not enough tests
Problem:    Vim9: not enough tests.
Solution:   Also run existing tests for Vim9 script.  Make errors more
            consistent.

f47c5a8e2d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 18:14:20 +08:00
zeertzjq
b867f6c7c5
Merge pull request #23996 from zeertzjq/vim-8.2.3191
vim-patch:8.2.{2533,3191,3202,partial:3335}
2023-06-12 17:50:34 +08:00
zeertzjq
4058f95d9d vim-patch:partial:8.2.3335: Vim9: not enough tests run with Vim9
Problem:    Vim9: not enough tests run with Vim9.
Solution:   Run a few more tests in Vim9 script and :def function.  Fix that
            items(), keys() and values9) return zero for a NULL dict.
            Make join() return an empty string for a NULL list.  Make sort()
            return an empty list for a NULL list.

ef98257593

Skip f_reverse() change for consistency with other functions.
Skip Test_null_list() and Test_null_dict() because of missing patches.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
zeertzjq
8d8ac15ed9 vim-patch:8.2.3202: Vim9: tests are only executed for legacy script
Problem:    Vim9: tests are only executed for legacy script.
Solution:   Run more tests also for Vim9 script.  Fix uncovered problems.

5dd839ce20

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
zeertzjq
a73118df0e vim-patch:8.2.3191: Vim9: not enough code is tested
Problem:    Vim9: not enough code is tested.
Solution:   Use CheckLegacyAndVim9Success() in more places.  Fix uncovered
            problems.

63cb6567f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
zeertzjq
a0cb53eca7 vim-patch:8.2.2533: Vim9: cannot use a range with :unlet
Problem:    Vim9: cannot use a range with :unlet.
Solution:   Implement ISN_UNLETRANGE.

5b5ae29bd3

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 17:20:55 +08:00
zeertzjq
551cc3a2a3
Merge pull request #23995 from zeertzjq/vim-8.2.1524
vim-patch:8.2.{1524,2948,2949}: Float to String conversion
2023-06-12 14:41:19 +08:00
Sean Dewar
41ee7bc7db test(unit/eval/typval_spec): adjust for Float to String conversion
Adjust relevant Lua tests. Refactor testing logic for tv_get_string_*
functions into test_string_fn().

Note that vim_snprintf(), which is used for stringifying floats, always
calls xfree(tofree), even if tofree is NULL, so we need to expect that
in the alloc log.
2023-06-12 14:08:27 +08:00
zeertzjq
7abfb1f86e vim-patch:8.2.2949: tests failing because no error for float to string conversion
Problem:    Tests failing because there is no error for float to string
            conversion.
Solution:   Change the check for failure to check for correct result.  Make
            some conversions strict in Vim9 script.

3cfa5b16b0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:16 +08:00
Sean Dewar
1ffd20a26e test(unit/eval/typval_spec): don't dereference NULL last_msg_hist
If last_msg_hist is NULL, check_emsg will cause the running test process
to SIGSEGV from trying to access the msg member.
2023-06-12 13:27:16 +08:00
Sean Dewar
7f8c1e53a6 vim-patch:8.2.2948: substitute() accepts a number but not a float expression
Problem:    Substitute() accepts a number but not a float expression.
Solution:   Also accept a float. (closes vim/vim#8331)

7a2217bedd

Vim9script is N/A. No need to port the strict argument and
tv_get_string_buf_chk_strict(), as it's only used for Vim9script.

Like the patch, use vim_snprintf over snprintf, as the "%g" specifier in
snprintf removes the ".0" from integer floats.

This means similiar to numbers, floats are (mostly) convertable to
strings.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-06-12 13:27:07 +08:00
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
6e1fa16dde
Merge #23954 vim.version() returns Version object 2023-06-11 16:32:37 -07: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
Stanislav Asunkin
d3b9feccb3
docs: fix vim.tbl_get type annotations #23992 2023-06-11 15:48:13 -07:00
Gianmaria Bajo
ecdb6465e2 feat: vim.version() returns a Version object
- vim.version() returns a Version object.
  Makes it printable and removes the need of workarounds when passing it
  to other vim.version methods.
2023-06-12 00:09:10 +02:00
Justin M. Keyes
46fab3831b refactor: remove WINGUI_URL
nvim-qt was removed in 0370e4def0
2023-06-12 00:06:30 +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
jdrouhard
385a1facf2
docs: semantic token methods in :h lsp-method #23991 2023-06-11 14:48:57 -07:00
Stephan Seitz
ceb37ff1d8
refactor(treesitter): use npcall in _query_linter.lua #23985 2023-06-11 14:46:22 -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