Commit Graph

1940 Commits

Author SHA1 Message Date
Marcos Almeida
a2253744c9 system(): handle profiling and 'verbose' #8730
closes #8362

Vim's code calls `call_shell` directly from `get_system_output_as_rettv`
whereas in Nvim this function has been rewritten to not call `call_shell` but to call
`os_system` via `do_os_system`, losing the support for profiling and verbose.

Changing the code to call `call_shell` from `get_system_output_as_rettv`
seems to be too complicated to be worth it on the current version of the
code. So this commit duplicates the relevant code.
2018-07-29 03:49:11 +02:00
Björn Linse
9a584773b5 screen.c: add update_window_hl to special redrawing entrypoints
The following (run as a script) used to cause a crash due to :sign using a
special redraw (not updating nvim's specific highlight data structures)
without proper redraw first, as split just flags for redraw later.

set cursorline
sign define piet text=>> texthl=Search
split
sign place 3 line=2 name=piet buffer=1
2018-07-27 17:11:01 +02:00
Björn Linse
11861bc9c8 tests: add test for switching tabpage right after scroll 2018-07-24 16:37:48 +02:00
Björn Linse
d183103b45 test: assert scroll region state for clear
some clients assume this, so tests should check it
2018-07-24 16:37:04 +02:00
Björn Linse
ed5ac84ab0 tests: test for redrawing tabline when msgsep marker goes outside screen 2018-07-24 16:36:20 +02:00
Justin M. Keyes
2000b6a64a Merge #8589 'VimL: Remove legacy v:xx aliases' 2018-07-23 03:18:10 +02:00
Jan Edmund Lazo
c9f2faf3bf vim-patch:8.0.1398: :packadd does not load packages from the "start" directory (#8762)
Problem:    :packadd does not load packages from the "start" directory.
            (Alejandro Hernandez)
Solution:   Make :packadd look in the "start" directory if those packages were
            not loaded on startup.
9e1d399e63
2018-07-23 02:04:49 +02:00
Shougo Matsushita
03bd5a4b91 Make "v:errmsg", "v:shell_error" and "v:this_session" distinct 2018-07-23 08:47:51 +09:00
Björn Linse
6b8cd827a9 ui: add tests for hlstate extension 2018-07-21 13:21:59 +02:00
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
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
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
fc45c97829 Merge #8736 'vim-patch:8.0.0697: stable keymap.h' 2018-07-13 20:54:52 +02: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
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
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
Jan Edmund Lazo
a5ed460241 tests: endfunc allows uncommented bar 2018-07-07 13:31:55 -04:00
Justin M. Keyes
f65a751d82 test: nvim_buf_attach: reduce delay
This test is mostly a demo/reference for:
https://github.com/neovim/neovim/issues/8634#issuecomment-400940467
so let's not pay a 1s penalty.
2018-07-02 20:47:28 +02:00
Justin M. Keyes
b4fcf02316 test: nvim_buf_attach response after initial delay
ref #8634
2018-07-01 17:31:58 +02:00
Justin M. Keyes
60ef7889a2 test: buffer_updates: 10s timeout 2018-07-01 17:31:00 +02:00
Justin M. Keyes
22d95e462e
coverity/108274: tty-test.c: Insecure data handling (#8666) 2018-07-01 14:48:30 +02:00
KillTheMule
40911e435e API: emit nvim_buf_lines_event from :terminal #8616
closes #8575
2018-07-01 14:42:56 +02:00
Yichao Zhou
12481781a0 highlight: high-priority CursorLine if fg is set. #8578
closes #7383
closes #7715

This implements the compromise described in #7383:
* low-priority CursorLine if foreground is not set
* high-priority ("same as Vim" priority) CursorLine if foreground is set

ref d1874ab282
ref 56eda2aa17
2018-06-28 01:49:40 +02:00
David Hotham
1cbc830189 API: nvim_win_set_cursor: set curswant #8613
Fixes #8591
2018-06-25 02:14:55 +02:00
Jan Edmund Lazo
14b3741ec5 test: update writefile test for invalid list items
It validates list items with tv_check_str_on_nr()
to catch invalid types (ex. E745, E805).
If there is an invalid item, it does not write to the file.
2018-06-24 16:22:16 -04: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
Justin M. Keyes
9625e9da75 startup: delete empty stdin buffer if other files were opened
DWIM: avoid empty buffer 1 when stdin was empty. If other files were
specified at startup, we assume that stdin is only accidentally
not-a-TTY: user did not intend to send text from it.

ref #8560
ref #8561
2018-06-18 21:51:42 +02:00
Justin M. Keyes
d44ed79ccc startup: go to buffer 2 if stdin is empty
If stdin is not a TTY we read it into buffer 1, as text. But if the
stdin pipe is empty, Nvim was most likely invoked for some other reason.
DWIM: select buffer 2 (if it exists). Example:

    echo file1 | xargs nvim

closes #8560
closes #8561
ref https://github.com/equalsraf/neovim-qt/issues/417
2018-06-18 17:51:38 +02:00
Justin M. Keyes
487cf98c0b startup: fix -E/-Es without -u NONE
Before this change, -E/-Es without `-u NONE` reads stdin as Ex commands.
It should always read stdin as text (into buffer 1), like this:

    echo foo | nvim -Es +'%p'
    foo
    echo foo | nvim -Es -u NORC +'%p'
    foo
2018-06-17 14:50:53 +02:00
Justin M. Keyes
9c2099d585 Ex mode: use getexline() instead of getexmodeline()
This changes Ex mode (Q, -e) to work like Vim's "improved Ex mode"
(gQ, -E).  That brings some small behavior differences, but should not
impact most Ex scripts (unless, for example, they depend on mappings
being disabled--but that can be solved for -e by skipping user config).

Before this change:
* the screen test hangs.

After this change:
* Q acts like gQ.
* -e/-es differs from -E/-Es only in its treatment of stdin.

This moves towards potentially removing getexmodeline().
(HINT: That does NOT mean "removing Ex mode", it means removing the
Vi-compatible Ex mode, which differs from Vim's "improved Ex mode" only
in some minor details (e.g. mappings are disabled).)

ref #1089 :-)~
2018-06-17 14:50:53 +02:00
Jan Edmund Lazo
8192267dea vim-patch:8.0.0609: some people still don't know how to quit (#8571)
Problem:    For some people the hint about quitting is not sufficient.
Solution:   Put <Enter> separately.  Also use ":qa!" to get out even when
            there are changes.
28a8193e31
2018-06-17 12:51:03 +02:00
Björn Linse
c46997aa87
Merge pull request #8546 from bfredl/eob
Add fillchar for EndOfBuffer and check for invalid UTF-8
2018-06-14 18:00:59 +02:00
Björn Linse
5442f0b622 fillchars: make checks more strict and improve tests 2018-06-14 14:00:09 +02:00
James McCoy
6c0f1903e6
functionaltest: Use octal escapes for printf
According to POSIX[0], only octal escapes are supported by the printf
command.  GNU coreutils' printf and some shells' builtin printf versions
which support hex escapes, but dash and non-GNU printf do not.

[0]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html
2018-06-13 23:03:37 -04:00
Jack Bracewell
a7bb63c55d Add ‘eob’ option to fillchars
This option allows configuring what character is shown on the empty
lines at the end of a buffer, previously hardcoded to ‘~’
2018-06-13 17:54:16 +02:00
Björn Linse
050f3975f6 options: remove 'maxcombine` option (always use 6) 2018-06-13 10:11:35 +02:00
Björn Linse
315b7f8632
test/ui: doublewidth rendering. multibyte and cmdwin chars in folded lines (#8534) 2018-06-12 17:57:47 +02:00
Justin M. Keyes
44c6deb91a NVIM v0.3.0
FEATURES:
3cc7ebf810 #7234 built-in VimL expression parser
6a7c904648 #4419 implement <Cmd> key to invoke command in any mode
b8363283fa #7679 'startup: treat stdin as text instead of commands'
58b210e114 :digraphs : highlight with hl-SpecialKey #2690
7a13611ba2 #8276 'startup: Let `-s -` read from stdin'
1e71978cf0 events: VimSuspend, VimResume #8280
1e7d5e8cdf #6272 'stdpath()'
f96d99ad11 #8247 server: introduce --listen
e8c39f72fd #8226 insert-mode: interpret unmapped META as ESC
98e7112390 msg: do not scroll entire screen (#8088)
f72630b784 #8055 let negative 'writedelay' show all redraws
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
a4f6cec7a3 cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
207b7ca4bc #6844 channels: support buffered output and bytes sockets/stdio

API:
f85cbea725 #7917 API: buffer updates
418abfc9d0 #6743 API: list information about all channels/jobs.
36b2e3f743 #8375 API: nvim_get_commands
273d2cd5d5 #8329 API: Make nvim_set_option() update `:verbose set …`
8d40b3617c #8371 API: more reliable/descriptive VimL errors
ebb1acb3c0 #8353 API: nvim_call_dict_function
9f994bb699 #8004 API: nvim_list_uis
34057045be #7520 API/UI: forward option updates to UIs
911b1e49ab #7821 API: improve nvim_command_output

WINDOWS OS:
9cefd83cc7 #8084, #8516 build/win: support MSVC
ee4e1fd8ec win: Fix reading content from stdin (#8267)

TUI:
ffb8904913 #8309 TUI: add support for mouse release events in urxvt
8d5a46e77b #8081 TUI: implement "standout" attribute
60716371e9 TUI: support TERM=konsole-256color
67848c0b91 #7653 TUI: report TUI info with -V3 ('verbose' >= 3)
3d0ee17c91 TUI/rxvt: enable focus-reporting
d109f5645b #7640 TUI: 'term' option: reflect effective terminal behavior

FIXES:
ed6a113804 #8273 'job-control: avoid kill-timer race'
4e02f1ab87 #8107 'jobs: separate process-group'
451c48a092 terminal: flush vterm output buffer on pty output #8486
5d6732ff09 :checkhealth fixes #8335
53f11dcfc7 #8218 'Fix errors reported by PVS'
d05712fbe7 inccommand: pause :terminal redraws (#8307)
51af911a27 inccommand: do not execute trailing commands #8256
84359a467f terminal: resize to the max dimensions (#8249)
d49c1dda8b #8228 Make vim_fgets() return the same values as in Vim
60e96a45b4 screen: winhl=Normal:Background should not override syntax (#8093)
0c59ac1a2c #5908 'shada: Also save numbered marks'
ba87a2cde7 cscope: ignore EINTR while reading the prompt (#8079)
b1412dc412 #7971 ':terminal Enter/Leave should not increment jumplist'
3a5721e91b TUI: libtermkey: force CSI driver for mouse input #7948
6ff13d78b7 #7720 TUI: faster startup
1c6e956079 #7862 TUI: fix resize-related segfaults
a58c9094db #7676 TUI: always hide cursor when flushing, never flush buffers during unibilium output
303e1df13f #7624 TUI: disable BCE almost always
249bdb07dd #7761 mark: Make sure that jumplist item will not have zero lnum
6f41ce0260 #7704 macOS: Set $LANG based on the system locale
a043899ba2 #7633 'Retry fgets on EINTR'

CHANGES:
ad60927d09 #8304 default to 'nofsync'
f3f1970597 #8035 defaults: 'fillchars'
a6052c7307 #7984 defaults: sidescroll=1
b69fa866db #7888 defaults: enable cscopeverbose
7c4bb23ff3 defaults: do :filetype stuff unless explicitly "off"
2aa308c685 #5658 'Apply :lmap in macros'
8ce6393048 terminal: Leave 'relativenumber' alone (#8360)
e46534b423 #4486 refactor: Remove maxmem, maxmemtot options
131aad953c win: defaults: 'shellcmdflag', 'shellxquote' #7343
c57d315963 #8031 jobwait(): return -2 on interrupt also with timeout
6452831cf9 clipboard: macOS: fallback to tmux if pbcopy is broken #7940
300d3651e2 #7919 Make 'langnoremap' apply directly after a map
ada1956206 #7880 'lua/executor: Remove lightuserdata'

INTERNAL:
de0a9548f7 #7806 internal statistics for list impl
dee78a4095 #7708 rewrite internal list impl
2018-06-11 00:46:49 +02:00
Justin M. Keyes
dc5fdbc758 test: fix startup_spec
This behavior was changed (improved) by 5861dc5966 which actually
makes -E more faithful to Vim's behavior.
2018-06-10 16:27:13 +02:00
Justin M. Keyes
b8363283fa
Merge #7679 'startup: treat stdin as text instead of commands' 2018-06-10 15:10:59 +02:00
Justin M. Keyes
f85cbea725 Merge #7917 'API: buffer updates' 2018-06-08 10:13:04 +02:00
林千里
451c48a092 terminal: flush vterm output buffer on pty output #8486
Fixes #4151

libvterm uses an "output buffer" for terminal reporting
(e.g. \e[6n to report cursor position)
Flush it in on_channel_output() not just terminal_send_key()

See also this line from pangoterm:
https://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/607/pangoterm.c#L2159
2018-06-08 02:18:27 +02:00
Justin M. Keyes
db68d1d638
Merge #8491 from janlazo/vim-8.0.0255 2018-06-07 18:31:50 +02:00
Jan Edmund Lazo
e0d39d8e53 vim-patch:8.0.0256: missing changes to one file breaks test
Problem:    Tests fail because some changes were not included.
Solution:   Add changes to evalfunc.c
3a29abcb61
2018-06-07 12:02:57 -04:00
Justin M. Keyes
3abf17ae88
API: validation: mention invalid method name (#8489) 2018-06-07 10:56:44 +02:00
Jan Edmund Lazo
7f6c1d256f vim-patch:8.0.0254: error message of assert functions (#8488)
Problem:    When using an assert function one can either specify a message or
            get a message about what failed, not both.
Solution:   Concatenate the error with the message.
c7b831ca15
2018-06-07 09:59:45 +02:00
Justin M. Keyes
5861dc5966
Merge #8461 from bfredl/scrollstatus 2018-06-06 00:34:08 +02:00