diff options
| -rw-r--r-- | runtime/doc/map.txt | 5 | ||||
| -rw-r--r-- | src/nvim/buffer.c | 18 | ||||
| -rw-r--r-- | src/nvim/ex_cmds.lua | 20 | ||||
| -rw-r--r-- | src/nvim/screen.c | 12 | 
4 files changed, 33 insertions, 22 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 <M-C> foo  	:set encoding=utf-8  The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3 -byte.  If you type the character á (0xe1 <M-a>) in UTF-8 encoding this is the +byte.  If you type the character á (0xe1 <M-a>) 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.  					*<Leader>* *mapleader*  To define a mapping which uses the "mapleader" variable, the special string diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index cae053f015..043ae420cd 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) { @@ -5233,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]");    } 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 @@ -2799,6 +2799,12 @@ return {      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),      addr_type=ADDR_LINES, @@ -2811,12 +2817,6 @@ return {      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),      addr_type=ADDR_LINES, @@ -2859,16 +2859,16 @@ return {      func='ex_tag',    },    { -    command='tunmap', +    command='tunmenu',      flags=bit.bor(EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN),      addr_type=ADDR_LINES, -    func='ex_unmap', +    func='ex_menu',    },    { -    command='tunmenu', +    command='tunmap',      flags=bit.bor(EXTRA, TRLBAR, NOTRLCOM, USECTRLV, CMDWIN),      addr_type=ADDR_LINES, -    func='ex_menu', +    func='ex_unmap',    },    {      command='undo', 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;  }  /*  | 
