Commit Graph

11215 Commits

Author SHA1 Message Date
Björn Linse
1adb01c120 ui: use line-based rather than char-based updates in screen.c
Add ext_newgrid and ext_hlstate extensions. These use predefined
highlights and line-segment based updates, for efficiency and
simplicity.. The ext_hlstate extension in addition allows semantic
identification of builtin and syntax highlights.

Reimplement the old char-based updates in the remote UI layer, for
compatibility. For the moment, this is still the default. The bulitin
TUI uses the new line-based protocol.

cmdline uses curwin cursor position when ext_cmdline is active.
2018-07-21 13:21:58 +02:00
Björn Linse
2134396074 ui: add TODO for non-working terminal linewrap
Note: this has not been working since the TUI reimplementation
2018-07-21 13:20:38 +02:00
Björn Linse
989b585e10 highlight: refactor to use stateful representation
This allows us to keep track of the source higlight groups,
and not only the final combined highlights.
2018-07-21 13:20:37 +02:00
Björn Linse
696e24f311 highlight: extract low-level highlight logic from syntax, ui 2018-07-21 10:37:44 +02:00
Justin M. Keyes
5ff90a100a
Merge #8761 from janlazo/vim-8.0.1503 2018-07-20 03:56:13 +02:00
Justin M. Keyes
f5d7123f6c version bump 2018-07-19 21:53:21 +02:00
Jan Edmund Lazo
588e86bda6 hardcopy: refactor mch_print_text_out()
Combine variable declaration and initialization to add const.
2018-07-19 12:33:05 -04:00
Jan Edmund Lazo
8441af37d8 vim-patch:8.1.0056: crash when using :hardcopy with illegal byte
Problem:    Crash when using :hardcopy with illegal byte.
Solution:   Check for string_convert() returning NULL. (Dominique Pelle)
43dee181f5
2018-07-19 12:21:14 -04:00
Jan Edmund Lazo
2ea619c10b vim-patch:8.0.1503: access memory beyond end of string
Problem:    Access memory beyond end of string. (Coverity)
Solution:   Keep allocated memory in separate pointer.  Avoid outputting the
            NUL character.
