Commit Graph

23771 Commits

Author SHA1 Message Date
Vedant
488e99311f
ci(release/winget): correctly set output variable (#21077) 2022-11-17 09:43:45 +01:00
zeertzjq
6aa5520763
ci(windows): set $PSNativeCommandArgumentPassing = 'Legacy' (#21083)
Ref https://github.com/actions/runner-images/issues/6586

Some runners are using new images, while some others are using old
image. This is the only way I can find that makes it work on both.
2022-11-17 15:57:59 +08:00
zeertzjq
ed27f0e93e
vim-patch:9.0.0300: 'cpoptions' tests are flaky (#21081)
Problem:    'cpoptions' tests are flaky.
Solution:   Use a different file name for each test.

a85e4db978

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-17 07:51:04 +08:00
Jlll1
fedf002cb3
fix(api): nvim_win_set_cursor redraw cursorcolumn for non-current window (#21072)
fix #19063
this fixes the cursorcolumn not being redrawn for non-current windows in `nvim_win_set_cursor()`
2022-11-17 07:18:31 +08:00
zeertzjq
c404f9b4ba
ci(stale): disable remove-stale-when-updated (#21075)
The needs:response label should only be added and removed manually, and
the action's behavior of removing the label on any activity (e.g. title
change, removing reviewers) is unwanted.
2022-11-16 16:32:05 +01:00
Lewis Russell
fa7e1e2601
fix(api): nvim_buf_get_text regression (#21071) 2022-11-15 21:27:42 +00:00
luukvbaal
fd54194a4f
refactor: convert drawline.c draw states to enum (#21067) 2022-11-15 20:57:30 +00:00
zeertzjq
c70d90dbfd
vim-patch:9.0.0884: mouse shape remains in op-pending mode after failed change (#21066)
Problem:    Mouse shape remains in op-pending mode after failed change.
Solution:   Reset finish_op and restore it. (closes vim/vim#11545)

cdeb65729d
2022-11-15 23:02:48 +08:00
dundargoc
211c568e64
test: don't skip parser_spec on windows (#20294) 2022-11-15 19:33:30 +08:00
bfredl
4b02291f81
Merge pull request #20157 from dundargoc/build/iwyu
build: allow IWYU to fix includes for all .c files
2022-11-15 10:55:07 +01:00
bfredl
c6c265a86c
Merge pull request #21031 from dundargoc/fix/windows
ci(windows): treat compiler warnings as errors
2022-11-15 10:35:25 +01:00
dundargoc
66360675cf build: allow IWYU to fix includes for all .c files
Allow Include What You Use to remove unnecessary includes and only
include what is necessary. This helps with reducing compilation times
and makes it easier to visualise which dependencies are actually
required.

Work on https://github.com/neovim/neovim/issues/549, but doesn't close
it since this only works fully for .c files and not headers.
2022-11-15 10:30:03 +01:00
Jlll1
9d2a6cd11e
docs(treesitter): change links for eq? and set! to codeblocks (#21047) 2022-11-15 10:23:56 +01:00
zeertzjq
7439973851
vim-patch:9.0.0882: using freed memory after SpellFileMissing autocmd uses bwipe (#21060)
Problem:    Using freed memory after SpellFileMissing autocmd uses bwipe.
Solution:   Bail out if the window no longer exists.

c3d27ada14

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-15 07:58:22 +08:00
zeertzjq
2685d27cd6
vim-patch:9.0.0883: a silent mapping may cause dots on the command line (#21061)
Problem:    A silent mapping may cause dots on the command line.
Solution:   Don't show dots for completion if they are not going to be removed
            again. (closes vim/vim#11501)

698a00f55d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-15 07:23:57 +08:00
bfredl
4541c45081
Merge pull request #21054 from max397574/fix/deepcopy_vimNIL
fix(lua): make `vim.deepcopy` work with `vim.NIL`
2022-11-14 22:26:22 +01:00
Max
e15f61b1bd fix(lua): make vim.deepcopy work with vim.NIL
style: changed double quotes to single quotes

feat: add tests

fix tests
2022-11-14 21:14:27 +01:00
dundargoc
2755510f78 ci(windows): treat compiler warnings as errors
Reduce the warning level from 3 to 1 and fix all warnings.
2022-11-14 20:17:04 +01:00
Lewis Russell
f8c6718277
feat(lua-api): avoid unnecessary allocations (#19877)
Lua makes (or reuses) an internal copy of strings, so we can safely push
buf pointers onto the stack.
2022-11-14 18:04:36 +00:00
zeertzjq
3060432007
vim-patch:9.0.0878: Coverity warns for dead code (#21053)
Problem:    Coverity warns for dead code.
Solution:   Remove the dead code.

b298fe6cba

Nvim has refactored this function and does not have the dead code.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-14 23:18:25 +08:00
Lewis Russell
e8cc489acc
feat(test): add Lua forms for API methods (#20152) 2022-11-14 10:01:35 +00:00
dundargoc
5c5187c6f8
test: remove skip for 32-bit MSVC (#21030)
We don't support 32-bit windows anymore so it's not needed.
2022-11-14 16:28:30 +08:00
zeertzjq
c4fcde5063
vim-patch:8.2.4038: various code not used when features are disabled (#21049)
Problem:    Various code not used when features are disabled.
Solution:   Add #ifdefs. (Dominique Pellé, closes vim/vim#9491)

748b308eeb

N/A patches for version.c:

vim-patch:8.2.2186: Vim9: error when using 'opfunc'

Problem:    Vim9: error when using 'opfunc'.
Solution:   Do not expect a return value from 'opfunc'. (closes vim/vim#7510)

5b3d1bb0f5
2022-11-14 12:10:26 +08:00
zeertzjq
6d996f78ef
vim-patch:8.2.4001: insert complete code uses global variables
Problem:    Insert complete code uses global variables.
Solution:   Make variables local to the file and use accessor functions.
            (Yegappan Lakshmanan, closes vim/vim#9470)

d94fbfc74a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-14 11:23:33 +08:00
zeertzjq
f2695919bb
test(old): add missing lines from Vim patch 8.2.0522 (#21048) 2022-11-14 08:16:29 +08:00
zeertzjq
b433acc3c9
vim-patch:9.0.0872: code is indented more than needed (#21046)
Problem:    Code is indented more than needed.
Solution:   Return early. (Yegappan Lakshmanan, closes vim/vim#11538)

623e94e138

Only port the first change to init_history() as Nvim has refactored it.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-14 07:16:42 +08:00
dundargoc
736c36c02f
test: introduce skip() #21010
This is essentially a convenience wrapper around the `pending()`
function, similar to `skip_fragile()` but more general-purpose.

Also remove `pending_win32` function as it can be replaced by
`skip(iswin())`.
2022-11-13 05:52:19 -08:00
bfredl
0a96f18ed7
Merge pull request #21033 from bfredl/winfix
fix(ui): fix some cases of stale highlight definitions
2022-11-13 10:53:59 +01:00
bfredl
d7e7578ada fix(ui): fix some cases of stale highlight definitions
fixes #20695
2022-11-13 10:20:28 +01:00
bfredl
c4f84fc2e2
Merge pull request #20984 from notomo/fix-message-kind-on-history
fix(ui-ext): correct message kind in history before vim.ui_attach()
2022-11-13 09:53:02 +01:00
zeertzjq
9d7dc50628
vim-patch:9.0.0865: duplicate arguments are not always detected (#21036)
Problem:    Duplicate arguments are not always detected.
Solution:   Expand to full path before comparing arguments. (Nir Lichtman,
            closes vim/vim#11505, closes vim/vim#9402)

b3052aa1b5

Co-authored-by: Nir Lichtman <nir@lichtman.org>
2022-11-13 08:35:15 +08:00
zeertzjq
849394e4e2
vim-patch:9.0.0863: col() and charcol() only work for the current window (#21038)
Problem:    col() and charcol() only work for the current window.
Solution:   Add an optional winid argument. (Yegappan Lakshmanan,
            closes vim/vim#11466, closes vim/vim#11461)

4c8d2f02b3

Cherry-pick test_functions.vim change from patch 8.2.0633.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2022-11-13 08:29:05 +08:00
zeertzjq
ec449c27fd
vim-patch:9.0.0867: wildmenu redrawing code is spread out (#21035)
Problem:    Wildmenu redrawing code is spread out.
Solution:   Refactor to move code together. (closes vim/vim#11528)

d6e91385f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 08:20:00 +08:00
zeertzjq
e7ba5ba3cd
test(lua/ui_spec): fix Ctrl-C test flakiness (#21039)
Prevent Ctrl-C from flushing the command that starts the prompt.
2022-11-13 08:16:06 +08:00
zeertzjq
f516a9ced7
Merge pull request #21037 from zeertzjq/vim-8.2.4675
vim-patch:8.2.{4675,4676},9.0.0869: no error for missing expression after :elseif
2022-11-13 08:09:21 +08:00
zeertzjq
b251972580 vim-patch:9.0.0869: bogus error when string used after :elseif
Problem:    Bogus error when string used after :elseif.
Solution:   Do not consider a double quote the start of a comment.
            (closes vim/vim#11534)

28c56d5013

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:30:05 +08:00
zeertzjq
bc1dbebe1f vim-patch:8.2.4676: test fails with different error
Problem:    Test fails with different error.
Solution:   Add argument for :elseif.

292e1b9f68

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:30:05 +08:00
zeertzjq
2cb0860117 vim-patch:8.2.4675: no error for missing expression after :elseif
Problem:    No error for missing expression after :elseif. (Ernie Rael)
Solution:   Check for missing expression. (closes vim/vim#10068)

fa010cdfb1

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-13 07:21:22 +08:00
zeertzjq
47ad4c8701
vim-patch:9.0.0866: no test for what patch 8.2.2207 fixes (#21034)
Problem:    No test for what patch 8.2.2207 fixes.
Solution:   Add a test case. (closes vim/vim#11531)

f7570f2107
2022-11-13 07:06:37 +08:00
zeertzjq
7abe8ef422
vim-patch:9.0.0862: default value of 'endoffile' is wrong (#21032)
Problem:    Default value of 'endoffile' is wrong.
Solution:   The default must be 'noendoffile'.

0aad88f073

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 23:31:17 +08:00
Steven Arcangeli
b3f781ba91
fix: vim.ui.input always calls callback #21006
Followup to #20883
Related: #18144

This patch changes the behavior of the default `vim.ui.input` when the user
aborts with `<C-c>`. Currently, it produces an error message + stack and causes
`on_confirm` to not be called. With this patch, `<C-c>` will cause `on_confirm`
to be called with `nil`, the same behavior as when the user aborts with `<Esc>`.
I can think of three good reasons why the behavior should be this way:

1. Easier for the user to understand** It's not intuitive for there to be two
   ways to abort an input dialog that have _different_ outcomes. As a user,
   I would expect any action that cancels the input to leave me in the same
   state. As a plugin author, I see no value in having two possible outcomes for
   aborting the input. I have to handle both cases, but I can't think of
   a situation where I would want to treat one differently than the other.

2. Provides an API that can be overridden by other implementations** The current
   contract of "throw an error upon `<C-c>`" cannot be replicated by async
   implementations of `vim.ui.input`. If the callsite wants to handle the case
   of the user hitting `<C-c>` they need to use `pcall(vim.ui.input, ...)`,
   however an async implementation will instantly return and so there will be no
   way for it to produce the same error-throwing behavior when the user inputs
   `<C-c>`. This makes it impossible to be fully API-compatible with the
   built-in `vim.ui.input`.

3. Provides a useful guarantee to the callsite** As a plugin author, I want the
   guarantee that `on_confirm` will _always_ be called (only catastrophic errors
   should prevent this). If I am in the middle of some async thread of logic,
   I need some way to resume that logic after handing off control to
   `vim.ui.input`. The only way to handle the `<C-c>` case is with `pcall`,
   which as already mentioned, breaks down if you're using an alternative
   implementation.
2022-11-12 06:57:35 -08:00
Lewis Russell
3621c127a8
Merge pull request #20178 from vigoux/extmark-nospell
feat(extmarks): allow preventing spellchecking with spell = false
2022-11-12 13:14:21 +00:00
Lewis Russell
07eb4263ca feat(spell): support nospell in treesitter queries 2022-11-12 10:19:03 +00:00
Thomas Vigouroux
7e6d785d19 feat(extmarks): allow preventing spellchecking with spell = false 2022-11-12 10:19:01 +00:00
zeertzjq
7335a67b57
vim-patch:9.0.0845: shell command with just space gives strange error (#21029)
Problem:    Shell command with just space gives strange error.
Solution:   Skip white space at start of the argument. (Christian Brabandt,
            Shane-XB-Qian, closes vim/vim#11515, closes vim/vim#11495)

4e7590ec00

Co-authored-by: shane.xb.qian <shane.qian@foxmail.com>
2022-11-12 12:29:16 +08:00
Justin M. Keyes
4d2373f5f6
feat(checkhealth): use "help" syntax, avoid tabpage #20879
- If Nvim was just started, don't create a new tab.
- Name the buffer "health://".
- Use "help" syntax instead of "markdown". It fits better, and
  eliminates various workarounds.
- Simplfy formatting, avoid visual noise.
- Don't print a "INFO" status, it is noisy.
- Drop the ":" after statuses, they are already UPPERCASE and highlighted.
2022-11-11 18:33:31 -08:00
zeertzjq
2425fe2dc5
vim-patch:8.2.2207: illegal memory access if popup menu items are changed (#21028)
Problem:    Illegal memory access if popup menu items are changed while the
            menu is visible. (Tomáš Janoušek)
Solution:   Make a copy of the text. (closes vim/vim#7537)

38455a9213

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 09:57:29 +08:00
zeertzjq
eee9560516
vim-patch:9.0.0861: solution for "!!sort" in closed fold is not optimal (#21027)
Problem:    Solution for "!!sort" in closed fold is not optimal.
Solution:   Use a different range instead of the subtle difference in handling
            a range with an offset. (issue vim/vim#11487)

9954dc39ea

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-12 07:43:36 +08:00
zeertzjq
0d7cc5ee85
vim-patch:9.0.0715: wrong argument for append() gives two error messages (#21023)
Problem:    Wrong argument for append() gives two error messages.
Solution:   When getting an error for a number argument don't try using it as
            a string. (closes vim/vim#11335)

801cd35e7e

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 18:18:38 +08:00
zeertzjq
0d8e8d36ec
vim-patch:8.2.1919: assert_fails() setting emsg_silent changes normal execution (#20998)
Problem:    Assert_fails() setting emsg_silent changes normal execution.
Solution:   Use a separate flag in_assert_fails.

28ee892ac4

Cherry-pick no_wait_return from patch 9.0.0846.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2022-11-11 17:50:52 +08:00