Compare commits

...

31 Commits

Author SHA1 Message Date
b99dad7b4c NVIM v0.4.3
Maintenance release for the v0.4.x series.

FIXES:

599ad5d3b8 Windows: nvim-qt v0.2.15 (fix "invalid font" error on startup)
1def94597b #11332 autocmd: Fix event name casing
b678d33dd3 #11315 test: delete duplicate highlight group
924fa143cc #11225 ex_echo: fix check for got_int
327e8ddb18 #11138 deps: pass LDFLAGS+=-static
a1f557690f #11222 mac: fix "tags file not sorted" bug on Catalina
f2f37712a4 #11187 recovery mode (-r/-L): use headless_mode
4f452a6744 #11190 Remove "highbright bold" conversion.
9571a87d3d #11177 third-party: upgrade libvterm to 0.1.2
3817518ab4 #11074 terminfo_start: flush buffer
56d9412999 win_line: update `w_last_cursorline` always
ddd3363a42 #11132 patch_terminfo_bugs: TERM=xterm with non-xterm: ignore smglr
d453d2c484 Fix redraw regression with w_p_cole in visual mode
e0622b4c65 screen: missing redraw/highlight for ruler in message area
b781f2b072 cmdline: wildmenumode() should be true with wildoptions+=pum
eef3809067 #11027 win_update: fix redraw regression
43f4955f70 #11069 Merge pull request from bfredl/virtualcol
6f693be1ee #11050 env: use putenv_s for LC_ALL, LANG, etc.
36e2846b49 #11094 paste: fix handling of "<" in cmdline
60b56ed458 #11126 Merge pull request from bfredl/invalidcell-0.4
8250d6795b screen: don't crash on invalid grid cells being recomposed
2019-11-06 01:54:45 -08:00
1def94597b autocmd: Fix event name casing #11332
Affects getcompletion()
2019-11-04 00:25:20 -08:00
b678d33dd3 Merge pull request #11315 from bfredl/termtestfix
[release-0.4] test: delete duplicate highlight group
2019-10-29 21:49:56 +01:00
a012387074 [release-0.4] test: delete duplicate highlight group
Depending on the lua version, 6 might get used instead of
2 here, which causes test failures in upstream builds.
This was fixed as part of #11206 on master
2019-10-29 19:44:47 +01:00
599ad5d3b8 win/dist: nvim-qt v0.2.15 2019-10-26 13:18:59 -07:00
924fa143cc [release-0.4] ex_echo: fix check for got_int #11225
It needs to return to not output any remaining parts.

Followup to https://github.com/neovim/neovim/pull/10926
Ref: https://github.com/neovim/neovim/issues/10923

