diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-02-25 21:45:02 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-02-25 21:45:02 +0000 |
commit | ba6c05240fc0333f3e2249ca8a6b7d51bdad2316 (patch) | |
tree | ec2dc1699cf8f7a11e74ff2b91586abe030ddede /src | |
parent | 32466aa2e9c45ab355dbaf99a9eedf334bc2e29f (diff) | |
download | vim-git-ba6c05240fc0333f3e2249ca8a6b7d51bdad2316.tar.gz |
updated for version 7.0207
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer.c | 12 | ||||
-rw-r--r-- | src/normal.c | 40 | ||||
-rw-r--r-- | src/window.c | 2 |
3 files changed, 48 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c index 101d33f83..697599abb 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3197,7 +3197,7 @@ free_titles() #endif /* FEAT_TITLE */ -#if defined(FEAT_STL_OPT) || defined(PROTO) +#if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO) /* * Build a string from the status line items in "fmt". * Return length of string in screen cells. @@ -3212,10 +3212,11 @@ free_titles() * If maxwidth is not zero, the string will be filled at any middle marker * or truncated if too long, fillchar is used for all whitespace. */ +/*ARGSUSED*/ int build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, tabtab) win_T *wp; - char_u *out; /* buffer to write into */ + char_u *out; /* buffer to write into != NameBuff */ size_t outlen; /* length of out[] */ char_u *fmt; int use_sandbox; /* "fmt" was set insecurely, use sandbox */ @@ -3632,8 +3633,8 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t str = tmp; break; case STL_PAGENUM: -#ifdef FEAT_PRINTER - num = get_printer_page_num(); +#if defined(FEAT_PRINTER) || defined(FEAT_WINDOWS) + num = printer_page_num; #else num = 0; #endif @@ -4020,7 +4021,8 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t } #endif /* FEAT_STL_OPT */ -#if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) || defined(PROTO) +#if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \ + || defined(FEAT_GUI_TABLINE) || defined(PROTO) /* * Get relative cursor position in window into "str[]", in the form 99%, using * "Top", "Bot" or "All" when appropriate. diff --git a/src/normal.c b/src/normal.c index cc9d0d165..405f55867 100644 --- a/src/normal.c +++ b/src/normal.c @@ -76,6 +76,7 @@ static void nv_hor_scrollbar __ARGS((cmdarg_T *cap)); #endif #ifdef FEAT_GUI_TABLINE static void nv_tabline __ARGS((cmdarg_T *cap)); +static void nv_tabmenu __ARGS((cmdarg_T *cap)); #endif static void nv_exmode __ARGS((cmdarg_T *cap)); static void nv_colon __ARGS((cmdarg_T *cap)); @@ -423,6 +424,7 @@ static const struct nv_cmd #endif #ifdef FEAT_GUI_TABLINE {K_TABLINE, nv_tabline, 0, 0}, + {K_TABMENU, nv_tabmenu, 0, 0}, #endif #ifdef FEAT_FKMAP {K_F8, farsi_fkey, 0, 0}, @@ -4997,6 +4999,44 @@ nv_tabline(cap) /* Even if an operator was pending, we still want to jump tabs. */ goto_tabpage(current_tab); } + +/* + * Selected item in tab line menu. + */ + static void +nv_tabmenu(cap) + cmdarg_T *cap; +{ + if (cap->oap->op_type != OP_NOP) + clearopbeep(cap->oap); + + /* Even if an operator was pending, we still want to jump tabs. */ + switch (current_tabmenu) + { + case TABLINE_MENU_CLOSE: + if (current_tab == 0) + do_cmdline_cmd((char_u *)"tabclose"); + else + { + vim_snprintf((char *)IObuff, IOSIZE, "tabclose %d", + current_tab); + do_cmdline_cmd(IObuff); + } + break; + + case TABLINE_MENU_NEW: + if (current_tab > 0) + goto_tabpage(current_tab); + do_cmdline_cmd((char_u *)"tabnew"); + break; + + case TABLINE_MENU_OPEN: + if (current_tab > 0) + goto_tabpage(current_tab); + do_cmdline_cmd((char_u *)"browse tabnew"); + break; + } +} #endif /* diff --git a/src/window.c b/src/window.c index f0a4265b0..0c0fb30d5 100644 --- a/src/window.c +++ b/src/window.c @@ -3143,7 +3143,7 @@ find_tabpage(n) /* * Get index of tab page "tp". First one has index 1. - * When not found returns number of tab pages. + * When not found returns number of tab pages plus one. */ int tabpage_index(ftp) |