cdd09aa51a
2018-07-18 21:20:11 -04:00
Justin M. Keyes
489d32f2b8
startup: fix ":if 0|syntax on|endif" bug (#8731)
Problem: ":if 0|syntax {on,off}|endif" skips the default of "syntax on"
because the executor was setting the `did_syntax_onoff` flag even though
"syntax {on,off}" is not actually executed.

closes #8728
2018-07-18 14:30:11 +02:00
Justin M. Keyes
cd94dd6bb2 NVIM v0.3.1
FEATURES:
07499a842b #8709 man.vim: C highlighting for EXAMPLES section
07f82ad1be #8699 TUI: urxvt: also send xterm focus-reporting seqs
40911e435e #8616 API: emit nvim_buf_lines_event from :terminal
c46997aa87 #8546 fillchars: Add "eob" flag

FIXES:
74d19f685f #8576 startup: avoid blank stdin buffer if other files were opened
4874214139 #8737 Only waitpid() for processes that we care about
cd6e7e8cf3 #8743 Check all child processes for exit in SIGCHLD handler
c230ef24a2 #8746 channel.c: Prevent channel_destroy_early() from freeing uninitialized rpc stuff
0ed8b12a07 #8681 transstr_buf: fix length comparison
d241f278d3 #8708 TUI: Fix standout mode
9afed40ea6 #8698 man.vim: fix for mandoc
e889640048 #8682 provider/node: npm --loglevel silent
1cbc830189 #8613 API: nvim_win_set_cursor: set curswant
bf6048e81d #8628 checkhealth: Python: fix VIRTUAL_ENV check
3cc3506965 #8528 checkhealth: node.js: also search yarn

CHANGES:
b7514493a0 #8619 defaults: shortmess+=F
12481781a0 #8578 highlight: high-priority CursorLine if fg is set.
01570f1ff3 #8726 terminal: handle &confirm and :confirm on unloading
56065bbdc6 #8721 screen: truncate showmode messages
bf2460e2f9 #7551 buffer: fix copying :setlocal options
c1c14faad9 #8520 Ex mode: always "improved" (gQ)
050f3975f6 #7992 options: remove 'maxcombine` option (always 6)

INTERNAL:
463da84806 #7992 screen: use UTF-8 representation
2018-07-18 13:44:59 +02:00
Justin M. Keyes
44b4f8c6e9
Merge #8679 from justinmk/doc 2018-07-18 13:42:07 +02:00
Justin M. Keyes
0615450688 gen_api_vimdoc.py: add whitespace before "~" 2018-07-18 13:38:06 +02:00
Justin M. Keyes
1999919c31 doc 2018-07-18 13:38:06 +02:00
James McCoy
cd6e7e8cf3
Merge pull request #8743 from dimbleby/multiple-children
Check all child processes for exit in SIGCHLD handler
2018-07-16 10:26:24 -04:00
Björn Linse
dfe79b67a5
Merge pull request #8651 from MichaHoffmann/feature_refactor_channel
channel.c: refactor spaghetti code
2018-07-15 19:55:53 +02:00
Björn Linse
c230ef24a2
Merge pull request #8746 from oni-link/fix.rpcstart2
Fix crash in channel_job_start() in combination with rpc and unknown command
2018-07-15 19:48:40 +02:00
micha
099718ae6d dispatch.c: changed api_set_error_call 2018-07-15 12:12:03 +02:00
oni-link
c180741189 channel.c: Prevent channel_destroy_early() from freeing uninitialized rpc stuff
Without this patch the following commands would crash:
    :call rpcstart('unknown_command')

    :set sh=unknown_command
    :call jobstart('ls',{'rpc':1})
2018-07-15 09:30:47 +02:00
David Hotham
dee2bf7b52 Check all child processes for exit in SIGCHLD handler
If a second and third child exit while we are already in the handler, we
will only see a single additional SIGCHLD.  Therefore the handler must
not stop after processing a single child but should check all children.

Fixes #8740
2018-07-14 14:18:34 +01:00
micha
ed02278e42 channel.c: refactor spaghetti code
channel.c: WIP remove redundant method check and added FUNC_ATTR_NONNULL_ALL macro

channel.c channel_defs.h helpers.c: added Error field to RequestEvent, added no_op handler func

channel.c: use const char* instead of string and cleanup

channel.c; channel_defs.h; helpers.c: removed error from event again; send errors directly to the channel without using handlers and events

channel.c: fixed memory leak and lint errors

api/private/dispatch.c; api/vim.c; msgpack_rpc/channel.c msgpack_rpc/helpers.c added Error* field to msgpack_get_handler_for; further refactored channel.c

channel.c:323 changed order of evaluation in if statement

channel.c: removed superflous whitespace

dispatch.c: review comment
2018-07-14 11:47:18 +02:00
James McCoy
4874214139
Merge pull request #8737 from dimbleby/overly-general-waitpid
Only waitpid() for processes that we care about
2018-07-13 19:59:09 -04:00
David Hotham
fe913d7838 Only waitpid() for processes that we care about
It seems as though in an AppImage there's an extra child process that
dies at some early point, before we have set up a SIGCHLD handler.  So
when we later get a SIGCHLD from a child that we do care about,
waitpid(-1, ...) tells us about the extra child - and we don't notice
that the interesting child has exited.

Or something like that!

See also:

* https://patchwork.kernel.org/patch/9949491/ in which perf hit
something similar
* discussion at the AppImage repository:
https://github.com/AppImage/AppImageKit/issues/812#issuecomment-404662110.

Fix is to be explicit about which process we are waitpid()'ing for, so
we never need be distracted by children that we don't know about.

Fixes #8104
2018-07-13 20:56:04 +01:00
Jan Edmund Lazo
392817c2da vim-patch:8.0.0630: it is not easy to work on lines without a match (#8734)
Problem:    The :global command does not work recursively, which makes it
            difficult to execute a command on a line where one pattern matches
            and another does not match. (Miles Cranmer)
Solution:   Allow for recursion if it is for only one line. (closes vim/vim#1760)
f84b122a99
2018-07-13 21:14:46 +02:00
Justin M. Keyes
fc45c97829 Merge #8736 'vim-patch:8.0.0697: stable keymap.h' 2018-07-13 20:54:52 +02:00
Jan Edmund Lazo
eaf54132f9 keymap: add commented events to match 8.0.0697
KE_MOUSEMOVE, KE_CANCEL are added in later patches.
2018-07-13 11:43:05 -04:00
Jan Edmund Lazo
175297a23a tests: <SNR> is represented as 'R' (ASCII) 2018-07-12 20:26:54 -04:00
Marco Hinz
01570f1ff3
terminal: handle &confirm and :confirm on unloading (#8726)
Show a proper confirmation dialog when trying to unload a terminal buffer while
the confirm option is set or when :confirm is used.

Fixes https://github.com/neovim/neovim/issues/4651
2018-07-12 14:57:20 +02:00
Björn Linse
56065bbdc6
Merge pull request #8721 from bfredl/quickresize
Fix redrawing issues with narrow screen and remove extra wait in resize tests
2018-07-12 12:21:11 +02:00
Björn Linse
e51bffefa5 screen: truncate showmode messages
Before this, bottom of screen got messed up when modemsg (+ one extra
space to not force terminal scroll) didn't fit on one line.
2018-07-12 10:27:23 +02:00
Jan Edmund Lazo
798f05876c vim-patch:8.0.0{474,475,492,633,1251} (#8725)
* vim-patch:8.0.0474: the client-server feature is not tested

Problem:    The client-server feature is not tested.
Solution:   Add a test.
15bf76d40b

* vim-patch:8.0.0475: not enough testing for the client-server feature

Problem:    Not enough testing for the client-server feature.
Solution:   Add more tests.  Add the remote_startserver() function.  Fix that
            a locally evaluated expression uses function-local variables.
7416f3e73a

* vim-patch:8.0.0492: a failing client-server request can make Vim hang

Problem:    A failing client-server request can make Vim hang.
Solution:   Add a timeout argument to functions that wait.
81b9d0bd5c

Include src/nvim/testdir/test_clientserver.vim changes from
patches 8.0.0477, 8.0.0479.

* vim-patch:8.0.0633: the client-server test is still a bit flaky

Problem:    The client-server test is still a bit flaky.
Solution:   Wait a bit for the GUI to start.  Check that the version number
            can be obtained.
60964f6874

Include src/nvim/testdir/test_clientserver.vim changes
from patches 8.0.0507, 8.0.0511.

* vim-patch:8.0.1251: invalid expressin passed to WaitFor()

Problem:    Invalid expressin passed to WaitFor().
Solution:   Check if the variable exists.
d97fbf171e
2018-07-12 06:22:55 +02:00
Justin M. Keyes
671b244e6c
Merge #8701 from janlazo/vim-8.0.1140 2018-07-12 05:24:21 +02:00
Synray
07499a842b man.vim: C highlighting for EXAMPLES section #8709 2018-07-12 01:13:52 +02:00
James McCoy
9adb6ed74a
Merge pull request #8719 from jamessan/libuv-errno
test: Rename includes/pre/uv-errno.h to includes/pre/uv.h
2018-07-11 08:27:46 -04:00
Björn Linse
38f0ac07b5 tests/screen.lua: treat "resize" like any other event
Saves ~10 seconds in UI tests
2018-07-11 12:57:01 +02:00
James McCoy
9f8bd77d7b
test/includes: Use ${gen_cdefs} when pre-processing headers
Now that uv.h is directly being included, pre-processing of
test/includes/pre/uv.h fails on Linux with

    In file included from «SRCDIR»/neovim/test/includes/pre/uv.h:1:
    In file included from /usr/include/uv.h:62:
    /usr/include/uv/unix.h:72:11: fatal error: 'uv/pthread-barrier.h' file not found
    # include "uv/pthread-barrier.h"
              ^~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

This happens because we're missing -D_GNU_SOURCE (part of ${gen_cdefs}),
which makes the pthread_barrier_* functionality visible.
2018-07-11 00:26:28 -04:00
James McCoy
ba7704ab4e
test: Rename includes/pre/uv-errno.h to includes/pre/uv.h
libuv users are only supposed to directly include uv.h.  In v1.21.0, all
the uv-*.h headers were renamed to uv/*.h, which caused the unit tests
to fail with

    [123/125] Generating post/uv-errno.h
    FAILED: test/includes/post/uv-errno.h
    cd «SRCDIR»/src/neovim/build/test/includes && /usr/bin/clang -std=c99 -E -P «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h -I/usr/include -I/usr/include -o «SRCDIR»/neovim/build/test/includes/post/uv-errno.h
    «SRCDIR»/src/neovim/test/includes/pre/uv-errno.h:1:10: error: 'uv-errno.h' file not found with <angled> include; use "quotes" instead
    #include <uv-errno.h>
             ^~~~~~~~~~~~
             "uv-errno.h"

The intention of the file is to extend libuv's error constants with more
values used by the unit tests.  This can just as easily be achieved
without poking into pseudo-private header files.
2018-07-11 00:26:07 -04:00
Jan Edmund Lazo
0fb695df8a vim-patch:8.0.0697: recorded key sequences may become invalid
Problem:    Recorded key sequences may become invalid.
Solution:   Add back KE_SNIFF removed in 7.4.1433. Use fixed numbers for the
            key_extra enum.
8858498516
2018-07-10 21:52:11 -04:00
James McCoy
ec6e78e77c
Merge pull request #8716 from mhinz/vim-patch/wrapped-lines
[RFC] vim-patch.sh: handle wrapped commit messages
2018-07-10 20:12:14 -04:00
James McCoy
35b269f51f
vim-patch.sh: Unwrap commit messages when reviewing PRs
Longer summary lines for commits may be wrapped when downloading the
commit from GitHub.  Unwrapping the lines ensures they can be compared
with the raw Vim commits.

The difference before and after this patch using:

  ./scripts/vim-patch.sh -r 8684

Before:

  ✘ Wrong commit message.
    Expected:
  vim-patch:8.0.1464: completing directory after :find does not add slash

  Problem:    Completing directory after :find does not add slash.
  Solution:   Adjust the flags for globpath(). (Genki Sky)
  vim/vim@8a37b03
    Actual:
  vim-patch:8.0.1464: completing directory after :find does not
   add slash

  Problem:    Completing directory after :find does not add slash.
  Solution:   Adjust the flags for globpath(). (Genki Sky)

After:

  ✔ Found expected commit message.

[ci skip]
2018-07-10 19:54:44 -04:00
Jan Edmund Lazo
a315026dc2 vim-patch:8.0.0522: Win32: clipboard=unnamed in :global (#8717)
Problem:    MS-Windows: when 'clipboard' is "unnamed" yyp does not work in a
            :global command.
Solution:   When setting the clipboard was postponed, do not clear the
            register.
3fcfa35f82
2018-07-11 00:15:09 +02:00
Michael Hoffmann
0ed8b12a07 transstr_buf: fix length comparison #8681
closes #8466
closes #8664
Regression by 0d7daaad98.

- Fix length comparison.
- Fix loop(s) which iterated over all fields of array `pcc` even if it
  was not filled up (try unicode 0x9f as statusline character).

Note about the tests:
- To input unicode with more than two hex digits you can use <C-v>U...:
  a + U+fe20: a︠
  a + U+fe20 + U+fe21: a︠︡
2018-07-10 21:57:26 +02:00
ZviRackover
627cc1b3d8 test: build_stl_str_hl (#8703)
Improve coverage of `build_stl_str_hl`.
Minor removal of dead code in the tested function.
2018-07-10 20:46:40 +02:00
Jan Edmund Lazo
2574f299e5 vim-patch:8.0.1464: add slash when completing directory #8684
Problem:    Completing directory after :find does not add slash.
Solution:   Adjust the flags for globpath(). (Genki Sky)
8a37b03289
2018-07-10 19:33:18 +02:00
James McCoy
d241f278d3
Merge pull request #8708 from blueyed/fix-standout
Fix standout mode
2018-07-10 11:32:27 -04:00
James McCoy
13bdc21faf
Merge pull request #8712 from jamessan/unicode-11
Update unicode files
2018-07-10 06:53:48 -04:00
James McCoy
7b2f6a7e5f
Update unicode files 2018-07-10 06:53:11 -04:00
James McCoy
44a284d71c vim-patch.sh: review_commit: Fix regex for vim version
067bb1e9f changed the commit format to include a brief description in
the summary line of the commit.
2018-07-09 13:55:21 -04:00
James McCoy
56af2f8c5f vim-patch.sh: Use single quotes to avoid doubling backslashes 2018-07-09 13:51:13 -04:00
Brayden Banks
9afed40ea6 man.vim: fix for mandoc (#8698)
When giving a section, the first candidate selection was not performed.

followup/fixup #8341
2018-07-08 17:31:10 +02:00