diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/api/private/helpers.c | 2 | ||||
-rw-r--r-- | src/nvim/api/vim.c | 2 | ||||
-rw-r--r-- | src/nvim/buffer.c | 67 | ||||
-rw-r--r-- | src/nvim/change.c | 2 | ||||
-rw-r--r-- | src/nvim/edit.c | 2 | ||||
-rw-r--r-- | src/nvim/eval.c | 1 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 6 | ||||
-rw-r--r-- | src/nvim/extmark.c (renamed from src/nvim/mark_extended.c) | 4 | ||||
-rw-r--r-- | src/nvim/extmark.h (renamed from src/nvim/mark_extended.h) | 10 | ||||
-rw-r--r-- | src/nvim/extmark_defs.h (renamed from src/nvim/mark_extended_defs.h) | 6 | ||||
-rw-r--r-- | src/nvim/fold.c | 2 | ||||
-rw-r--r-- | src/nvim/indent.c | 2 | ||||
-rw-r--r-- | src/nvim/map.h | 2 | ||||
-rw-r--r-- | src/nvim/mark.c | 2 | ||||
-rw-r--r-- | src/nvim/mark.h | 2 | ||||
-rw-r--r-- | src/nvim/ops.c | 2 | ||||
-rw-r--r-- | src/nvim/option.c | 11 | ||||
-rw-r--r-- | src/nvim/screen.c | 8 | ||||
-rw-r--r-- | src/nvim/undo.c | 2 | ||||
-rw-r--r-- | src/nvim/undo_defs.h | 2 |
23 files changed, 73 insertions, 70 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index 3106011fe2..a666ed92da 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -26,7 +26,7 @@ #include "nvim/map_defs.h" #include "nvim/map.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/fileio.h" #include "nvim/move.h" #include "nvim/syntax.h" diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 37e31e0807..a1745ef777 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -24,7 +24,7 @@ #include "nvim/eval/typval.h" #include "nvim/map_defs.h" #include "nvim/map.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/option.h" #include "nvim/option_defs.h" #include "nvim/version.h" diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index baa0387fd8..9c58ce853b 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -40,7 +40,7 @@ #include "nvim/ops.h" #include "nvim/option.h" #include "nvim/state.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/syntax.h" #include "nvim/getchar.h" #include "nvim/os/input.h" diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 837fcb5cc1..5083780719 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -53,7 +53,7 @@ #include "nvim/indent_c.h" #include "nvim/main.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" @@ -3068,18 +3068,15 @@ void col_print(char_u *buf, size_t buflen, int col, int vcol) } } -/* - * put file name in title bar of window and in icon title - */ - static char_u *lasttitle = NULL; static char_u *lasticon = NULL; + +// Put the title name in the title bar and icon of the window. void maketitle(void) { - char_u *t_str = NULL; - char_u *i_name; - char_u *i_str = NULL; + char_u *title_str = NULL; + char_u *icon_str = NULL; int maxlen = 0; int len; int mustset; @@ -3093,7 +3090,7 @@ void maketitle(void) need_maketitle = false; if (!p_title && !p_icon && lasttitle == NULL && lasticon == NULL) { - return; + return; // nothing to do } if (p_title) { @@ -3114,14 +3111,14 @@ void maketitle(void) build_stl_str_hl(curwin, (char_u *)buf, sizeof(buf), p_titlestring, use_sandbox, 0, maxlen, NULL, NULL); - t_str = (char_u *)buf; + title_str = (char_u *)buf; if (called_emsg) { set_string_option_direct((char_u *)"titlestring", -1, (char_u *)"", OPT_FREE, SID_ERROR); } called_emsg |= save_called_emsg; } else { - t_str = p_titlestring; + title_str = p_titlestring; } } else { // Format: "fname + (path) (1 of 2) - VIM". @@ -3205,16 +3202,16 @@ void maketitle(void) trunc_string((char_u *)buf, (char_u *)buf, maxlen, sizeof(buf)); } } - t_str = (char_u *)buf; + title_str = (char_u *)buf; #undef SPACE_FOR_FNAME #undef SPACE_FOR_DIR #undef SPACE_FOR_ARGNR } } - mustset = ti_change(t_str, &lasttitle); + mustset = value_change(title_str, &lasttitle); if (p_icon) { - i_str = (char_u *)buf; + icon_str = (char_u *)buf; if (*p_iconstring != NUL) { if (stl_syntax & STL_IN_ICON) { int use_sandbox = false; @@ -3222,37 +3219,40 @@ void maketitle(void) use_sandbox = was_set_insecurely((char_u *)"iconstring", 0); called_emsg = false; - build_stl_str_hl(curwin, i_str, sizeof(buf), - p_iconstring, use_sandbox, - 0, 0, NULL, NULL); - if (called_emsg) + build_stl_str_hl(curwin, icon_str, sizeof(buf), + p_iconstring, use_sandbox, + 0, 0, NULL, NULL); + if (called_emsg) { set_string_option_direct((char_u *)"iconstring", -1, - (char_u *)"", OPT_FREE, SID_ERROR); + (char_u *)"", OPT_FREE, SID_ERROR); + } called_emsg |= save_called_emsg; - } else - i_str = p_iconstring; + } else { + icon_str = p_iconstring; + } } else { + char_u *buf_p; if (buf_spname(curbuf) != NULL) { - i_name = buf_spname(curbuf); + buf_p = buf_spname(curbuf); } else { // use file name only in icon - i_name = path_tail(curbuf->b_ffname); + buf_p = path_tail(curbuf->b_ffname); } - *i_str = NUL; + *icon_str = NUL; // Truncate name at 100 bytes. - len = (int)STRLEN(i_name); + len = (int)STRLEN(buf_p); if (len > 100) { len -= 100; if (has_mbyte) { - len += (*mb_tail_off)(i_name, i_name + len) + 1; + len += (*mb_tail_off)(buf_p, buf_p + len) + 1; } - i_name += len; + buf_p += len; } - STRCPY(i_str, i_name); - trans_characters(i_str, IOSIZE); + STRCPY(icon_str, buf_p); + trans_characters(icon_str, IOSIZE); } } - mustset |= ti_change(i_str, &lasticon); + mustset |= value_change(icon_str, &lasticon); if (mustset) { resettitle(); @@ -3266,8 +3266,8 @@ void maketitle(void) /// @param str desired title string /// @param[in,out] last current title string // -/// @return true when "*last" changed. -static bool ti_change(char_u *str, char_u **last) +/// @return true if resettitle() is to be called. +static bool value_change(char_u *str, char_u **last) FUNC_ATTR_WARN_UNUSED_RESULT { if ((str == NULL) != (*last == NULL) @@ -3275,10 +3275,11 @@ static bool ti_change(char_u *str, char_u **last) xfree(*last); if (str == NULL) { *last = NULL; + resettitle(); } else { *last = vim_strsave(str); + return true; } - return true; } return false; } diff --git a/src/nvim/change.c b/src/nvim/change.c index 7eb6ea7328..a341b8fce1 100644 --- a/src/nvim/change.c +++ b/src/nvim/change.c @@ -17,7 +17,7 @@ #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/memline.h" #include "nvim/misc1.h" #include "nvim/move.h" diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 0c183add16..68fa99484c 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -28,7 +28,7 @@ #include "nvim/indent.h" #include "nvim/indent_c.h" #include "nvim/main.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 5eec44a7b7..9379d94fa3 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -24611,6 +24611,7 @@ bool eval_has_provider(const char *feat) && !strequal(feat, "python_dynamic") && !strequal(feat, "python3_compiled") && !strequal(feat, "python3_dynamic") + && !strequal(feat, "perl") && !strequal(feat, "ruby") && !strequal(feat, "node")) { // Avoid autoload for non-provider has() features. diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 53caaa6a67..bc6821f60f 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -40,7 +40,7 @@ #include "nvim/buffer_updates.h" #include "nvim/main.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/message.h" diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 6bda62594e..02bee838d5 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4651,6 +4651,8 @@ static int get_tabpage_arg(exarg_T *eap) if (relative == 0) { if (STRCMP(p, "$") == 0) { tab_number = LAST_TAB_NR; + } else if (STRCMP(p, "#") == 0) { + tab_number = tabpage_index(lastused_tabpage); } else if (p == p_save || *p_save == '-' || *p != NUL || tab_number > LAST_TAB_NR) { // No numbers as argument. diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 551482dab3..e6b7bfaebf 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -941,8 +941,10 @@ static int command_line_execute(VimState *state, int key) // if 'wildmode' contains "list" may still need to list if (s->xpc.xp_numfiles > 1 && !s->did_wild_list - && (wim_flags[s->wim_index] & WIM_LIST)) { - (void)showmatches(&s->xpc, false); + && ((wim_flags[s->wim_index] & WIM_LIST) + || (p_wmnu && (wim_flags[s->wim_index] & WIM_FULL) != 0))) { + (void)showmatches(&s->xpc, p_wmnu + && ((wim_flags[s->wim_index] & WIM_LIST) == 0)); redrawcmd(); s->did_wild_list = true; } diff --git a/src/nvim/mark_extended.c b/src/nvim/extmark.c index b60d847676..d60723c755 100644 --- a/src/nvim/mark_extended.c +++ b/src/nvim/extmark.c @@ -32,7 +32,7 @@ #include "nvim/api/vim.h" #include "nvim/vim.h" #include "nvim/charset.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/buffer_updates.h" #include "nvim/memline.h" #include "nvim/pos.h" @@ -45,7 +45,7 @@ #include "nvim/highlight.h" #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "mark_extended.c.generated.h" +# include "extmark.c.generated.h" #endif static ExtmarkNs *buf_ns_ref(buf_T *buf, uint64_t ns_id, bool put) { diff --git a/src/nvim/mark_extended.h b/src/nvim/extmark.h index f809148d9b..829cbe0236 100644 --- a/src/nvim/mark_extended.h +++ b/src/nvim/extmark.h @@ -1,8 +1,8 @@ -#ifndef NVIM_MARK_EXTENDED_H -#define NVIM_MARK_EXTENDED_H +#ifndef NVIM_EXTMARK_H +#define NVIM_EXTMARK_H #include "nvim/buffer_defs.h" -#include "nvim/mark_extended_defs.h" +#include "nvim/extmark_defs.h" #include "nvim/marktree.h" EXTERN int extmark_splice_pending INIT(= 0); @@ -87,7 +87,7 @@ typedef struct { #ifdef INCLUDE_GENERATED_DECLARATIONS -# include "mark_extended.h.generated.h" +# include "extmark.h.generated.h" #endif -#endif // NVIM_MARK_EXTENDED_H +#endif // NVIM_EXTMARK_H diff --git a/src/nvim/mark_extended_defs.h b/src/nvim/extmark_defs.h index 439f7f0b36..c927048981 100644 --- a/src/nvim/mark_extended_defs.h +++ b/src/nvim/extmark_defs.h @@ -1,5 +1,5 @@ -#ifndef NVIM_MARK_EXTENDED_DEFS_H -#define NVIM_MARK_EXTENDED_DEFS_H +#ifndef NVIM_EXTMARK_DEFS_H +#define NVIM_EXTMARK_DEFS_H #include "nvim/pos.h" // for colnr_T #include "nvim/lib/kvec.h" @@ -34,4 +34,4 @@ typedef enum { kExtmarkUndoNoRedo, // Operation should be undoable, but not redoable } ExtmarkOp; -#endif // NVIM_MARK_EXTENDED_DEFS_H +#endif // NVIM_EXTMARK_DEFS_H diff --git a/src/nvim/fold.c b/src/nvim/fold.c index addfab8f08..0b14a6affb 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -22,7 +22,7 @@ #include "nvim/func_attr.h" #include "nvim/indent.h" #include "nvim/buffer_updates.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mark.h" #include "nvim/memline.h" #include "nvim/memory.h" diff --git a/src/nvim/indent.c b/src/nvim/indent.c index 2c5fdd8ea6..f8018c039d 100644 --- a/src/nvim/indent.c +++ b/src/nvim/indent.c @@ -13,7 +13,7 @@ #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/memline.h" #include "nvim/memory.h" #include "nvim/misc1.h" diff --git a/src/nvim/map.h b/src/nvim/map.h index 761938776d..0ad7865bf0 100644 --- a/src/nvim/map.h +++ b/src/nvim/map.h @@ -4,7 +4,7 @@ #include <stdbool.h> #include "nvim/map_defs.h" -#include "nvim/mark_extended_defs.h" +#include "nvim/extmark_defs.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/dispatch.h" #include "nvim/highlight_defs.h" diff --git a/src/nvim/mark.c b/src/nvim/mark.c index 4a7452493a..fa7c7d61c9 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -20,7 +20,7 @@ #include "nvim/ex_cmds.h" #include "nvim/fileio.h" #include "nvim/fold.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" diff --git a/src/nvim/mark.h b/src/nvim/mark.h index d8370c367a..b3d9b5d95a 100644 --- a/src/nvim/mark.h +++ b/src/nvim/mark.h @@ -6,7 +6,7 @@ #include "nvim/buffer_defs.h" #include "nvim/func_attr.h" #include "nvim/mark_defs.h" -#include "nvim/mark_extended_defs.h" +#include "nvim/extmark_defs.h" #include "nvim/memory.h" #include "nvim/pos.h" #include "nvim/os/time.h" diff --git a/src/nvim/ops.c b/src/nvim/ops.c index da2b81fd0a..641323ae5e 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -31,7 +31,7 @@ #include "nvim/indent.h" #include "nvim/log.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" diff --git a/src/nvim/option.c b/src/nvim/option.c index 2871a4b7de..f03dcc2bf2 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2021,13 +2021,10 @@ static char_u *check_cedit(void) // maketitle() to create and display it. // When switching the title or icon off, call ui_set_{icon,title}(NULL) to get // the old value back. -static void did_set_title( - int icon // Did set icon instead of title -) +static void did_set_title(void) { if (starting != NO_SCREEN) { maketitle(); - resettitle(); } } @@ -2986,7 +2983,7 @@ ambw_end: } else { stl_syntax &= ~flagval; } - did_set_title(varp == &p_iconstring); + did_set_title(); } else if (varp == &p_sel) { // 'selection' if (*p_sel == NUL @@ -4025,9 +4022,9 @@ static char *set_bool_option(const int opt_idx, char_u *const varp, (void)buf_init_chartab(curbuf, false); // ignore errors } else if ((int *)varp == &p_title) { // when 'title' changed, may need to change the title; same for 'icon' - did_set_title(false); + did_set_title(); } else if ((int *)varp == &p_icon) { - did_set_title(true); + did_set_title(); } else if ((int *)varp == &curbuf->b_changed) { if (!value) { save_file_ff(curbuf); // Buffer is unchanged diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 047af8db75..a451451726 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -87,7 +87,7 @@ #include "nvim/highlight.h" #include "nvim/main.h" #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" @@ -2130,11 +2130,11 @@ fill_foldcolumn( if (closed) { if (symbol != 0) { - // rollback length + // rollback previous write char_counter -= len; + memset(&p[char_counter], ' ', len); } - symbol = wp->w_p_fcs_chars.foldclosed; - len = utf_char2bytes(symbol, &p[char_counter]); + len = utf_char2bytes(wp->w_p_fcs_chars.foldclosed, &p[char_counter]); char_counter += len; } diff --git a/src/nvim/undo.c b/src/nvim/undo.c index fda647106d..1f74bada41 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -93,7 +93,7 @@ #include "nvim/buffer_updates.h" #include "nvim/pos.h" // MAXLNUM #include "nvim/mark.h" -#include "nvim/mark_extended.h" +#include "nvim/extmark.h" #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" diff --git a/src/nvim/undo_defs.h b/src/nvim/undo_defs.h index 0fa3b415ec..cc2c39a711 100644 --- a/src/nvim/undo_defs.h +++ b/src/nvim/undo_defs.h @@ -4,7 +4,7 @@ #include <time.h> // for time_t #include "nvim/pos.h" -#include "nvim/mark_extended_defs.h" +#include "nvim/extmark_defs.h" #include "nvim/mark_defs.h" typedef struct u_header u_header_T; |