Commit Graph

24372 Commits

Author SHA1 Message Date
Ching Pei Yang
ef89f9fd46
docs: treesitter.add_directive, add_predicate #21206 2023-01-16 04:39:19 -08:00
Raphael
9e1d2e2ca7
build(deps): bump LuaJIT to HEAD - d0e88930d
build(deps): bump LuaJIT to HEAD-d0e88930d

 Don't fail for Clang builds, which pretend to be an ancient GCC.
 Fix compiler warning.
2023-01-16 12:10:42 +00:00
zeertzjq
e7ea156604
Merge pull request #20945 from erw7/feat-more-exception-info
feat(api): show more exception info
2023-01-16 19:28:17 +08:00
bfredl
90493beb15
Merge pull request #21831 from bfredl/nofd
fix(ui): re-organize tty fd handling and fix issues
2023-01-16 11:55:34 +01:00
Justin M. Keyes
2773685c1d
Merge #21175 exepath() with powershell 2023-01-16 05:28:56 -05:00
Justin M. Keyes
e5b9485eac test: align Test_shell_options, Test_shellslash with Nvim default
'shellxquote' Nvim default was adjusted in: 131aad953c
The use of "/s" is different than Vim, and may avoid the need for `shellxquote="&|<>()@^`.

For the other shells, Nvim intentionally does not fiddle with the
various "shell*" options if 'shell' is set by the user: if the user sets
'shell', they are expected to set other "shell*" options correctly.
2023-01-16 11:27:35 +01:00
Justin M. Keyes
7360dda670 vim-patch:8.2.3071: shell options are not set properly for PowerShell
(Most of this patch is intentionally dropped, it adds far too much
special-cases for almost zero purpose: ":help shell-powershell" makes it
easy to choose powershell without spreading special-cases throughout the
codebase, randomly changing slash behavior, etc.)