(cherry picked from commit 93fe30593b)
2019-10-20 00:54:07 +02:00
327e8ddb18 [release-0.4] deps: pass LDFLAGS+=-static (#11138)
This is required when `build_old_libs=no` is used in `libtool`.

Fixes https://github.com/neovim/neovim/issues/11198

(cherry picked from commit 2e14dffbb4)
2019-10-14 15:17:47 +02:00
a1f557690f [release-0.4] mac: fix "tags file not sorted" bug on Catalina (#11222)
I/O in Catalina is currently known to be broken. This commit works
around a pesky bug and also makes the code more consistent by removing
the mix of C file and standard I/O.

Fixes https://github.com/neovim/neovim/issues/11196

(cherry picked from commit d0efc1c906)
2019-10-14 14:05:58 +02:00
f2f37712a4 [release-0.4] recovery mode (-r/-L): use headless_mode (#11187)
Fixes https://github.com/neovim/neovim/issues/11181.

(cherry picked from commit 9af0fe529d)
2019-10-11 19:17:29 +02:00
4f452a6744 Remove "highbright bold" conversion. Fixes #11190
When using TUI host terminal should take care of this (regardless
if 'termguicolors' is active or not). For GUI the behavior doesn't make
sense (GUI should display bold attr as bold always).

(cherry picked from commit b772b86d2b)
2019-10-11 00:00:26 +02:00
9571a87d3d [release-0.4] third-party: upgrade libvterm to 0.1.2 (#11177)
(cherry picked from commit f2ad93168b)
2019-10-09 19:58:14 +02:00
3817518ab4 [release-0.4] terminfo_start: flush buffer #11074
This aligns with `terminfo_stop`, which also flushes the buffer
after disabling things.

This ensures Neovim gets the response to the terminal background query
before exiting (`nvim -u NONE -cq` with e.g. urxvt or kitty).

Caveats:
* With kitty this causes some "flickering", likely since the alternate
  screen is being setup with `nvim -u NONE -cq`, whereas it would not be
  processed otherwise before quitting (as with the background query).
* tmux after this patch may print ^[[I (CSI I / FocusGained) after
  `nvim -u NONE -cq`.

Fixes https://github.com/neovim/neovim/issues/11062

Ref: https://github.com/neovim/neovim/issues/11181
2019-10-08 19:18:07 +02:00
56d9412999 [release-0.4] win_line: update w_last_cursorline always
Vim patch 8.1.0856 (54d9ea6) caused a performance regression in Neovim,
when `set conceallevel=1 nocursorline` was used, since then due to
refactoring in 23c71d5 `w_last_cursorline` would never get updated
anymore.

Adds/uses `redrawdebug+=nodelta` for testing this.

Fixes https://github.com/neovim/neovim/issues/11100.
Closes https://github.com/neovim/neovim/pull/11101.
2019-10-04 08:54:02 +02:00
ddd3363a42 [release-0.4] patch_terminfo_bugs: TERM=xterm with non-xterm: ignore smglr (#11132)
"smglr" was added for TERM=xterm recently to the terminfo database,
which causes display issues with terminals that use `TERM=xterm` by
default for themselves, although not supporting it.

This patch makes "smglr" to be ignored then.

Fixes https://github.com/neovim/neovim/issues/10562
2019-10-03 07:47:47 +02:00
d453d2c484 [release-0.4] Fix redraw regression with w_p_cole in visual mode
Fixes https://github.com/neovim/neovim/issues/11024, regressed in 23c71d51.
Closes https://github.com/neovim/neovim/pull/11120.
2019-10-03 07:47:40 +02:00
c5d1b0f3da Merge pull request #11142 from bfredl/backports
[release-0.4] Backport fixes for ruler drawing and wildmenumode()
2019-10-02 22:39:10 -07:00
e0622b4c65 [release-0.4] screen: missing redraw/highlight for ruler in message area 2019-10-02 22:30:40 +02:00
b781f2b072 [release-0.4] cmdline: wildmenumode() should be true with wildoptions+=pum 2019-10-02 22:29:42 +02:00
e63fdf63ba Merge pull request #11133 from blueyed/backports
[release-0.4] backports
2019-10-02 03:43:39 +02:00
eef3809067 [release-0.4] win_update: fix redraw regression (#11027)
Before 6e9ea5adc `win_ins_lines` would return `FAIL` for `i/line_count == 0`.

Handle this by checking it in the outer `if`.

Ref: https://github.com/neovim/neovim/commit/6e9ea5ad#commitcomment-35084669
2019-10-01 02:16:14 +02:00
43f4955f70 [release-0.4] Merge pull request #11069 from bfredl/virtualcol
screen: fix vcol counting with virtual text.
2019-10-01 02:15:24 +02:00
6f693be1ee [release-0.4] env: use putenv_s for LC_ALL, LANG, etc. #11050
Problem:  ":lang messages en_US.UTF-8" no longer overrides the language
          detected from the environment (at startup).
Solution: In os_setenv, special-case "LC_ALL", "LANG", et al. to use
          putenv_s instead of uv_os_setenv.

fixes #11045
2019-10-01 02:13:13 +02:00
36e2846b49 [release-0.4] paste: fix handling of "<" in cmdline (#11094)
Fixes https://github.com/neovim/neovim/issues/11088.
2019-10-01 02:11:40 +02:00
60b56ed458 Merge pull request #11126 from bfredl/invalidcell-0.4
[release-0.4] screen: don't crash on invalid grid cells being recomposed
2019-09-30 22:44:38 +02:00
8250d6795b screen: don't crash on invalid grid cells being recomposed 2019-09-30 20:33:09 +02:00
38d02d58b2 version bump 2019-09-15 19:40:58 -07:00
7d6aa82b69 NVIM v0.4.2
This is a "stub" release to fix release automation.

Release notes: e2cc5fe09d

FIXES:

6c65f8f182 CI/AppVeyor: revert whitelist
2019-09-15 19:36:35 -07:00
6c65f8f182 CI/AppVeyor: revert whitelist
revert 6b028ec5f2 #10746

This seems to skip tags also, which breaks our release automation.
From the AppVeyor logs:

    2019-09-15 17:25:00.232 Warning Commit "1f76c4af" of branch "master" skipped as commit message contains either "[skip ci]" or "[ci skip]" or "[skip appveyor]"
    2019-09-15 17:20:24.152 Warning Commit "baa5263b" skipped as branch "stable" is not in white-list
    2019-09-15 17:20:03.163 Warning Commit "6cb5ffc0" skipped as branch "release-0.4" is not in white-list
    2019-09-15 17:20:02.977 Warning Commit "baa5263b" skipped as branch "v0.4.1" is not in white-list
    2019-09-15 16:35:38.810 Warning Commit "31956372" of branch "master" skipped as commit message contains either "[skip ci]" or "[ci skip]" or "[skip appveyor]"
    2019-09-15 16:28:35.237 Warning Commit "e2cc5fe0" skipped as branch "stable" is not in white-list
    2019-09-15 16:28:17.814 Information Build version 31489 created
    2019-09-15 16:28:16.364 Warning Commit "e2cc5fe0" skipped as branch "v0.4.0" is not in white-list
2019-09-15 17:39:07 -07:00
6cb5ffc075 version bump 2019-09-15 17:12:50 -07:00
baa5263b56 NVIM v0.4.1
FIXES:

2abdb89522 fix failed release: regenerate the *.mpack file
2019-09-15 17:11:39 -07:00
2abdb89522 fix failed release: regenerate the *.mpack file
Set NVIM_API_PRERELEASE=true to regenerate the *.mpack file, because it
was generated from an old binary accidentally, which caused the release
to fail:

    test/functional\api\version_spec.lua:133: Expected objects to be the same.
    Passed in:
    (table: 0x0c6175a8) {
      [method] = false
      [name] = 'nvim_get_context'
     *[parameters] = {
       *[1] = {
         *[1] = 'Dictionary'
          [2] = '' } }
      [return_type] = 'Dictionary'
      [since] = 6 }
    Expected:
    (table: 0x0c6cd2d0) {
      [method] = false
      [name] = 'nvim_get_context'
     *[parameters] = {
       *[1] = {
         *[1] = 'Array'
          [2] = '' } }
      [return_type] = 'Dictionary'
      [since] = 6 }
    stack traceback:
        test/functional\api\version_spec.lua:133: in function <test/functional\api\version_spec.lua:122>
2019-09-15 17:10:16 -07:00
30 changed files with 354 additions and 39 deletions

View File

@ -114,7 +114,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 4)
set(NVIM_VERSION_PATCH 0)
set(NVIM_VERSION_PATCH 3)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level

View File

@ -40,6 +40,3 @@ cache:
artifacts:
- path: build/Neovim.zip
- path: build/bin/nvim.exe
branches:
only:
- master

View File

@ -4583,6 +4583,16 @@ A jump table for the options with a short description can be found at |Q_op|.
RedrawDebugRecompose guibg=Red redraw generated by the
compositor itself, due to a
grid being moved or deleted.
nothrottle Turn off throttling of the message grid. This is an
optimization that joins many small scrolls to one
larger scroll when drawing the message area (with
'display' msgsep flag active).
invalid Enable stricter checking (abort) of inconsistencies
of the internal screen state. This is mostly
useful when running nvim inside a debugger (and
the test suite).
nodelta Send all internally redrawn cells to the UI, even if
they are unchanged from the already displayed state.
*'redrawtime'* *'rdt'*
'redrawtime' 'rdt' number (default 2000)
@ -6908,7 +6918,6 @@ A jump table for the options with a short description can be found at |Q_op|.
global
The number of milliseconds to wait for each character sent to the
screen. When positive, characters are sent to the UI one by one.
When negative, all redrawn characters cause a delay, even if the
character already was displayed by the UI. For debugging purposes.
See 'redrawdebug' for more options. For debugging purposes.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -26,6 +26,9 @@
</screenshots>
<releases>
<release date="2019-09-15" version="0.4.2"/>
<release date="2019-09-15" version="0.4.1"/>
<release date="2019-09-15" version="0.4.0"/>
<release date="2019-07-03" version="0.3.8"/>
<release date="2019-04-29" version="0.3.5"/>
<release date="2019-01-13" version="0.3.4"/>

View File

@ -21,9 +21,9 @@ return {
'BufWritePre', -- before writing a buffer
'ChanInfo', -- info was received about channel
'ChanOpen', -- channel was opened
'CmdLineChanged', -- command line was modified
'CmdLineEnter', -- after entering cmdline mode
'CmdLineLeave', -- before leaving cmdline mode
'CmdlineChanged', -- command line was modified
'CmdlineEnter', -- after entering cmdline mode
'CmdlineLeave', -- before leaving cmdline mode
'CmdUndefined', -- command undefined
'CmdWinEnter', -- after entering the cmdline window
'CmdWinLeave', -- before leaving the cmdline window

View File

@ -18747,8 +18747,9 @@ static void f_visualmode(typval_T *argvars, typval_T *rettv, FunPtr fptr)
*/
static void f_wildmenumode(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
if (wild_menu_showing)
if (wild_menu_showing || ((State & CMDLINE) && pum_visible())) {
rettv->vval.v_number = 1;
}
}
/// "win_findbuf()" function

View File

@ -189,7 +189,7 @@ paste = (function()
if mode == 'c' and not got_line1 then -- cmdline-mode: paste only 1 line.
got_line1 = (#lines > 1)
vim.api.nvim_set_option('paste', true) -- For nvim_input().
local line1, _ = string.gsub(lines[1], '[\r\n\012\027]', ' ') -- Scrub.
local line1 = lines[1]:gsub('<', '<lt>'):gsub('[\r\n\012\027]', ' ') -- Scrub.
vim.api.nvim_input(line1)
vim.api.nvim_set_option('paste', false)
elseif mode ~= 'c' then -- Else: discard remaining cmdline-mode chunks.

View File

@ -957,6 +957,7 @@ static void command_line_scan(mparm_T *parmp)
case 'r': // "-r" recovery mode
case 'L': { // "-L" recovery mode
recoverymode = 1;
headless_mode = true;
break;
}
case 's': {

View File

@ -233,7 +233,10 @@ void msg_multiline_attr(const char *s, int attr, bool check_int)
{
const char *next_spec = s;
while (next_spec != NULL && (!check_int || !got_int)) {
while (next_spec != NULL) {
if (check_int && got_int) {
return;
}
next_spec = strpbrk(s, "\t\n\r");
if (next_spec != NULL) {

View File

@ -4306,6 +4306,10 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
if (value < 0) {
errmsg = e_positive;
}
} else if (pp == &p_wd) {
if (value < 0) {
errmsg = e_positive;
}
}
// Don't change the value and return early if validation failed.

View File

@ -518,10 +518,18 @@ EXTERN long p_pyx; // 'pyxversion'
EXTERN char_u *p_rdb; // 'redrawdebug'
EXTERN unsigned rdb_flags;
# ifdef IN_OPTION_C
static char *(p_rdb_values[]) = { "compositor", "nothrottle", NULL };
static char *(p_rdb_values[]) = {
"compositor",
"nothrottle",
"invalid",
"nodelta",
NULL
};
# endif
# define RDB_COMPOSITOR 0x001
# define RDB_NOTHROTTLE 0x002
# define RDB_INVALID 0x004
# define RDB_NODELTA 0x008
EXTERN long p_rdt; // 'redrawtime'
EXTERN int p_remap; // 'remap'

View File

@ -135,7 +135,16 @@ int os_setenv(const char *name, const char *value, int overwrite)
}
#endif
uv_mutex_lock(&mutex);
int r = uv_os_setenv(name, value);
int r;
#ifdef WIN32
// libintl uses getenv() for LC_ALL/LANG/etc., so we must use _putenv_s().
if (striequal(name, "LC_ALL") || striequal(name, "LANGUAGE")
|| striequal(name, "LANG") || striequal(name, "LC_MESSAGES")) {
r = _putenv_s(name, value); // NOLINT
assert(r == 0);
}
#endif
r = uv_os_setenv(name, value);
assert(r != UV_EINVAL);
// Destroy the old map item. Do this AFTER uv_os_setenv(), because `value`
// could be a previous os_getenv() result.

View File

@ -577,11 +577,14 @@ void conceal_check_cursor_line(void)
/// Whether cursorline is drawn in a special way
///
/// If true, both old and new cursorline will need
/// need to be redrawn when moving cursor within windows.
/// to be redrawn when moving cursor within windows.
/// TODO(bfredl): VIsual_active shouldn't be needed, but is used to fix a glitch
/// caused by scrolling.
bool win_cursorline_standout(const win_T *wp)
FUNC_ATTR_NONNULL_ALL
{
return wp->w_p_cul || (wp->w_p_cole > 0 && !conceal_cursor_line(wp));
return wp->w_p_cul
|| (wp->w_p_cole > 0 && (VIsual_active || !conceal_cursor_line(wp)));
}
/*
@ -871,7 +874,7 @@ static void win_update(win_T *wp)
if (wp->w_lines[0].wl_lnum != wp->w_topline)
i += diff_check_fill(wp, wp->w_lines[0].wl_lnum)
- wp->w_old_topfill;
if (i < wp->w_grid.Rows - 2) { // less than a screen off
if (i != 0 && i < wp->w_grid.Rows - 2) { // less than a screen off
// Try to insert the correct number of lines.
// If not the last window, delete the lines at the bottom.
// win_ins_lines may fail when the terminal can't do it.
@ -2403,10 +2406,10 @@ win_line (
filler_todo = filler_lines;
// Cursor line highlighting for 'cursorline' in the current window.
if (wp->w_p_cul && lnum == wp->w_cursor.lnum) {
if (lnum == wp->w_cursor.lnum) {
// Do not show the cursor line when Visual mode is active, because it's
// not clear what is selected then.
if (!(wp == curwin && VIsual_active)) {
if (wp->w_p_cul && !(wp == curwin && VIsual_active)) {
int cul_attr = win_hl_attr(wp, HLF_CUL);
HlAttrs ae = syn_attr2entry(cul_attr);
@ -4007,7 +4010,7 @@ win_line (
break;
}
++vcol;
vcol += cells;
}
}
@ -4353,7 +4356,7 @@ static int grid_char_needs_redraw(ScreenGrid *grid, int off_from, int off_to,
|| (line_off2cells(linebuf_char, off_from, off_from + cols) > 1
&& schar_cmp(linebuf_char[off_from + 1],
grid->chars[off_to + 1])))
|| p_wd < 0));
|| rdb_flags & RDB_NODELTA));
}
/// Move one buffered line to the window grid, but only the characters that
@ -5103,6 +5106,8 @@ win_redr_custom (
win_T *ewp;
int p_crb_save;
ScreenGrid *grid = &default_grid;
/* There is a tiny chance that this gets called recursively: When
* redrawing a status line triggers redrawing the ruler or tabline.
* Avoid trouble by not allowing recursion. */
@ -5142,10 +5147,11 @@ win_redr_custom (
}
maxwidth = wp->w_width - col;
if (!wp->w_status_height) {
grid = &msg_grid_adj;
row = Rows - 1;
maxwidth--; // writing in last column may cause scrolling
fillchar = ' ';
attr = 0;
attr = HL_ATTR(HLF_MSG);
}
use_sandbox = was_set_insecurely((char_u *)"rulerformat", 0);
@ -5195,13 +5201,13 @@ win_redr_custom (
/*
* Draw each snippet with the specified highlighting.
*/
grid_puts_line_start(&default_grid, row);
grid_puts_line_start(grid, row);
curattr = attr;
p = buf;
for (n = 0; hltab[n].start != NULL; n++) {
int textlen = (int)(hltab[n].start - p);
grid_puts_len(&default_grid, p, textlen, row, col, curattr);
grid_puts_len(grid, p, textlen, row, col, curattr);
col += vim_strnsize(p, textlen);
p = hltab[n].start;
@ -5215,7 +5221,7 @@ win_redr_custom (
curattr = highlight_user[hltab[n].userhl - 1];
}
// Make sure to use an empty string instead of p, if p is beyond buf + len.
grid_puts(&default_grid, p >= buf + len ? (char_u *)"" : p, row, col,
grid_puts(grid, p >= buf + len ? (char_u *)"" : p, row, col,
curattr);
grid_puts_line_flush(false);
@ -7060,7 +7066,7 @@ static void win_redr_ruler(win_T *wp, int always)
} else {
row = Rows - 1;
fillchar = ' ';
attr = 0;
attr = HL_ATTR(HLF_MSG);
width = Columns;
off = 0;
}

View File

@ -1508,11 +1508,11 @@ line_read_in:
* compute the first offset.
*/
if (state == TS_BINARY) {
// Get the tag file size.
if ((filesize = vim_lseek(fileno(fp), (off_T)0L, SEEK_END)) <= 0) {
if (vim_fseek(fp, 0, SEEK_END) != 0) {
state = TS_LINEAR;
} else {
vim_lseek(fileno(fp), (off_T)0L, SEEK_SET);
filesize = vim_ftell(fp);
vim_fseek(fp, 0, SEEK_SET);
/* Calculate the first read offset in the file. Start
* the search in the middle of the file. */

View File

@ -220,8 +220,6 @@ Terminal *terminal_open(TerminalOptions opts)
rv->sb_size = (size_t)curbuf->b_p_scbk;
rv->sb_buffer = xmalloc(sizeof(ScrollbackLine *) * rv->sb_size);
vterm_state_set_bold_highbright(state, true);
// Configure the color palette. Try to get the color from:
//
// - b:terminal_color_{NUM}

View File

@ -93,7 +93,7 @@ typedef struct {
int out_fd;
bool scroll_region_is_full_screen;
bool can_change_scroll_region;
bool can_set_lr_margin;
bool can_set_lr_margin; // smglr
bool can_set_left_right_margin;
bool can_scroll;
bool can_erase_chars;
@ -312,6 +312,7 @@ static void terminfo_start(UI *ui)
uv_pipe_init(&data->write_loop, &data->output_handle.pipe, 0);
uv_pipe_open(&data->output_handle.pipe, data->out_fd);
}
flush_buf(ui);
}
static void terminfo_stop(UI *ui)
@ -1598,6 +1599,12 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
unibi_set_if_empty(ut, unibi_set_lr_margin, "\x1b[%i%p1%d;%p2%ds");
unibi_set_if_empty(ut, unibi_set_left_margin_parm, "\x1b[%i%p1%ds");
unibi_set_if_empty(ut, unibi_set_right_margin_parm, "\x1b[%i;%p2%ds");
} else {
// Fix things advertised via TERM=xterm, for non-xterm.
if (unibi_get_str(ut, unibi_set_lr_margin)) {
ILOG("Disabling smglr with TERM=xterm for non-xterm.");
unibi_set_str(ut, unibi_set_lr_margin, NULL);
}
}
#ifdef WIN32

View File

@ -425,6 +425,15 @@ static void compose_line(Integer row, Integer startcol, Integer endcol,
flags = flags & ~kLineFlagWrap;
}
for (int i = skipstart; i < (endcol-skipend)-startcol; i++) {
if (attrbuf[i] < 0) {
if (rdb_flags & RDB_INVALID) {
abort();
} else {
attrbuf[i] = 0;
}
}
}
ui_composed_call_raw_line(1, row, startcol+skipstart,
endcol-skipend, endcol-skipend, 0, flags,
(const schar_T *)linebuf+skipstart,
@ -535,6 +544,11 @@ static void ui_comp_raw_line(UI *ui, Integer grid, Integer row,
} else {
compose_debug(row, row+1, startcol, endcol, dbghl_normal, false);
compose_debug(row, row+1, endcol, clearcol, dbghl_clear, true);
#ifndef NDEBUG
for (int i = 0; i < endcol-startcol; i++) {
assert(attrs[i] >= 0);
}
#endif
ui_composed_call_raw_line(1, row, startcol, endcol, clearcol, clearattr,
flags, chunk, attrs);
}

View File

@ -38,7 +38,7 @@ module.nvim_prog = (
module.nvim_set = (
'set shortmess+=IS background=light noswapfile noautoindent'
..' laststatus=1 undodir=. directory=. viewdir=. backupdir=.'
..' belloff= wildoptions-=pum noshowcmd noruler nomore')
..' belloff= wildoptions-=pum noshowcmd noruler nomore redrawdebug=invalid')
module.nvim_argv = {
module.nvim_prog, '-u', 'NONE', '-i', 'NONE',
'--cmd', module.nvim_set, '--embed'}

View File

@ -52,7 +52,7 @@ local function screen_setup(extra_rows, command, cols, opts)
[3] = {bold = true},
[4] = {foreground = 12},
[5] = {bold = true, reverse = true},
[6] = {background = 11},
-- 6 was a duplicate item
[7] = {foreground = 130},
[8] = {foreground = 15, background = 1}, -- error message
[9] = {foreground = 4},

View File

@ -578,6 +578,23 @@ describe('TUI', function()
]])
end)
it('paste: less-than sign in cmdline #11088', function()
local expected = '<'
feed_data(':')
wait_for_mode('c')
-- "bracketed paste"
feed_data('\027[200~'..expected..'\027[201~')
screen:expect{grid=[[
|
{4:~ }|
{4:~ }|
{4:~ }|
{5:[No Name] }|
:<{1: } |
{3:-- TERMINAL --} |
]]}
end)
it('paste: big burst of input', function()
feed_data(':set ruler\n')
local t = {}

View File

@ -31,6 +31,9 @@ describe('Buffer highlighting', function()
[14] = {background = Screen.colors.Gray90},
[15] = {background = Screen.colors.Gray90, bold = true, foreground = Screen.colors.Brown},
[16] = {foreground = Screen.colors.Magenta, background = Screen.colors.Gray90},
[17] = {foreground = Screen.colors.Magenta, background = Screen.colors.LightRed},
[18] = {background = Screen.colors.LightRed},
[19] = {foreground = Screen.colors.Blue1, background = Screen.colors.LightRed},
})
end)
@ -516,6 +519,32 @@ describe('Buffer highlighting', function()
|
]])
end)
it('works with color column', function()
eq(-1, set_virtual_text(-1, 3, {{"暗x事", "Comment"}}, {}))
screen:expect{grid=[[
^1 + 2 {3:=}{2: 3} |
3 + {11:ERROR:} invalid syntax |
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 {12:暗x事} |
{1:~ }|
{1:~ }|
|
]]}
command("set colorcolumn=9")
screen:expect{grid=[[
^1 + 2 {3:=}{2: }{17:3} |
3 + {11:ERROR:} invalid syntax |
5, 5, 5,{18: }5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 {12:暗}{19:x}{12:事} |
{1:~ }|
{1:~ }|
|
]]}
end)
end)
it('and virtual text use the same namespace counter', function()

View File

@ -3,6 +3,8 @@ local Screen = require('test.functional.ui.screen')
local feed = helpers.feed
local clear = helpers.clear
local command = helpers.command
local insert = helpers.insert
local write_file = helpers.write_file
describe('Diff mode screen', function()
@ -957,3 +959,75 @@ int main(int argc, char **argv)
end)
end)
end)
it('win_update redraws lines properly', function()
local screen
clear()
screen = Screen.new(30, 10)
screen:attach()
screen:set_default_attr_ids({
[1] = {bold = true, foreground = Screen.colors.Blue1},
[2] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
[3] = {background = Screen.colors.Red, foreground = Screen.colors.Grey100, special = Screen.colors.Yellow},
[4] = {bold = true, foreground = Screen.colors.SeaGreen4},
[5] = {special = Screen.colors.Yellow},
[6] = {special = Screen.colors.Yellow, bold = true, foreground = Screen.colors.SeaGreen4},
[7] = {foreground = Screen.colors.Grey0, background = Screen.colors.Grey100},
[8] = {foreground = Screen.colors.Gray90, background = Screen.colors.Grey100},
[9] = {foreground = tonumber('0x00000c'), background = Screen.colors.Grey100},
[10] = {background = Screen.colors.Grey100, bold = true, foreground = tonumber('0xe5e5ff')},
[11] = {background = Screen.colors.Grey100, bold = true, foreground = tonumber('0x2b8452')},
[12] = {bold = true, reverse = true},
[13] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray},
[14] = {reverse = true},
[15] = {background = Screen.colors.LightBlue},
[16] = {background = Screen.colors.LightCyan1, bold = true, foreground = Screen.colors.Blue1},
[17] = {bold = true, background = Screen.colors.Red},
[18] = {background = Screen.colors.LightMagenta},
})
insert([[
1
2
1a
]])
command("vnew")
insert([[
2
2a
2b
]])
command("windo diffthis")
command("windo 1")
screen:expect{grid=[[
{13: }{16:-------}{14:│}{13: }{15:^1 }|
{13: }{16:-------}{14:│}{13: }{15: }|
{13: }{16:-------}{14:│}{13: }{15: }|
{13: }2 {14:│}{13: }2 |
{13: }{17:2}{18:a }{14:│}{13: }{17:1}{18:a }|
{13: }{15:2b }{14:│}{13: }{16:------------------}|
{13: } {14:│}{13: } |
{1:~ }{14:│}{1:~ }|
{14:<me] [+] }{12:[No Name] [+] }|
|
]]}
feed('<C-e>')
feed('<C-e>')
feed('<C-y>')
feed('<C-y>')
feed('<C-y>')
screen:expect{grid=[[
{13: }{16:-------}{14:│}{13: }{15:1 }|
{13: }{16:-------}{14:│}{13: }{15: }|
{13: }{16:-------}{14:│}{13: }{15:^ }|
{13: }2 {14:│}{13: }2 |
{13: }{17:2}{18:a }{14:│}{13: }{17:1}{18:a }|
{13: }{15:2b }{14:│}{13: }{16:------------------}|
{13: } {14:│}{13: } |
{1:~ }{14:│}{1:~ }|
{14:<me] [+] }{12:[No Name] [+] }|
|
]]}
end)

View File

@ -810,6 +810,7 @@ describe('ui/builtin messages', function()
[4] = {bold = true, foreground = Screen.colors.SeaGreen4},
[5] = {foreground = Screen.colors.Blue1},
[6] = {bold = true, foreground = Screen.colors.Magenta},
[7] = {background = Screen.colors.Grey20},
})
end)
@ -902,6 +903,41 @@ vimComment xxx match /\s"[^\-:.%#=*].*$/ms=s+1,lc=1 excludenl contains=@vim
meths.command_output('syntax list vimComment'))
-- luacheck: pop
end)
it('supports ruler with laststatus=0', function()
command("set ruler laststatus=0")
screen:expect{grid=[[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
0,0-1 All |
]]}
command("hi MsgArea guibg=#333333")
screen:expect{grid=[[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{7: 0,0-1 All }|
]]}
command("set rulerformat=%15(%c%V\\ %p%%%)")
screen:expect{grid=[[
^ |
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{1:~ }|
{7: 0,0-1 100% }|
]]}
end)
end)
describe('ui/ext_messages', function()
@ -1089,7 +1125,7 @@ aliquip ex ea commodo consequat.]])
it('can be quit', function()
screen:try_resize(25,5)
feed(':echon join(map(range(0, &lines*2), "v:val"), "\\n")<cr>')
feed(':echon join(map(range(0, &lines*10), "v:val"), "\\n")<cr>')
screen:expect{grid=[[
0 |
1 |

View File

@ -516,6 +516,7 @@ describe('ui/ext_popupmenu', function()
{1:~ }|
:sign ^ |
]])
eq(0, funcs.wildmenumode())
feed('<tab>')
screen:expect{grid=[[
@ -530,6 +531,7 @@ describe('ui/ext_popupmenu', function()
{1:~ }|
:sign define^ |
]], popupmenu={items=wild_expected, pos=0, anchor={1, 9, 6}}}
eq(1, funcs.wildmenumode())
feed('<left>')
screen:expect{grid=[[
@ -589,6 +591,7 @@ describe('ui/ext_popupmenu', function()
:sign unplace^ |
]], popupmenu={items=wild_expected, pos=5, anchor={1, 9, 6}}}
feed('<esc>')
eq(0, funcs.wildmenumode())
-- check positioning with multibyte char in pattern
command("e långfile1")

View File

@ -1,6 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
local eq = helpers.eq
local insert = helpers.insert
describe('Screen', function()
@ -17,6 +18,7 @@ describe('Screen', function()
[3] = {reverse = true},
[4] = {bold = true},
[5] = {background = Screen.colors.Yellow},
[6] = {background = Screen.colors.LightGrey},
} )
end)
@ -823,5 +825,96 @@ describe('Screen', function()
]])
end)
end)
it('redraws properly with concealcursor in visual mode', function()
command('set concealcursor=v conceallevel=2')
feed('10Ofoo barf bar barf eggs<esc>')
feed(':3<cr>o a<Esc>ggV')
screen:expect{grid=[[
^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
a |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
{4:-- VISUAL LINE --} |
]]}
feed(string.rep('j', 15))
screen:expect{grid=[[
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
{6:foo }{1:b}{6: bar }{1:b}{6: eggs} |
^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
{4:-- VISUAL LINE --} |
]]}
feed(string.rep('k', 15))
screen:expect{grid=[[
^f{6:oo }{1:b}{6: bar }{1:b}{6: eggs} |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
a |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
foo {1:b} bar {1:b} eggs |
{4:-- VISUAL LINE --} |
]]}
end)
end)
it('redraws not too much with conceallevel=1', function()
command('set conceallevel=1')
command('set redrawdebug+=nodelta')
insert([[
aaa
bbb
ccc
]])
screen:expect{grid=[[
aaa |
bbb |
ccc |
^ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
|
]]}
-- XXX: hack to get notifications, and check only a single line is
-- updated. Could use next_msg() also.
local orig_handle_grid_line = screen._handle_grid_line
local grid_lines = {}
function screen._handle_grid_line(self, grid, row, col, items)
table.insert(grid_lines, {row, col, items})
orig_handle_grid_line(self, grid, row, col, items)
end
feed('k')
screen:expect{grid=[[
aaa |
bbb |
^ccc |
|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
|
]]}
eq(grid_lines, {{2, 0, {{'c', 0, 3}}}})
end)
end)

