Commit Graph

22056 Commits

Author SHA1 Message Date
Jonas Strittmatter
acb7a90281
refactor(runtime): port scripts.vim to lua (#18710) 2022-07-03 15:31:56 +02:00
zeertzjq
0313aba77a
vim-patch:9.0.0031: <mods> of user command does not have correct verbose value (#19215)
vim-patch:9.0.0031: <mods> of user command does not have correct verbose value

Problem:    <mods> of user command does not have correct verbose value.
Solution:   Use the value from the command modifier. (closes vim/vim#10651)
9359e8a6d9
2022-07-03 21:17:03 +08:00
zeertzjq
e837f29ce6
Merge pull request #19212 from zeertzjq/vim-9.0.0024
vim-patch:9.0.{0024,0030}
2022-07-03 06:43:16 +08:00
zeertzjq
357d63f5d7 vim-patch:9.0.0030: matchfuzzy test depends on path of current directory
Problem:    Matchfuzzy test depends on path of current directory.
Solution:   Use fnamemodify() to remove the path. (Robin Becker,
            closes vim/vim#10650)
22e7e867e2
2022-07-03 06:21:05 +08:00
zeertzjq
312f1b65c8 vim-patch:9.0.0024: may access part of typeahead buf that isn't filled
Problem:    May access part of typeahead buf that isn't filled.
Solution:   Check length of typeahead.
af043e12d9
2022-07-03 06:21:05 +08:00
dundargoc
2b04aaad94
build: drop -Wsuggest #19177
Disable -Wsuggest compile flags by default.

Although the flags are useful to see what the compiler thinks we can
improve on, it adds a lot of noise to the build output. That makes it
harder to spot actual issues that may be flagged.

Closes https://github.com/neovim/neovim/issues/19160
2022-07-02 14:47:22 -07:00
bfredl
c6c89391b7
Merge pull request #19205 from bfredl/luaerr
fix(lua): don't leak memory on error
2022-07-02 23:44:26 +02:00
zeertzjq
8d37901f1c
Merge pull request #19203 from zeertzjq/api-cmd-unsilent
feat(api): add `unsilent` to command APIs
2022-07-03 05:00:02 +08:00
zeertzjq
7a907c3314 feat(api): add unsilent to command APIs 2022-07-03 04:34:28 +08:00
zeertzjq
f93eb169f6 vim-patch:8.2.1900: Vim9: command modifiers do not work
Problem:    Vim9: command modifiers do not work.
Solution:   Make most command modifiers work.
02194d2bd5
2022-07-03 04:34:28 +08:00
bfredl
0160ff6aa0 fix(lua): don't leak memory on error 2022-07-02 20:10:32 +02:00
Javier Lopez
108368bdd5
fix(coverity): 353827 unnecessary null check #19209
Previous checks make sure the index is not out of bounds. Therefore jmp
is never NULL.
2022-07-02 09:24:58 -07:00
erw7
e11f3655fb
fix(jobs): deadlock in channel.c:exit_event #19082
In the rare case that exit_event is called from process_close_handles,
it stalls waiting for the process to exit (the routine is currently
underway to do just that). This causes `job_spec.lua` to sometimes
stall.

REJECTED IDEAS:
==============================================================
1. Currently `exit_event` is placed on `main_loop.fast_events`. Would the problem
   be solved by using `main_loop.events` instead?
    - A: Maybe, but it will cause other problems, such as queuing exit_event()
      during "Press Enter..." prompt which may result in the event not being
      processed, leading to another stall.
2. Can we avoid the timer?
    - A: Using a timer is just the easiest way to queue a delayed event without
      causing an infinite loop in the queue currently being processed.
3. Can we avoid the new `exit_need_delay` global...
    1. by using `process_is_tearing_down` instead?
        - A: Can't use `process_is_tearing_down` because its semantics are different.
    2. by checking a similar condition as `process_teardown`? f50135a32e/src/nvim/event/process.c (L141-L142)
       ```
       if (!process_is_tearing_down || (kl_empty(main_loop.children) && multiqueue_empty(main_loop.events))) {
         uv_timer_start(&main_loop.exit_delay_timer, exit_delay_cb, 0, 0);
         return;
       }
       ```
        - A: Tried but it did not work (other stalls occurred). Maybe
          exit_event() is called from a source other than
          process_close_handles() and is delayed, the delayed exit_event() will
          be executed before main_loop.events is processed, resulting in an
          infinite loop.
2022-07-02 09:14:08 -07:00
bfredl
c1b591dc8f
Merge pull request #19137 from dundargoc/refactor/char_u-to-char
refactor: replace char_u
2022-07-02 17:13:25 +02:00
Dundar Goc
3b8804571c refactor: replace char_u
Work on https://github.com/neovim/neovim/issues/459
2022-07-02 16:01:27 +02:00
Lewis Russell
ed429c00d7
refactor(fold): style #19175
* refactor(fold): update comment formatting
* refactor(fold): use post-increment/decrement
* refactor(fold): reduce scope of local variables
* refactor(fold): use booleans
2022-07-02 04:29:27 -07:00
Christian Clason
662681694b
vim-patch:0d878b95d8f9 (#19197)
Update runtime files
0d878b95d8
2022-07-02 11:06:03 +02:00
zeertzjq
a9de89894a
Merge pull request #19202 from zeertzjq/vim-8.2.0316
vim-patch:8.2.{0261,0316}: insufficient test coverage
2022-07-02 12:25:07 +08:00
zeertzjq
7277543772 vim-patch:8.2.0316: ex_getln.c code has insufficient test coverage
Problem:    ex_getln.c code has insufficient test coverage.
Solution:   Add more tests. Fix a problem. (Yegappan Lakshmanan, closes vim/vim#5693)
8d588ccee5
2022-07-02 11:57:53 +08:00
zeertzjq
d197e77a55 vim-patch:8.2.0261: some code not covered by tests
Problem:    Some code not covered by tests.
Solution:   Add test cases. (Yegappan Lakshmanan, closes vim/vim#5645)
f0cee1971f

Cherry-pick Test_bunload_with_offset() from patch 8.2.0243
2022-07-02 11:57:53 +08:00
zeertzjq
f71d518c90
Merge pull request #19199 from zeertzjq/vim-9.0.0017
vim-patch:9.0.{0017,0021,0022}: invalid memory access
2022-07-02 09:28:16 +08:00
Gregory Anders
5bd1bdee14
fix(mark): set mark fnum from buffer (#19195) 2022-07-01 17:20:50 -06:00
zeertzjq
d358856a0c vim-patch:9.0.0022: spell test fails
Problem:    Spell test fails.
Solution:   Expect new error is given.
95afae6d17
2022-07-02 06:55:23 +08:00
zeertzjq
998a96803b vim-patch:9.0.0021: invalid memory access when adding word to spell word list
Problem:    Invalid memory access when adding word with a control character to
            the internal spell word list.
Solution:   Disallow adding a word with control characters or a trailing
            slash.
5e59ea54c0
2022-07-02 06:55:23 +08:00
zeertzjq
0b15c01912 vim-patch:9.0.0017: accessing memory beyond the end of the line
Problem:    Accessing memory beyond the end of the line.
Solution:   Stop Visual mode when closing a window.
3d51ce18ab
2022-07-02 06:55:23 +08:00
dundargoc
9b4d0137b8
build: move lint target to cmake #19169
This will ensure less verbose output and faster linting.
2022-07-01 09:15:04 -07:00
zeertzjq
2b1abe3c9d
vim-patch:9.0.0015: with EXITFREE defined terminal menus are not cleared (#19187)
Problem:    With EXITFREE defined terminal menus are not cleared.
Solution:   Also clear terminal menus. Remove condition that is always true.
            (closes vim/vim#10641)
79ae152697
2022-07-01 21:02:59 +08:00
github-actions[bot]
6486b0345a
version.c: update [skip ci] #19179
Co-authored-by: marvim <marvim@users.noreply.github.com>
2022-07-01 03:26:42 -07:00
Christian Clason
60604d6a99
vim-patch:9.0.0012: signature files not detected properly (#19172)
Problem:    Signature files not detected properly.
Solution:   Add a function to better detect signature files. (Doug Kearns)
cdbfc6dbab
2022-07-01 07:08:44 +02:00
zeertzjq
8f5bcfb0e4
Merge pull request #19178 from zeertzjq/vim-8.2.0049
vim-patch:8.2.0049: command line completion not fully tested
2022-07-01 11:49:48 +08:00
zeertzjq
b22f7dd908 test(old): reorder test_cmdline.vim to match upstream 2022-07-01 11:17:33 +08:00
zeertzjq
300490f2e8 vim-patch:8.2.0049: command line completion not fully tested
Problem:    Command line completion not fully tested.
Solution:   Add more test cases.  Make help sorting stable. (Dominique Pelle,
            closes vim/vim#5402)
297610ba4b
2022-07-01 11:02:55 +08:00
zeertzjq
2268a4147e
Merge pull request #19170 from zeertzjq/vim-8.0.1558
vim-patch:8.0.{1558,1570,1574,1588},8.1.{0487,0695,1274}: menu features
2022-07-01 10:49:14 +08:00
zeertzjq
5a62ad605e feat(ui): make right-click menu work properly with ext_multigrid
Add tests both with and without ext_multigrid.
2022-07-01 10:28:07 +08:00
zeertzjq
236947ab20 vim-patch:8.1.1274: after :unmenu can still execute the menu with :emenu
Problem:    After :unmenu can still execute the menu with :emenu.
Solution:   Do not execute a menu that was disabled for the specified mode.
ce79353ace
2022-07-01 10:17:39 +08:00
zeertzjq
d81d8d454a vim-patch:8.1.0695: internal error when using :popup
Problem:    Internal error when using :popup.
Solution:   When a menu only exists in Terminal mode give an error. (Naruhiko
            Nishino, closes vim/vim#3765)
f42b45d719
2022-07-01 10:17:39 +08:00
zeertzjq
015778a381 vim-patch:8.1.0487: no menus specifically for the terminal window
Problem:    No menus specifically for the terminal window.
Solution:   Add :tlmenu. (Yee Cheng Chin, closes vim/vim#3439) Add a menu test.
4c5d815256

ADDR_OHTER comes from patch 8.1.1241, which has already been ported.
2022-07-01 10:17:39 +08:00
zeertzjq
5551a29d06 vim-patch:8.0.1588: popup menu hangs after typing CTRL-C
Problem:    Popup menu hangs after typing CTRL-C.
Solution:   Make CTRL-C exit the loop. (Ozaki Kiichi, closes vim/vim#2697)
52f18a112a
2022-07-01 10:17:39 +08:00
zeertzjq
e4c2ff2da4 vim-patch:8.0.1574: show cursor in wrong place when using popup menu
Problem:    Show cursor in wrong place when using popup menu. (Wei Zhang)
Solution:   Force updating the cursor position.  Fix skipping over unused
            entries.
987723e084
2022-07-01 10:17:39 +08:00
zeertzjq
610cf9f950 vim-patch:8.0.1570: can't use :popup for a menu in the terminal
Problem:    Can't use :popup for a menu in the terminal. (Wei Zhang)
Solution:   Make :popup work in the terminal.  Also fix that entries were
            included that don't work in the current state.
29a2c08d79
2022-07-01 10:17:39 +08:00
zeertzjq
cf8df141f3 vim-patch:8.0.1558: no right-click menu in a terminal
Problem:    No right-click menu in a terminal.
Solution:   Implement the right click menu for the terminal.
aef8c3da2b
2022-07-01 10:13:06 +08:00
Shougo
5a490d838e
cmdheight=0: fix bugs #18961
Continue of #16251

Fix #18953
Fix #18960
Fix #18958
Fix #18955
Fix #18970
Fix #18983
Fix #18995
Fix #19112
2022-06-30 18:59:50 -07:00
Gregory Anders
3b1423bfa7
fix(filetype): update call sites of vim.filetype.match (#19171)
These were not updated in #18895.
2022-06-30 09:54:44 -06:00
Javier Lopez
565f72b968
feat(marks): restore viewport on jump #15831
** Refactor

Previously most functions used to "get" a mark returned a position,
changed the line number and sometimes changed even the current buffer.

Now functions return a {x}fmark_T making calling context aware whether
the mark is in another buffer without arcane casting. A new function is
provided for switching to the mark buffer and returning a flag style
Enum to convey what happen in the movement. If the cursor changed, line,
columns, if it changed buffer, etc.

The function to get named mark was split into multiple functions.

- mark_get() -> fmark_T
- mark_get_global() -> xfmark_T
- mark_get_local() -> fmark_T
  - mark_get_motion() -> fmark_T
  - mark_get_visual() -> fmark_T

Functions that manage the changelist and jumplist were also modified to
return mark types.

- get_jumplist -> fmark_T
- get_changelist -> fmark_T

The refactor is also seen mainly on normal.c, where all the mark
movement has been siphoned through one function nv_gomark, while the
other functions handle getting the mark and setting their movement
flags. To handle whether context marks should be left, etc.

** Mark View

While doing the refactor the concept of a mark view was also
implemented:

The view of a mark currently implemented as the number of lines between
the mark position on creation and the window topline. This allows for
moving not only back to the position of a mark but having the window
look similar to when the mark was defined. This is done by carrying and
extra element in the fmark_T struct, which can be extended later to also
restore horizontal shift.

*** User space features

1. There's a new option, jumpoptions+=view enables the mark view restoring
automatically when using the jumplist, changelist, alternate-file and
mark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark]

** Limitations

- The view information is not saved in shada.
- Calls to get_mark should copy the value in the pointer since we are
  using pos_to_mark() to wrap and provide a homogeneous interfaces. This
  was also a limitation in the previous state of things.
2022-06-30 05:59:52 -07:00
dundargoc
cb84f5ee53
refactor(uncrustify): change config to better align with style guide (#18803)
refactor(uncrustify): change config to better align with neovim style
2022-06-30 20:27:52 +08:00
zeertzjq
69cd0ba27b
vim-patch:9.0.0011: reading beyond the end of the line with put command (#19166)
Problem:    Reading beyond the end of the line with put command.
Solution:   Adjust the end mark position.
d25f003342
2022-06-30 20:16:00 +08:00
dundargoc
37af46bb4c
feat(build): add_glob_target runs only on changed files #19070
The general idea is that add_glob_targets creates a "touch file", a
dummy file that acts as a dependency in order to check which files are
outdated since the last time the target was run.

Remove RunUncrustify.cmake as it's no longer necessary. It was initially
introduced to silence its noisy output. The per-file targets will
suppress the noisy output from uncrustify, except for the very first
run.

Also remove DefCmdTarget.cmake since add_glob_target already
incorporates its functionality.
2022-06-30 05:10:05 -07:00
Justin M. Keyes
f50135a32e
feat: stdpath('run'), /tmp/nvim.user/ #18993
Problem:
- Since c57f6b28d7 #8519, sockets are created in ~/.local/… but XDG
  spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which
  implies that XDG_STATE_DIR is potentially non-local.
- Not easy to inspect Nvim-created temp files (for debugging etc).

Solution:
- Store sockets in stdpath('run') ($XDG_RUNTIME_DIR).
- Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims.
- Make ok() actually useful.
- Introduce assert_nolog().

closes #3517
closes #17093
2022-06-30 04:16:46 -07:00
Hugo
514e76e4b2
vim-patch:9.0.0001: Travis CI is no longer used #19163
Problem:    Travis CI is no longer used.
Solution:   Delete the Travis CI configuration. (Hugo Osvaldo Barrera,
            closes vim/vim#10636)
75417d960b
2022-06-30 03:12:08 -07:00
bfredl
ba5be650a7
Merge pull request #19134 from dundargoc/refactor/conversion
refactor: enable -Wconversion warning for fileio.c
2022-06-30 11:51:07 +02:00