Problem:    Shell options are not set properly for PowerShell.
Solution:   Use better option defaults. (Mike Willams, closes vim/vim#8459)

127950241e

Co-authored-by: Mike Williams <mikew@globalgraphics.com>
2023-01-16 11:27:35 +01:00
Justin M. Keyes
26d6e27973 vim-patch:8.2.3070: not enough testing for shell use
Problem:    Not enough testing for shell use.
Solution:   Add a bit more testing. (Yegappan Lakshmanan, closes vim/vim#8469)

ffec6dd16a

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-16 11:27:35 +01:00
Justin M. Keyes
48144525bf vim-patch:8.2.3061: testing the shell option is incomplete and spread out
Problem:    Testing the shell option is incomplete and spread out.
Solution:   Move shell tests to one file and increase coverage. (Yegappan
            Lakshmanan, closes vim/vim#8464)

054794c20f

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-16 11:27:35 +01:00
Anton Kriese
52268afb1c fix(exepath)!: prefers extensionless for powershell
PROBLEM:
exepath("test") should prefer ".bat" when shell=powershell.
Current behavior differs from Vim 8.2.3071.

TEST CASE:
1. in a folder which is in $PATH, create files "test" "test.bat".
   - "(Get-Command test).Path test" returns "test.bat".
2. compare nvim:
     nvim --clean
     :set shell=powershell
     :echo exepath("test")
3. should returns "path\to\test.bat" (before this patch it returns "path\to\test").

SOLUTION:
After this patch, the binary files "text.exe", "test.bat", "test.com"
will be found, but the file "test" (without any extension) will not be
found (matches Vim 8.2.3071). But powershell's `where` and
`Get-Command` _do_ find the extensionless 'test' file.

But Nvim with ":set shell=cmd.exe", doesn't find "test" either (before
and after this patch), even though `where test` returns correct path in
cmd.

- `where` is a program to find files in general, not just executable files.
-`Get-Command` returning extensionless (and thus non-executable) file is
  puzzling even to Chris Dent, [PowerShell expert][1] (asked on
  Discord).

[1]: https://www.amazon.com/Mastering-PowerShell-Scripting-Automate-environment-ebook/dp/B0971MG88X

Co-authored-by: Enan Ajmain <3nan.ajmain@gmail.com>
Helped-by: erw7 <erw7.github@gmail.com>

Fixes #21045
2023-01-16 11:26:57 +01:00
bfredl
160c69b655 fix(ui): re-organize tty fd handling and fix issues
- Use the correct fd to replace stdin on windows (CONIN)
- Don't start the TUI if there are no tty fd (not a regression,
  but makes sense regardless)
- De-mythologize "global input fd". it is just STDIN.
2023-01-16 11:26:49 +01:00
dundargoc
6383e454ab
ci: run each linter once (#21825)
Running "make lintlua" will run both stylua and luacheck if both exist.
But this is not necessary as we already lint with stylua with the
stylua-action, so we only need to lint with luacheck on our own.
2023-01-16 11:11:48 +01:00
zeertzjq
61d5bd561a refactor: remove E5500, adjust tests
Now with try_end() including more exception info, E5500 looks like
redundant information.
Adjust tests for more exception information.
2023-01-16 18:03:08 +08:00
erw7
ce66f158b5 feat(api): show more exception info 2023-01-16 17:58:57 +08:00
TJ DeVries
307efe4906
health: migrate to Lua #21661
* refactor: remove all vimscript from nvim/health
* fixup: previous method broke if you had a folder named 'x-lua'
2023-01-16 01:55:24 -08:00
zeertzjq
8a5dad44a7
docs(news): graduation of msgsep #21826 2023-01-16 01:44:20 -08:00
0xAdk
be3d30cace
fix(diff): "nvim -d" should only diff arglist files #21829
Co-authored-by: 0xadk <0xadk@users.noreply.github.com>
2023-01-16 01:37:58 -08:00
Naru
34b973b1d9
docs(lua): use luaref tag instead of www.lua.org #21813 2023-01-15 13:32:23 -08:00
dundargoc
69c71c4ab4
build: exclude tui/terminfo_defs.h from lintc-clint (#21822)
clint takes around 5-10 seconds to lint tui/terminfo_defs.h. For CI this
is negligible, but it's annoying for local development as touching
terminfo_defs.h will skyrocket lint times. Furthermore, we have no
reason to touch or modify terminfo_defs.h as it's a generated file, so
linting it shouldn't be necessary. This should speed up "make lint" by
the same amount, so around 5-10 seconds.
2023-01-15 19:30:17 +01:00
dundargoc
c752c85363
refactor: format with stylua (#21821) 2023-01-15 16:00:23 +01:00
dundargoc
3269902a13
refactor: fix IWYU mapping file and use IWYU (#21802)
Also add the EXITFREE definition to main_lib rather than the nvim target, as the header generation needs the EXITFREE flag to work properly.
2023-01-15 14:16:33 +01:00
bfredl
43feb973e3
Merge pull request #21731 from tk-shirasaka/fix/builtin_popup_on_ext_popupmenu
fix: properly close builtin popup in ext_popupmenu
2023-01-15 13:40:55 +01:00
dundargoc
909abfbd87
ci: deduplicate TEST_FILE environment variable (#21667) 2023-01-15 12:25:28 +01:00
Naru
6f0234a5e5
docs(lua): lua-guide: <Nop> is for rhs of vim.keymap.set(), not lhs (#21814) 2023-01-15 12:08:03 +01:00
zeertzjq
6134c1e8a3
test(fileio_spec): avoid expect_exit() without calling clear() (#21810)
Since before_each() doesn't call clear() in these tests, after_each()
may call expect_exit() without calling clear() if a test is skipped,
causing frequent test failures on Cirrus CI. Close the session instead.
2023-01-15 09:34:21 +08:00
zeertzjq
2f32b19967
vim-patch:8.2.0188: Check commands don't work well with Vim9 script (#21809)
Problem:    Check commands don't work well with Vim9 script.
Solution:   Improve constant expression handling.

7f829cab35

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 09:08:51 +08:00
zeertzjq
9dd5903273
Merge pull request #21806 from zeertzjq/vim-8.2.4565
vim-patch:8.2.{4563,4565,4570}: cmdline completion for :breakadd, :breakdel, :profdel
2023-01-15 08:38:23 +08:00
zeertzjq
064fdad98c vim-patch:8.2.4570: no command line completion for :profile and :profdel
Problem:    No command line completion for :profile and :profdel.
Solution:   Implement completion. (Yegappan Lakshmanan, closes vim/vim#9955)

1fdf84e033

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:59:45 +08:00
zeertzjq
f2056e4045 vim-patch:8.2.4565: no command line completion for :breakadd and :breakdel
Problem:    No command line completion for :breakadd and :breakdel.
Solution:   Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan,
            closes vim/vim#9950)

6e2e2cc95b
2023-01-15 07:59:45 +08:00
zeertzjq
89f45dc155 vim-patch:8.2.4563: "z=" in Visual mode may go beyond the end of the line
Problem:    "z=" in Visual mode may go beyond the end of the line.
Solution:   Adjust "badlen".

5c68617d39

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 07:59:45 +08:00
zeertzjq
fe17cd50fb
Merge pull request #21807 from zeertzjq/vim-8.2.4579
vim-patch:8.2.{4481,4579,4585}: PageUp/PageDown for cmdline pum
2023-01-15 07:59:24 +08:00
zeertzjq
940643aa33 vim-patch:8.2.4585: cannot use keypad page-up/down for completion menu
Problem:    Cannot use keypad page-up/down for completion menu.
Solution:   Recognize the keypad keys. (Yegappan Lakshmanan, closes vim/vim#9963)

155b088208

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:36:58 +08:00
zeertzjq
066a1a069b vim-patch:8.2.4579: cannot use page-up and page-down in the cmdline popup menu
Problem:    Cannot use page-up and page-down in the command line completion
            popup menu.
Solution:   Check for to page-up and page-down keys. (Yegappan Lakshmanan,
            closes vim/vim#9960)

5cffa8df7e

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 07:36:58 +08:00
zeertzjq
44710a91d0 vim-patch:8.2.4481: cmdline popup menu not removed when 'lazyredraw' is set
Problem:    Cmdline popup menu not removed when 'lazyredraw' is set.
Solution:   Temporarily reset 'lazyredraw' when removing the popup menu.
            (closes vim/vim#9857)

5c52be40fb

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-15 07:00:53 +08:00
zeertzjq
4c8d707a5e
vim-patch:9.0.0876: code is indented more than needed (#21805)
Problem:    Code is indented more than needed.
Solution:   Split ExpandEscape() in two. (Yegappan Lakshmanan, closes vim/vim#11539)

68353e5270

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-15 06:34:45 +08:00
zeertzjq
f445096cc6
vim-patch:9.0.1043: macro has confusing name and is duplicated (#21801)
Problem:    Macro has confusing name and is duplicated.
Solution:   Use one macro with an understandable name. (closes vim/vim#11686)

c51a376265
2023-01-15 05:27:55 +08:00
zeertzjq
7af2c52ef0
docs: builtin TUI is no longer channel 0 (#21794) 2023-01-15 05:24:19 +08:00
zeertzjq
8b86cb8f5b
vim-patch:8.2.4406: expand functions use confusing argument names (#21800)
Problem:    Expand functions use confusing argument names.
Solution:   Rename "file" to "match".  Refactor some completion code.  Add a
            few more tests. (Yegappan Lakshmanan, closes vim/vim#9790)

2438430863

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 23:44:38 +08:00
dundargoc
c1fffc42fb
build: enable iwyu with target properties instead of variables (#21797)
IWYU stopped working after 438b4361cc,
likely due to the code being moved from CMakeLists.txt to
src/nvim/CMakelists.txt. Using the IWYU target property instead of the
variable ensures that the information to use IWYU isn't lost.
2023-01-14 15:37:31 +01:00
zeertzjq
686168c648
vim-patch:8.2.4398: some command completion functions are too long (#21799)
Problem:    Some command completion functions are too long.
Solution:   Refactor code into separate functions.  Add a few more tests.
            (Yegappan Lakshmanan, closes vim/vim#9785)

b31aec3b93

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 22:28:21 +08:00
zeertzjq
2065ce877e
vim-patch:partial:9.0.1196: code is indented more than necessary (#21796)
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes vim/vim#11813)

e857598896

Partial port as this depends on some previous eval and 'smoothscroll'
patches.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 21:36:15 +08:00
zeertzjq
d549734fb4
Merge pull request #21795 from zeertzjq/vim-8.2.4346
vim-patch:8.2.{4346,4382,4391},9.0.1195

N/A patches for version.c:

vim-patch:9.0.1197: dump file missing from patch

Problem:    Dump file missing from patch.
Solution:   Add missing dump file.

034c350207
2023-01-14 20:50:53 +08:00
zeertzjq
d98e4e4b2e vim-patch:9.0.1195: restoring KeyTyped when building statusline not tested
Problem:    Restoring KeyTyped when building statusline not tested.
Solution:   Add a test.  Clean up and fix other tests. (closes vim/vim#11815)

378e6c03f9
2023-01-14 20:27:40 +08:00
zeertzjq
f95ad61a89 vim-patch:8.2.4391: command line executed when typing Esc in the GUI
Problem:    Command line executed when typing Esc in the GUI.
Solution:   Move saving/restoring KeyTyped to build_stl_str_hl().
            (closes vim/vim#9783)

0e1f36fc59

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
zeertzjq
81473c8ab2 vim-patch:8.2.4382: a custom 'tabline' may cause Esc to work like Enter
Problem:    A custom 'tabline' may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes vim/vim#9776)

e4835bf340

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
zeertzjq
ef77598bfb vim-patch:8.2.4346: a custom statusline may cause Esc to work like Enter
Problem:    A custom statusline may cause Esc to work like Enter on the
            command line when the popup menu is displayed.
Solution:   Save and restore KeyTyped. (closes vim/vim#9749)

481acb1141

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 20:09:56 +08:00
bfredl
bf08390442
Merge pull request #21793 from bfredl/noringbuf
fix(rbuffer): handle edge case where write_ptr has wrapped around too early
2023-01-14 13:06:22 +01:00
bfredl
8ebdb97ea7 fix(rbuffer): handle edge case where write_ptr has wrapped around
when using the rbuffer as a linear buffer, exactly filling the buffer
will case write_ptr to wrap around too early. For now detect this
special case.

Of course, the rbuffer should refactored to a proper ring buffer where
write_pos >= read_pos always and there is no special case for full
buffers. This will be a follow up change.
2023-01-14 11:53:47 +01:00
zeertzjq
d1183b48ad
vim-patch:8.2.4341: command line not redrawn when finishing popup menu (#21792)
Problem:    Command line not redrawn when finishing popup menu and the screen
            has scrolled up.
Solution:   Redraw the command line after updating the screen. (closes vim/vim#9722)

414acd342f

Code change is N/A as Nvim doesn't call update_screen() here.

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-01-14 18:36:59 +08:00
zeertzjq
22e3b155f4
vim-patch:partial:8.2.4339: CTRL-A does not work properly with the cmdline popup menu (#21791)
Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Only port cmdexpand.c and test_cmdline.vim changes.

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2023-01-14 17:23:24 +08:00