Commit Graph

9808 Commits

Author SHA1 Message Date
Justin M. Keyes
9ada97a810 gen_api_vimdoc.py: require "nvim_" prefix
Avoids doxygen bugs (things that aren't functions) and other noise (e.g.
`remote_ui_disconnect()` was incorrectly included in api.txt).
2017-12-10 17:13:22 +01:00
Justin M. Keyes
dc232b74fb doc: hack to avoid doxygen bug
Use `@cond <something>` to obscure a section from doxygen.

doxygen thinks kvec_withinit_t() is a function. That adds noise to the
generated API documentation, and also prevents the following function
from being noticed.
2017-12-10 17:13:22 +01:00
glacambre
abe38f7d26 window.c: do BufEnter in correct window after closing help #7431
closes #7429

Problem: after a help window was closed, a window was selected and its
autocommands triggered. After that, restore_snapshot was called and the
focused window changed, confusing the user.

Solution: Add function get_snapshot_focus() that returns the window that
holds the cursor in a snapshot. Use this function in win_close to make
sure the right window is selected before any autocommand is triggered.
2017-12-10 14:55:59 +01:00
Jan Edmund Lazo
4a5bc6275d ci: run oldtests in Appveyor #7705 2017-12-10 02:45:41 +01:00
Justin M. Keyes
3cc7ebf810 Merge #7234 'built-in expression parser' 2017-12-09 18:47:34 +01:00
Jan Edmund Lazo
afae4b5141 ci: Install neovim gem in Appveyor (#7700)
ref #7655
2017-12-07 10:21:03 +01:00
Justin M. Keyes
a58c9094db
Merge #7676 from florolf/atomic-unibilium
closes #7381
2017-12-06 20:51:24 +01:00
Björn Linse
873af01245
Merge pull request #7692 from bfredl/wildcmd
ui: fix glitch with both ext_cmdline and cmd_wildmenu
2017-12-06 19:19:05 +01:00
Justin M. Keyes
b6c268b32a
build: de-parallelize luarocks dependencies (#7697)
ref 6647f3c047
closes #7535
2017-12-06 14:14:07 +01:00
Justin M. Keyes
5cbd3b383c tui: ignore st terminfo cursor shape (Se, Ss) entries
closes #7641
2017-12-06 11:03:43 +01:00
Björn Linse
ba7d6a9e6b ui: fix glitch with both ext_cmdline and cmd_wildmenu 2017-12-06 09:41:51 +01:00
Florian Larysch
54087d80f3 tui: always hide cursor when flushing
The previous commit ensures that we can never flush the buffer in a
state where toggling cursor visibility can corrupt other escape codes.
Thus, we can remove the workaround added as part of e838452, simplyfing
the code and hiding the cursor on more occasions.
2017-12-05 21:40:37 +01:00
Florian Larysch
90dd2b1473 tui: never flush buffers in midst of unibilium output
e83845285 fixed an issue where long (true color) escape sequences got
interrupted by the cursor visibility toggling caused by buffer flushes.

cdfaecb25 introduces a new issue which causes similar problems: While
the old buffer flushing code appended the cursor visibility escapes to
the buffer before/after flushing, the new code effectively prepends the
sequences.

Assume the following sequence of events occurs:

 - A long escape code is issued using unibi_out when the buffer is
   almost full
 - out() gets called for a prefix of that escape code, causing the
   buffer to fill up
 - flush_buf(ui, false) is called and (correctly) does not insert any
   cursor toggling escapes
 - The rest of the escape code is written into the now empty buffer
 - At some later point, some other part of nvim calls flush_buf(ui,
   true), which then toggles the cursor, corrupting the escape code

This could possibly also be fixed by tracking the state of the buffer
(i.e. does it contain a partially output escape code?), but this seems
fragile in the same way e83845285 turned out to be.

The root cause for all these problems is the mismatch between nvim's
(implicit) assumption that the buffer is flushable at any point in time
and the non-atomicity of unibilium's character based callback interface.
The proper fix (without modifying unibilium) is to ensure nvim's
assumption about the buffer state holds at all times.

To that end, add a "cork" flag which ensures one unibi_out-call never
splits its output across a buffer flush; if an escape code does not fit
into the current buffer, flush it without any part of the escape code in
it and insert the whole escape code in the emptied buffer. This is a
little more complex because it modifies the buffer in place rather than
printing into another buffer, checking the remaining space in the
terminal buffer and then memcpy'ing it.
2017-12-05 21:40:37 +01:00
Björn Linse
9714b9f590 tests: cleanup ui/cmdline_spec.lua 2017-12-05 13:32:02 +01:00
Justin M. Keyes
aec81f44d1
Merge #7477 from FlorianGit/empty-lists-dicts-strings 2017-12-05 03:33:01 +01:00
Justin M. Keyes
67848c0b91
Merge #7653 from justinmk/tui-termcap 2017-12-05 02:42:10 +01:00
Justin M. Keyes
2d4abc1cae tui: flush -V3 ('verbose' >= 3) info ASAP 2017-12-05 01:46:41 +01:00
Justin M. Keyes
837100fcb1 test/tui: -V3log logs terminfo values 2017-12-05 01:46:41 +01:00
Justin M. Keyes
5f288220f9 test: write_file(): support append-mode 2017-12-05 01:46:41 +01:00
Justin M. Keyes
7f386b175c test: retry(): fix time calculation
libuv caches the results of uv.now() until the next loop tick. If a test
does not spin the libuv event loop, retry() enters an infinite cycle.
2017-12-05 01:46:40 +01:00
Justin M. Keyes
175174597d test: macOS 10.13: unibilium cannot find "xterm" terminfo
On some macOS versions we can't find the terminfo for whatever reason,
so just skip the test if it fails.
2017-12-05 01:46:40 +01:00
Justin M. Keyes
a11751eae8 test: tui_spec: narrower scope for timeout tweaks 2017-12-05 01:46:40 +01:00
Justin M. Keyes
1cae99b4bf msg_outtrans_special(): handle NULL
This is convenient for terminfo_info_msg().
2017-12-05 01:46:40 +01:00
Justin M. Keyes
5de1eae4f2 msg_outtrans_special(): const some strings 2017-12-05 01:46:40 +01:00
Justin M. Keyes
586dafee2f str2specialbuf(): fix comparison
regression by 832c158a66
2017-12-05 01:46:39 +01:00
Justin M. Keyes
9d689d639d tui: set descriptions on termcap extensions 2017-12-05 01:46:39 +01:00
Justin M. Keyes
3aa24042a8 tui: dump termcap info if -V3 ('verbose' >= 3)
Get terminal debugging info by starting Nvim with 'verbose' level 3:

    nvim -V3log

This is like Vim's `:set termcap`, which was removed in Nvim (and would
be very awkward to restore because of the decoupled UI).
2017-12-05 01:45:39 +01:00
James McCoy
a494c99918
Merge pull request #7683 from fszymanski/master
Fix job_control doc
2017-12-03 15:07:54 -05:00
Filip Szymański
e9990b43c2
Fix job_control doc 2017-12-03 20:49:01 +01:00
ZyX
fbdc3ac4ef tests: Fix linter errors 2017-12-03 20:22:09 +03:00
FlorianGit
d763d2fe7a Viml: Make filter and map handle null list correct
filter('v:_null_list, 'v:val') should return v:_null_list and a similar
statement should hold for map.

Changes after review

 * Test inserted in legacy test suite has been removed by reverting the commit
adding it.
 * Change the fix to tv_copy the argument before returning.
 * Readd the two tests on crashes, and modified their expected return value.
 * Move the test from 'incorrect behaviour' section to 'correct behaviour section'
 * Add analogous tests for v:_null_dict

Always copy list or dictionary to return variable

If the type of input is correct (i.e. either a list or a dictionary), this
should also be returned.
2017-12-03 17:03:31 +01:00
ZyX
6bc54832ef Revert "fix! set lsan options"
This reverts commit 6299332349.
2017-12-03 16:53:29 +03:00
ZyX
7af8601db4 Merge branch 'master' into expression-parser
Hoping that could fix the LSAN issue: no idea what it is talking about.
2017-12-03 16:19:40 +03:00
Felipe Morales
27a577586e
Merge pull request #7666 from wsdjeg/patch-1
Fix example in job_control doc
2017-12-02 20:34:31 +01:00
KunMing Xie
44421a22c0 vim-patch:8.0.0306 (#7675)
Problem:    mode() not sufficiently tested.
Solution:   Add more tests. (Yegappan Lakshmanan)

e971df39a5
2017-12-02 17:25:50 +01:00
Justin M. Keyes
ad32307e3b
Merge #7672 from ckelsel/vim-8.0.0298 2017-12-02 17:20:05 +01:00
KunMing Xie
7a4c9dc1c2 vim-patch:8.0.0295 (#7671)
Problem:    test_viml hangs.
Solution:   Put resetting 'more' before sourcing the script.

7a073549a3
2017-12-02 17:14:18 +01:00
Justin M. Keyes
4b83f37912 tui.c: request focus-reporting (fix regression) #7670
ref #7649
ref #7664

27f9b1c7b0 caused a regression: it uses loop_schedule_deferred() to
defer emitting the "enable focus reporting" termcode. tui_main() never
processes `tui_loop.events` (which loop_schedule_deferred() depends on),
so the event was never actually processed.

But fixing that (by processing `tui_loop.events`) would bring back the
problem 27f9b1c7b0 tried to fix: it still emits the event too soon.

Instead, do a little dance: schedule the event on `main_loop` and then
forward it to `tui_loop`.

NOTE: after this commit, in tmux 2.3 with `focus-events` enabled,
FocusGained is fired on startup and when resuming from suspend.

Using `script` to record the terminal session (and `vterm-dump` to
post-process the result):

BEFORE:
    {DECSM 1049}{DECSM 1}{ESC =}
    {CUP *}{ED *}{DECSM 2004}{DECSM 1004}{CSI 1,43 r}
    {CUP 1,1}
    {CUP *}{ED *}{SM 34}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED *}{LF}
    {SGR *}{LS1}{SGR 94}~
    ...

AFTER:
    {CUP *}{ED *}{CSI 1,43 r}
    {CUP 1,1}
    {CUP *}{ED *}{SM 34}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED *}{DECSM 2004}{DECSM 1004}{LF}
    {SGR *}{LS1}{SGR 94}~
    ...
2017-12-02 15:55:09 +01:00
ckelsel
7ab36403e1 fix lint error 2017-12-02 15:45:19 +08:00
ckelsel
585d664b7b vim-patch:8.0.0298
Problem:    Ex command range with repeated search does not work. (Bruce
            DeVisser)
Solution:   Skip over \/, \? and \&.

cbf20fbcd3
2017-12-02 15:40:57 +08:00
Wang Shidong
ee2e6d1d1a
Fix type in job_control doc 2017-12-01 06:40:03 -06:00
Justin M. Keyes
27f9b1c7b0
tui: emit some termcodes later (after startup) (#7664)
For some reason, enabling focus reporting during terminal setup, causes
slow rendering during Nvim startup on tmux 2.3 with the tmux
`focus-events` option enabled.

To workaround that issue, this commit defers the request.

closes #7649

init.vim:
    call plug#begin('~/.config/nvim/plugged')
    Plug 'morhetz/gruvbox'
    call plug#end()
    set background=light " background light just to see the effect more quickly
    colorscheme gruvbox
.tmux.conf:
    set -g focus-events on
    set-option -ga terminal-overrides ",xterm-256color:Tc"
    set-option -g default-terminal "screen-256color"

Using `script` to record the terminal session (and `vterm-dump` to
post-process the result):

BEFORE this commit:
    ./build/bin/nvim -u NONE{CR}{LF}
    {DECSM 1049}{DECSM 1}{ESC =}
    {CUP *}{ED 2}{DECSM 2004}{DECSM 1004}{CSI 8,44,156 t}{CSI * r}
    {CUP 1,1}
    {CUP *}{ED 2}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED 2}{LF}
    {ESC (B}{SGR *}{SGR 94}~                                                                                                                                                           {CR}{LF}
    ~                                                                                                                                                           {CR}{LF}

AFTER this commit:
    ./build/bin/nvim -u NONE{CR}{LF}
    {DECSM 1049}{DECSM 1}{ESC =}
    {CUP *}{ED 2}{CSI 8,44,156 t}{CSI * r}
    {CUP 1,1}
    {CUP *}{ED 2}{DECSM 2004}{DECSM 1004}{DECSM 25}
    {DECRM 25}{CSI 2   q}{CSI 2   q}
    {CUP *}{ED 2}{LF}
    {ESC (B}{SGR *}{SGR 94}~                                                                                                                                                           {CR}{LF}
    ~                                                                                                                                                           {CR}{LF}
    ...
2017-12-01 04:18:34 +01:00
Justin M. Keyes
3d0ee17c91 tui/rxvt: enable focus-reporting
closes #7578
2017-12-01 04:12:59 +01:00
ZyX
6299332349 fix! set lsan options 2017-12-01 00:34:16 +03:00
ZyX
5ab0f988ca *: Replace all occurrences of NVim with Nvim 2017-11-30 11:53:25 +03:00
ZyX
0b4054e043 unittests: Reduce memory used by vim_str2nr test 2017-11-30 11:48:23 +03:00
James McCoy
10c3b206cb
version.c: Mark 8.0.0171 as NA
[ci skip]
2017-11-29 20:43:07 -05:00
ZyX
b588ccddd7 Merge branch 'master' into expression-parser 2017-11-30 02:02:55 +03:00
ZyX
de45ec0146 keymap: Do not use vim_isIDc in keymap.c
Note: there are three changes to ascii_isident. Reverting first two (in 
find_special_key and first in get_special_key_code) normally fails the new test 
with empty &isident, but reverting the third does not. Hence adding `>` to 
&isident.

Ref vim/vim#2389.
2017-11-30 02:01:49 +03:00
Justin M. Keyes
4618c9c43b Revert "tui: update cleared area only if non-default bg"
Reverts 0b93bab6c2. This change was
counter-productive to the other changes which intended to reduce the
role of BCE.

ref #7624
2017-11-29 23:51:48 +01:00