diff options
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f8413c32fa..34e24712cd 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2846,7 +2846,7 @@ int build_stl_str_hl( struct stl_item { // Where the item starts in the status line output buffer char_u *start; - // Command to run for ClickCmd items. + // Function to run for ClickFunc items. char *cmd; // The minimum width of the item int minwid; @@ -2859,7 +2859,7 @@ int build_stl_str_hl( Middle, Highlight, TabPage, - ClickCmd, + ClickFunc, Trunc } type; } item[STL_MAX_ITEM]; @@ -3167,17 +3167,19 @@ int build_stl_str_hl( continue; } - if (*fmt_p == STL_CLICK_CMD) { + if (*fmt_p == STL_CLICK_FUNC) { + fmt_p++; char *t = (char *) fmt_p; - while (*fmt_p != ']' && *fmt_p) { + while (*fmt_p != STL_CLICK_FUNC && *fmt_p) { fmt_p++; } - if (*fmt_p != ']') { + if (*fmt_p != STL_CLICK_FUNC) { break; } - item[curitem].type = ClickCmd; + item[curitem].type = ClickFunc; item[curitem].start = out_p; - item[curitem].cmd = xmemdupz(t + 1, (size_t) (((char *) fmt_p - t) - 1)); + item[curitem].cmd = xmemdupz(t, (size_t) (((char *) fmt_p - t))); + item[curitem].minwid = minwid; fmt_p++; curitem++; continue; @@ -3858,20 +3860,20 @@ int build_stl_str_hl( } cur_tab_rec->def.tabnr = tabnr; } - cur_tab_rec->def.cmd = NULL; + cur_tab_rec->def.func = NULL; cur_tab_rec++; - } else if (item[l].type == ClickCmd) { + } else if (item[l].type == ClickFunc) { cur_tab_rec->start = (char *) item[l].start; - cur_tab_rec->def.type = kStlClickCmd; - cur_tab_rec->def.tabnr = 0; - cur_tab_rec->def.cmd = item[l].cmd; + cur_tab_rec->def.type = kStlClickFuncRun; + cur_tab_rec->def.tabnr = item[l].minwid; + cur_tab_rec->def.func = item[l].cmd; cur_tab_rec++; } } cur_tab_rec->start = NULL; cur_tab_rec->def.type = kStlClickDisabled; cur_tab_rec->def.tabnr = 0; - cur_tab_rec->def.cmd = NULL; + cur_tab_rec->def.func = NULL; } return width; |