Commit Graph

162 Commits

Author SHA1 Message Date
Justin M. Keyes
c34130d13a API: deprecate nvim_command_output 2019-12-02 20:52:06 -08:00
erw7
ab860cb5f6 dictwatcher: fix use-after-free #11495
fixes #11494
2019-12-02 02:09:30 -08:00
Daniel Hahler
4bbad54817
tests: fix non-controversial misuse of pending (#11247)
Ref: https://github.com/neovim/neovim/pull/11184
2019-10-18 04:46:30 +02:00
Björn Linse
4987311fb5 tests/ui: remove unnecessary screen:detach()
It is perfectly fine and expected to detach from the screen just by
the UI disconnecting from nvim or exiting nvim. Just keep detach() in
screen_basic_spec, to get some coverage of the detach method itself.

This avoids hang on failure in many situations (though one could argue
that detach() should be "fast", or at least "as fast as resize",
which works in press-return already).

Never use detach() just to change the size of the screen, try_resize()
method exists for that specifically.
2019-10-13 22:10:42 +02:00
Justin M. Keyes
3344cffe7b getdigits: introduce strict, def parameters
Problem:
During a refactor long ago, we changed the `getdigits_*` familiy of
functions to abort on overflow.  But this is often wrong, because many
of these codepaths are handling user input.

Solution:
Decide at each call-site whether to use "strict" mode.

fix #5555
2019-09-13 19:29:25 -07:00
Justin M. Keyes
7e1c959861 test: Eliminate expect_err
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
2019-09-06 17:19:07 -07:00
Daniel Hahler
6cc76194b2
tests: use runtime from build for doc/tags with :help (#10479)
This is better practice in general, and allows to remove the "helptags
ALL" hacks.

Ref: https://github.com/neovim/neovim/issues/8824
Ref: https://github.com/neovim/neovim/commit/f1b67c3453c

* Makefile: fix dependencies with regard to helptags

- use the file as the main target to avoid unnecessary triggering
- use "make oldtest" on Travis to ensure it gets built
2019-08-28 22:47:54 +02:00
Justin M. Keyes
94afc201bc test: isCI(): add "name" parameter 2019-08-05 04:02:41 +02:00
Daniel Hahler
451f6046b0
tests: AppVeyor: fix test/functional/ex_cmds/arg_spec.lua (#10598)
For unknown reasons it does not have the trailing space in `:args`
output there anymore:

    [  FAILED  ] test/functional\ex_cmds\arg_spec.lua @ 11: :argument does not restart :terminal buffer
    test/functional\ex_cmds\arg_spec.lua:25: Expected objects to be the same.
    Passed in:
    (string) '
    [term://.//4552:C:\Windows\system32\cmd.exe]'
    Expected:
    (string) '
    [term://.//4552:C:\Windows\system32\cmd.exe] '
    stack traceback:
            test/functional\ex_cmds\arg_spec.lua:25: in function <test/functional\ex_cmds\arg_spec.lua:11>

The test is not about that though, and this can be made less strict by
using `trim()`.  The new test in `test_arglist.vim` for no trailing
newline is OK, and contains trailing spaces.  So this is likely due to
the length of it exceeding the column width already.
2019-07-24 09:31:46 +02:00
Daniel Hahler
4731027447
tests: use vim.inspect (#10485)
The inspect modules is vendored as `vim.inspect`, and therefore it makes
sense to use this in tests also.

Ref: https://github.com/neovim/neovim/issues/6580
Ref: https://github.com/neovim/neovim/commit/bb3aa824b
2019-07-13 00:50:52 +02:00
Daniel Hahler
05a17e419a
tests: fix flaky ':digraphs displays digraphs' (#10406) 2019-07-04 15:22:59 +02:00
Daniel Hahler
f6298aba82
tests: shell-test: add INTERACT mode (#10405)
Use it to improve ls_spec: it should not use the user's real shell for
performance and other reasons.
2019-07-03 22:49:13 +02:00
Justin M. Keyes
2d4a37ebab
:ls : show "R", "F" for terminal-jobs #10370
This matches Vim behavior. From `:help :ls` :

    R    a terminal buffer with a running job
    F    a terminal buffer with a finished job
    ?    a terminal buffer without a job: `:terminal NONE`

TODO: implement `:terminal NONE`.

ref #10349
2019-06-29 21:03:38 +02:00
Marco Hinz
e6c21c4bc0
vim-patch:8.0.1782: no simple way to label quickfix entries
Problem:    No simple way to label quickfix entries.
Solution:   Add the "module" item, to be used instead of the file name for
            display purposes. (Martin Szamotulski)

d76ce85266
2019-05-05 13:46:19 +02:00
Justin M. Keyes
17291642bd test: clear(): args_rm parameter 2019-04-27 16:19:40 +02:00
Justin M. Keyes
82d48c0dab
Merge pull request #9896 from justinmk/api-async-error
API: emit nvim_error_event on failed async request
2019-04-13 19:53:09 +02:00
Justin M. Keyes
7e1591e06a API: emit nvim_error_event on failed async request
We already do this for _invalid_ async requests #9300.
Now we also do it for failed invocation of valid requests.
2019-04-13 17:07:58 +02:00
Marco Hinz
5f996e36d1
options: properly reset directories on 'autochdir' (#9894)
Fixes https://github.com/neovim/neovim/issues/9892
2019-04-13 12:50:36 +02:00
Marco Hinz
3e78319ac6
help: ignore snapshotted window if invalid (#9774)
Nvim doesn't expect a window-changing command on an created-window event.

    autocmd WinNew * wincmd p
    help help

- A snapshot for window 1000 is created.
- The window is split and the cursor changes to the new window 1001.
- The autocmd kicks in and switches back to 1000.
- The help buffer is opened.
- On closing the help window 1000, it tries to go back to the snapshotted window
  which is... 1000.
- wp1000->w_buffer == NULL
- w_buffer is used by check_cursor()
- 🧨 -> 💥

Fixes https://github.com/neovim/neovim/issues/9773
2019-03-23 00:23:39 +01:00
Chris LaRose
c5631338b1 :mksession : restore tab-local working directories #9754 2019-03-21 11:53:38 +01:00
demiurg337
9d207fd876 dictwatcheradd(): support b:changedtick #9693
fixes #6635
closes #9693
2019-03-14 00:38:56 +01:00
Justin M. Keyes
1a3d2dbfe7 menu_get(): fix query behavior
- Return the menu properties, not only its children.
- If the {path} param is given, return only the first node. The "next"
  nodes in the linked-list are irrelevant.
2019-01-27 00:51:58 +01:00
Justin M. Keyes
d760e08fac menu_get(): Do not include empty items
Caused by a typo: `dict` instead of `dic`. Renamed variable to `d` to
make it less similar.
2019-01-27 00:51:58 +01:00
Justin M. Keyes
827ed144fb fix ":menu Item.SubItem"
:menu should print sub-menu contents. E.g. this should print the
"File.Save" submenu:

    nvim -u NORC
    :source $VIMRUNTIME/menu.vim
    :menu File.Save

Regressed in dc685387a3
Blocks #8173

menu_get() also was missing some results for some cases.
2019-01-27 00:51:58 +01:00
Björn Linse
5a836d4767 screen: don't unconditionally clear messages on window scroll
In vim, scrolling a window might mess up the cmdline. To keep it simple,
cmdline was always cleared for any window scroll. In nvim, where safe scrolling
is implemented in the TUI layer, this problem doesn't exist.

Clearing the message on scrolling, when we not do it e.g when switching tabs
is a bit weird, as the former is a much smaller context change.

A vim patch introduced the possibility to avoid the cmdlline clear for
redraws caused by async events. This case will now trivially be covered,
as the redraw is always avoided.

vim-patch:8.0.0592: if a job writes to a buffer screen is not updated
2019-01-15 19:48:49 +01:00
raffitz
95fa71c6d2 :recover : Fix crash on non-existent *.swp #9504
Reverts d2944e6a29. mf_open() _can_ fail if the file does not exist.

closes #9503
closes #9504
2019-01-15 00:47:53 +01:00
Justin M. Keyes
b19403e73e
Merge #9291 'vim-patch:8.1.{550,551}' 2018-12-02 23:10:26 +01:00
Justin M. Keyes
0f00f31cbd VimL/confirm(): Show dialog even if :silent
closes #8788
related #9034
2018-12-01 16:06:01 +01:00
Björn Linse
2271b10a8e insert: make <cmd> mapping work in completion (CTRL-X) mode 2018-12-01 10:37:46 +01:00
Jan Edmund Lazo
471129792c fixup: 30 col resize to scroll debug 2018-12-01 01:56:22 -05:00
Jan Edmund Lazo
2479004c13 functionaltests: vim-patch:8.1.{550,551} fix 2018-11-30 23:35:36 -05:00
Reto Schnyder
bddcbbb571 signs: Add "numhl" argument #9113
close #9113
ref #9040
2018-10-13 19:39:56 +02:00
Justin M. Keyes
22c83a4de9 swapfile: Always show swap dialog (E325)
If swapfile dialog prompts for input, it must be displayed to the user.

fix #8840
fix #9027
2018-09-23 15:58:01 +02:00
Björn Linse
4da5cb38d3 startup: always wait for UI with --embed, unless --headless also is supplied 2018-09-22 10:18:28 +02:00
Björn Linse
5056d40b16 getchar: allow <SID> in <Cmd> mapping 2018-09-13 11:02:24 +02:00
Jan Edmund Lazo
95608136d5 tests: update expected output of :digraph command 2018-09-08 22:28:35 -04:00
Björn Linse
3d88287e30 tests: introduce screen:expect{...} form 2018-08-27 15:15:49 +02:00
Björn Linse
4a46ab8de9 cmdline: always use save_cmdline before command_line_enter
":normal :" might be invoked in various ways, so its safest to always
allow recursive invocation of cmdline mode
2018-08-17 10:48:48 +02:00
Justin M. Keyes
b7514493a0
defaults: shortmess+=F (#8619)
Because we default to laststatus=2 (statusline is always visible), the
:edit message is not useful.

ref #6289
2018-06-22 08:18:02 +02:00
Björn Linse
37e00c6e65 ex_getln: remove msg_scrolled cargo-cult magic, fixes #8251 2018-06-02 10:07:07 +02:00
Jan Edmund Lazo
e21f454e11 fixup: always delete Xfile, fix exit code check
after_each + os.remove ensures Xfile is deleted after every test.
Windows exit code is inconsistent.
2018-05-25 07:43:02 -04:00
Jan Edmund Lazo
05282069db win: test: close shada file before os.remove 2018-05-24 22:11:16 -04:00
Jan Edmund Lazo
64177e3e98 win: test: don't test symlink if not admin user 2018-05-24 22:11:14 -04:00
Jan Edmund Lazo
209f05b487 win: test: disable non-admin failing tests
mkfifo (msysgit) does not work outside of msys2 environment.
gzip tests fail on Windows.

mklink requires admin privs for file symbolic links so mklink fails.
2018-05-24 22:11:12 -04:00
Jakson Alves de Aquino
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
closes #2690
2018-05-01 11:33:50 +02:00
Björn Linse
98e7112390 msg: do not scroll entire screen (#8088) 2018-03-31 11:12:27 +02:00
Björn Linse
d407a48665 getchar: implement <Cmd> key to invoke command in any mode 2018-03-23 14:01:49 +01:00
Justin M. Keyes
fd4021387e test: rename next_message() to next_msg() 2018-03-11 12:43:42 +01:00
Matthieu Coudron
384a39479a 'fillchars': fix defaults logic; handle ambiwidth=double #7986
Update tests.
2018-02-23 00:48:35 +01:00
Jan Edmund Lazo
7fa69fb288 Resolve issues mentioned in PR review 2018-02-19 07:10:47 -05:00