# HG changeset patch # User vimboss # Date 1140904353 0 # Node ID bcd2edc4539e4f84b645f52ad59d6f2b32b219fd # Parent d4b8e06e7c96c6a95239261f1a0dbc8dfae65252 updated for version 7.0207 diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 24 +*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1354,8 +1354,9 @@ v:lc_time The current locale setting for *v:lnum* *lnum-variable* v:lnum Line number for the 'foldexpr' |fold-expr| and 'indentexpr' - expressions. Only valid while one of these expressions is - being evaluated. Read-only when in the |sandbox|. + expressions, tab page number for 'guitablabel'. Only valid + while one of these expressions is being evaluated. Read-only + when in the |sandbox|. *v:prevcount* *prevcount-variable* v:prevcount The count given for the last but one Normal mode command. @@ -4599,7 +4600,8 @@ virtcol({expr}) *virtcol()* the . For example, for a in column 1, with 'ts' set to 8, it returns 8. For the use of {expr} see |col()|. Additionally you can use - [lnum, col]: a |List| with the line and column number. + [lnum, col]: a |List| with the line and column number. When + "lnum" or "col" is out of range then virtcol() returns zero. For the byte position use |col()|. When Virtual editing is active in the current mode, a position beyond the end of the line can be returned. |'virtualedit'| diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 24 +*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -3249,8 +3249,9 @@ A jump table for the options with a shor 'c' Use console dialogs instead of popup dialogs for simple choices. - 'e' Add tab pages when indicated with 'showtabpages'. When 'e' is - missing a non-GUI tab pages line may be used. + 'e' Add tab pages when indicated with 'showtabpages'. + 'guitablabel' can be used to change the text in the labels. + When 'e' is missing a non-GUI tab pages line may be used. 'f' Foreground: Don't use fork() to detach the GUI from the shell where it was started. Use this for programs that wait for the @@ -3312,6 +3313,18 @@ A jump table for the options with a shor Only in the GUI: If on, an attempt is made to open a pseudo-tty for I/O to/from shell commands. See |gui-pty|. + *'guitablabel'* *'gtl'* +'guitablabel' 'gtl' string (default empty) + global + {not in Vi} + When nonempty describes the text to use in a label of the GUI tab + pages line. When empty Vim will use a default label. See + |setting-guitablabel| for more info. + + Only used when the GUI tab pages line is displayed. 'e' must be + present in 'guioptions'. For the non-GUI tab pages line 'tabline' is + used. + *'helpfile'* *'hf'* 'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt" (others) "$VIMRUNTIME/doc/help.txt") @@ -6282,7 +6295,9 @@ A jump table for the options with a shor tab pages line. See |setting-tabline| for more info. The tab pages line only appears as specified with the 'showtabline' - option and only when there is no GUI implementation for tabs. + option and only when there is no GUI tab line. When 'e' is in + 'guioptions' and the GUI supports a tab line 'guitablabel' is used + instead. The value is evaluated like with 'statusline'. You can use |tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out diff --git a/runtime/doc/tags b/runtime/doc/tags --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -254,6 +254,7 @@ 'graphic' vi_diff.txt /*'graphic'* 'grepformat' options.txt /*'grepformat'* 'grepprg' options.txt /*'grepprg'* +'gtl' options.txt /*'gtl'* 'guicursor' options.txt /*'guicursor'* 'guifont' options.txt /*'guifont'* 'guifontset' options.txt /*'guifontset'* @@ -261,6 +262,7 @@ 'guiheadroom' options.txt /*'guiheadroom'* 'guioptions' options.txt /*'guioptions'* 'guipty' options.txt /*'guipty'* +'guitablabel' options.txt /*'guitablabel'* 'hardtabs' vi_diff.txt /*'hardtabs'* 'helpfile' options.txt /*'helpfile'* 'helpheight' options.txt /*'helpheight'* @@ -1481,6 +1483,7 @@ 08.5 usr_08.txt /*08.5* 08.6 usr_08.txt /*08.6* 08.7 usr_08.txt /*08.7* 08.8 usr_08.txt /*08.8* +08.9 usr_08.txt /*08.9* 09.1 usr_09.txt /*09.1* 09.2 usr_09.txt /*09.2* 09.3 usr_09.txt /*09.3* @@ -2648,10 +2651,16 @@ 90.5 usr_90.txt /*90.5* :tabNext tabpage.txt /*:tabNext* :tabc tabpage.txt /*:tabc* :tabclose tabpage.txt /*:tabclose* +:tabd tabpage.txt /*:tabd* +:tabdo tabpage.txt /*:tabdo* :tabe tabpage.txt /*:tabe* :tabedit tabpage.txt /*:tabedit* :tabf tabpage.txt /*:tabf* :tabfind tabpage.txt /*:tabfind* +:tabfir tabpage.txt /*:tabfir* +:tabfirst tabpage.txt /*:tabfirst* +:tabl tabpage.txt /*:tabl* +:tablast tabpage.txt /*:tablast* :tabm tabpage.txt /*:tabm* :tabmove tabpage.txt /*:tabmove* :tabn tabpage.txt /*:tabn* @@ -2661,6 +2670,8 @@ 90.5 usr_90.txt /*90.5* :tabonly tabpage.txt /*:tabonly* :tabp tabpage.txt /*:tabp* :tabprevious tabpage.txt /*:tabprevious* +:tabr tabpage.txt /*:tabr* +:tabrewind tabpage.txt /*:tabrewind* :tabs tabpage.txt /*:tabs* :tag tagsrch.txt /*:tag* :tags tagsrch.txt /*:tags* @@ -6592,6 +6603,7 @@ setloclist() eval.txt /*setloclist()* setqflist() eval.txt /*setqflist()* setreg() eval.txt /*setreg()* setting-guifont gui.txt /*setting-guifont* +setting-guitablabel tabpage.txt /*setting-guitablabel* setting-tabline tabpage.txt /*setting-tabline* setwinvar() eval.txt /*setwinvar()* sftp pi_netrw.txt /*sftp* diff --git a/runtime/filetype.vim b/runtime/filetype.vim --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2006 Feb 23 +" Last Change: 2006 Feb 25 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -1664,7 +1664,7 @@ fun! s:FTtex() if line =~ '^\s*\\\%(documentclass\>\|usepackage\>\|begin{\)' setf tex return - elseif line =~ '^\s*\\\%(start\l\+\|setup\l\+\|usemodule\)\>' + elseif line =~ '^\s*\\\%(start\l\+\|setup\l\+\|usemodule\|enablemode\>\|enableregime\>\|setvariables\>\|useencoding\>\|usesymbols\>\|stel\l\+\|verwende\l\+\|stel\l\+\|gebruik\l\+\|usa\l\+\|imposta\l\+\|regle\l\+\|utilisemodule\>\)\>' setf context return endif diff --git a/runtime/menu.vim b/runtime/menu.vim --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -2,7 +2,7 @@ " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar -" Last Change: 2006 Feb 02 +" Last Change: 2006 Feb 25 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. @@ -98,6 +98,7 @@ endfun " File menu an 10.310 &File.&Open\.\.\.:e :browse confirm e an 10.320 &File.Sp&lit-Open\.\.\.:sp :browse sp +an 10.320 &File.Open\ Tab\.\.\.:tabnew :browse tabnew an 10.325 &File.&New:enew :confirm enew an 10.330 &File.&Close:close \ :if winheight(2) < 0 diff --git a/src/globals.h b/src/globals.h --- a/src/globals.h +++ b/src/globals.h @@ -438,6 +438,12 @@ EXTERN int force_menu_update INIT(= FALS # ifdef FEAT_GUI_TABLINE /* Tab in tab pages line just selected, set by check_termcode() */ EXTERN int current_tab; + +/* Menu entry in tab pages line menu just selected, set by check_termcode() */ +EXTERN int current_tabmenu; +# define TABLINE_MENU_CLOSE 1 +# define TABLINE_MENU_NEW 2 +# define TABLINE_MENU_OPEN 3 # endif /* Scrollbar moved and new value, set by check_termcode() */ @@ -1200,6 +1206,11 @@ EXTERN option_table_T printer_opts[OPT_P # define PRT_UNIT_NAMES {"pc", "in", "mm", "pt"} #endif +#if defined(FEAT_PRINTER) || defined(FEAT_WINDOWS) +/* Page number used for %N in 'pageheader' and 'guitablabel'. */ +EXTERN linenr_T printer_page_num; +#endif + #ifdef FEAT_XCLIPBOARD EXTERN char *xterm_display INIT(= NULL); /* xterm display name; points into argv[] */ diff --git a/src/hardcopy.c b/src/hardcopy.c --- a/src/hardcopy.c +++ b/src/hardcopy.c @@ -394,14 +394,6 @@ prt_line_number(psettings, page_line, ln } } -static linenr_T printer_page_num; - - int -get_printer_page_num() -{ - return printer_page_num; -} - /* * Get the currently effective header height. */ diff --git a/src/ops.c b/src/ops.c --- a/src/ops.c +++ b/src/ops.c @@ -5494,6 +5494,7 @@ clip_get_selection(cbd) y_previous = old_y_previous; y_current = old_y_current; curwin->w_cursor = old_cursor; + changed_cline_bef_curs(); /* need to update w_virtcol et al */ curwin->w_curswant = old_curswant; curwin->w_set_curswant = old_set_curswant; curbuf->b_op_start = old_op_start; @@ -6133,7 +6134,9 @@ cursor_pos_info() oparg.block_mode = TRUE; oparg.op_type = OP_NOP; getvcols(curwin, &min_pos, &max_pos, - &oparg.start_vcol, &oparg.end_vcol); + &oparg.start_vcol, &oparg.end_vcol); + if (curwin->w_curswant == MAXCOL) + oparg.end_vcol = MAXCOL; /* Swap the start, end vcol if needed */ if (oparg.end_vcol < oparg.start_vcol) { @@ -6231,10 +6234,10 @@ cursor_pos_info() #ifdef FEAT_VISUAL if (VIsual_active) { - if (VIsual_mode == Ctrl_V) + if (VIsual_mode == Ctrl_V && curwin->w_curswant < MAXCOL) { getvcols(curwin, &min_pos, &max_pos, &min_pos.col, - &max_pos.col); + &max_pos.col); sprintf((char *)buf1, _("%ld Cols; "), (long)(oparg.end_vcol - oparg.start_vcol + 1)); } diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -1115,6 +1115,15 @@ static struct vimoption (char_u *)NULL, PV_NONE, #endif {(char_u *)TRUE, (char_u *)0L}}, + {"guitablabel", "gtl", P_STRING|P_VI_DEF, +#if defined(FEAT_GUI_TABLINE) + (char_u *)&p_gtl, PV_NONE, + {(char_u *)"", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + }, {"hardtabs", "ht", P_NUM|P_VI_DEF, (char_u *)NULL, PV_NONE, {(char_u *)0L, (char_u *)0L}}, @@ -5838,6 +5847,12 @@ did_set_string_option(opt_idx, varp, new gui_init_which_components(oldval); #endif +#if defined(FEAT_GUI_TABLINE) + /* 'guitablabel' */ + else if (varp == &p_gtl) + gui_update_tabline(); +#endif + #if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS)) /* 'ttymouse' */ else if (varp == &p_ttym) diff --git a/src/option.h b/src/option.h --- a/src/option.h +++ b/src/option.h @@ -515,6 +515,7 @@ EXTERN char_u *p_mouseshape; /* 'mousesh #endif #if defined(FEAT_GUI) EXTERN char_u *p_go; /* 'guioptions' */ +EXTERN char_u *p_gtl; /* 'guitablabel' */ #endif EXTERN char_u *p_hf; /* 'helpfile' */ #ifdef FEAT_WINDOWS diff --git a/src/screen.c b/src/screen.c --- a/src/screen.c +++ b/src/screen.c @@ -6167,10 +6167,10 @@ next_search_hl(win, shl, lnum, mincol) || (shl->rm.endpos[0].lnum == 0 && shl->rm.endpos[0].col <= shl->rm.startpos[0].col)) { - char_u *ml = ml_get_buf(shl->buf, lnum, FALSE); + char_u *ml; matchcol = shl->rm.startpos[0].col; - ml += matchcol; + ml = ml_get_buf(shl->buf, lnum, FALSE) + matchcol; if (*ml == NUL) { ++matchcol; diff --git a/src/term.c b/src/term.c --- a/src/term.c +++ b/src/term.c @@ -4792,12 +4792,23 @@ check_termcode(max_offset, buf, buflen) # ifdef FEAT_GUI_TABLINE else if (key_name[0] == (int)KS_TABLINE) { + /* Selecting tabline tab or using its menu. */ num_bytes = get_bytes_from_buf(tp + slen, bytes, 1); if (num_bytes == -1) return -1; current_tab = (int)bytes[0]; slen += num_bytes; } + else if (key_name[0] == (int)KS_TABMENU) + { + /* Selecting tabline tab or using its menu. */ + num_bytes = get_bytes_from_buf(tp + slen, bytes, 2); + if (num_bytes == -1) + return -1; + current_tab = (int)bytes[0]; + current_tabmenu = (int)bytes[1]; + slen += num_bytes; + } # endif # ifndef USE_ON_FLY_SCROLL else if (key_name[0] == (int)KS_VER_SCROLLBAR) diff --git a/src/version.h b/src/version.h --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 24)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 24, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 25)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 25, compiled "