From 59b35d6a10bed9bd789274b6f1fe15de7c9c2bd9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 26 Jun 2019 20:25:51 -0400 Subject: [PATCH 1/4] vim-patch:8.0.0935: cannot recognize a terminal buffer in :ls output Problem: Cannot recognize a terminal buffer in :ls output. Solution: Use R for a running job and F for a finished job. https://github.com/vim/vim/commit/304b64c9e6957fa3f552e0540ca786139b39a1c4 --- src/nvim/buffer.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index cae053f015..6a2c06b91f 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2605,14 +2605,22 @@ void buflist_list(exarg_T *eap) continue; } + const int changed_char = (buf->b_flags & BF_READERR) + ? 'x' + : (bufIsChanged(buf) ? '+' : ' '); + const int ro_char = !MODIFIABLE(buf) + ? '-' + : (buf->b_p_ro ? '=' : ' '); + msg_putchar('\n'); - len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", + len = vim_snprintf( + (char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", buf->b_fnum, buf->b_p_bl ? ' ' : 'u', buf == curbuf ? '%' : (curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '), buf->b_ml.ml_mfp == NULL ? ' ' : (buf->b_nwindows == 0 ? 'h' : 'a'), - !MODIFIABLE(buf) ? '-' : (buf->b_p_ro ? '=' : ' '), - (buf->b_flags & BF_READERR) ? 'x' : (bufIsChanged(buf) ? '+' : ' '), + ro_char, + changed_char, NameBuff); if (len > IOSIZE - 20) { From 58cf81914da3fbcc875cbd4954b62a314be31c9a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 26 Jun 2019 20:50:08 -0400 Subject: [PATCH 2/4] vim-patch:8.0.1013: terminal window behaves different from a buffer with changes Problem: A terminal window with a running job behaves different from a window containing a changed buffer. Solution: Do not set 'bufhidden' to "hide". Fix that a buffer where a terminal used to run is listed as "[Scratch]". https://github.com/vim/vim/commit/e561a7e2fa511d643c9692d26f4cf65378fd1983 --- src/nvim/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 6a2c06b91f..043ae420cd 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -5241,8 +5241,8 @@ char_u *buf_spname(buf_T *buf) // There is no _file_ when 'buftype' is "nofile", b_sfname // contains the name as specified by the user. if (bt_nofile(buf)) { - if (buf->b_sfname != NULL) { - return buf->b_sfname; + if (buf->b_fname != NULL) { + return buf->b_fname; } return (char_u *)_("[Scratch]"); } From 2b400daca38b69e9d1dc76d97fa9391e2764b400 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 26 Jun 2019 21:43:57 -0400 Subject: [PATCH 3/4] vim-patch:8.0.1100: stuck in redraw loop when 'lazyredraw' is set Problem: Stuck in redraw loop when 'lazyredraw' is set. Solution: Don't loop on update_screen() when not redrawing. (Yasuhiro Matsumoto, closes vim/vim#2082) https://github.com/vim/vim/commit/072412ed45aa20a67aaa7e387d7f6bf59c7d3fbe --- src/nvim/screen.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index d141520fef..19dff0a0f0 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -269,14 +269,14 @@ void update_curbuf(int type) /// and redraw_all_later() to mark parts of the screen as needing a redraw. /// /// @param type set to a NOT_VALID to force redraw of entire screen -void update_screen(int type) +int update_screen(int type) { static int did_intro = FALSE; int did_one; // Don't do anything if the screen structures are (not yet) valid. if (!default_grid.chars) { - return; + return FAIL; } if (must_redraw) { @@ -299,9 +299,10 @@ void update_screen(int type) if (!redrawing() || updating_screen) { redraw_later(type); /* remember type for next time */ must_redraw = type; - if (type > INVERTED_ALL) - curwin->w_lines_valid = 0; /* don't use w_lines[].wl_size now */ - return; + if (type > INVERTED_ALL) { + curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now + } + return FAIL; } updating_screen = TRUE; @@ -511,6 +512,7 @@ void update_screen(int type) // either cmdline is cleared, not drawn or mode is last drawn cmdline_was_last_drawn = false; + return OK; } /* From d555e44219f14477fbd066d0633aa5ab5912a509 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 27 Jun 2019 07:46:33 -0400 Subject: [PATCH 4/4] vim-patch:8.0.1120: :tm means :tmap instead of :tmenu Problem: :tm means :tmap instead of :tmenu. (Taro Muraoka) Solution: Move the new entry below the old entry. (closes vim/vim#2102) https://github.com/vim/vim/commit/63c4e8a1986796094e6f15b893f2deccdf482617 --- runtime/doc/map.txt | 5 +++-- src/nvim/ex_cmds.lua | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index eac42df791..74c9a2a003 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -438,6 +438,7 @@ When listing mappings the characters in the first two columns are: i Insert l ":lmap" mappings for Insert, Command-line and Lang-Arg c Command-line + t Terminal-Job Just before the {rhs} a special character can appear: * indicates that it is not remappable @@ -536,9 +537,9 @@ scenario: > :imap foo :set encoding=utf-8 The mapping for is defined with the latin1 encoding, resulting in a 0xc3 -byte. If you type the character á (0xe1 ) in UTF-8 encoding this is the +byte. If you type the character á (0xe1 ) in UTF-8 encoding this is the two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then or -otherwise it would be impossible to type the á character. +otherwise it would be impossible to type the á character. ** *mapleader* To define a mapping which uses the "mapleader" variable, the special string diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 58dc62e953..b1739b9e67 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -2798,6 +2798,12 @@ return { addr_type=ADDR_LINES, func='ex_tag', }, + { + command='tmenu', + flags=bit.bor(RANGE, NOTADR, ZEROR, EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN), + addr_type=ADDR_LINES, + func='ex_menu', + }, { command='tmap', flags=bit.bor(EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN), @@ -2810,12 +2816,6 @@ return { addr_type=ADDR_LINES, func='ex_mapclear', }, - { - command='tmenu', - flags=bit.bor(RANGE, NOTADR, ZEROR, EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN), - addr_type=ADDR_LINES, - func='ex_menu', - }, { command='tnext', flags=bit.bor(RANGE, NOTADR, BANG, TRLBAR, ZEROR), @@ -2858,18 +2858,18 @@ return { addr_type=ADDR_LINES, func='ex_tag', }, - { - command='tunmap', - flags=bit.bor(EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN), - addr_type=ADDR_LINES, - func='ex_unmap', - }, { command='tunmenu', flags=bit.bor(EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN), addr_type=ADDR_LINES, func='ex_menu', }, + { + command='tunmap', + flags=bit.bor(EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN), + addr_type=ADDR_LINES, + func='ex_unmap', + }, { command='undo', flags=bit.bor(RANGE, NOTADR, COUNT, ZEROR, TRLBAR, CMDWIN),