View File

@ -160,8 +160,8 @@ set(UNIBILIUM_SHA256 29815283c654277ef77a3adcc8840db79ddbb20a0f0b0c8f648bd8cd49a
set(LIBTERMKEY_URL http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.21.1.tar.gz)
set(LIBTERMKEY_SHA256 cecbf737f35d18f433c8d7864f63c0f878af41f8bd0255a3ebb16010dc044d5f)
set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/4a5fa43e0dbc0db4fe67d40d788d60852864df9e.tar.gz)
set(LIBVTERM_SHA256 49b3cf2dcb988b887671b1011cfeac98ff81bb5c23fb4ac34b91a59524992935)
set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/7c72294d84ce20da4c27362dbd7fa4b08cfc91da.tar.gz)
set(LIBVTERM_SHA256 f30c4d43e0c6db3e0912daf7188d98fbf6ee88f97589d72f6f304e5db48826a8)
set(LUV_VERSION 1.30.0-0)
set(LUV_URL https://github.com/luvit/luv/archive/${LUV_VERSION}.tar.gz)
@ -177,8 +177,8 @@ set(GPERF_SHA256 588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae
set(WINTOOLS_URL https://github.com/neovim/deps/raw/2f9acbecf06365c10baa3c0087f34a54c9c6f949/opt/win32tools.zip)
set(WINTOOLS_SHA256 8bfce7e3a365721a027ce842f2ec1cf878f1726233c215c05964aac07300798c)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.14/neovim-qt.zip)
set(WINGUI_SHA256 dfcb1f7d25d4907dc1d4f20edd71ff9eb4762196225106bec01274dd668fb04c)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.15/neovim-qt.zip)
set(WINGUI_SHA256 b519ecb80b60522d25043f2d076a55656f5fbe5adf7f7e2943e5d8b161043987)
set(WIN32YANK_X86_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x86.zip)
set(WIN32YANK_X86_SHA256 62f34e5a46c5d4a7b3f3b512e1ff7b77fedd432f42581cbe825233a996eed62c)

View File

@ -48,6 +48,7 @@ ExternalProject_Add(libtermkey
PREFIX=${DEPS_INSTALL_DIR}
PKG_CONFIG_PATH=${DEPS_LIB_DIR}/pkgconfig
CFLAGS=-fPIC
LDFLAGS+=-static
${DEFAULT_MAKE_CFLAGS}
install)
endif()

View File

@ -58,6 +58,7 @@ else()
set(LIBVTERM_INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS=-fPIC
LDFLAGS+=-static
${DEFAULT_MAKE_CFLAGS}
install)
endif()

View File

@ -40,6 +40,7 @@ else()
BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS=-fPIC
LDFLAGS+=-static
INSTALL_COMMAND ${MAKE_PRG} PREFIX=${DEPS_INSTALL_DIR} install)
endif()