mirror of
https://github.com/vim/vim
synced 2025-07-16 09:12:00 +00:00
updated for version 7.0202
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -284,8 +284,8 @@ Name triggered by ~
|
||||
|
||||
|WinEnter| after entering another window
|
||||
|WinLeave| before leaving a window
|
||||
|TabEnterPost| after entering another tab page
|
||||
|TabLeavePre| before leaving a tab page
|
||||
|TabEnter| after entering another tab page
|
||||
|TabLeave| before leaving a tab page
|
||||
|CmdwinEnter| after entering the command-line window
|
||||
|CmdwinLeave| before leaving the command-line window
|
||||
|
||||
@ -706,14 +706,14 @@ Syntax When the 'syntax' option has been set.
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*TabEnterPost*
|
||||
TabEnterPost Just after entering a tab page. |tab-page|
|
||||
*TabEnter*
|
||||
TabEnter Just after entering a tab page. |tab-page|
|
||||
Before triggering the WinEnter and BufEnter
|
||||
events.
|
||||
*TabLeavePre*
|
||||
TabLeavePre Just before leaving a tab page. |tab-page|
|
||||
BufLeave and WinLeave events will have been
|
||||
triggered first.
|
||||
*TabLeave*
|
||||
TabLeave Just before leaving a tab page. |tab-page|
|
||||
A WinLeave event will have been triggered
|
||||
first.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
|
@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
*eval.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -1690,8 +1690,11 @@ synIDattr( {synID}, {what} [, {mode}])
|
||||
String attribute {what} of syntax ID {synID}
|
||||
synIDtrans( {synID}) Number translated syntax ID of {synID}
|
||||
system( {expr} [, {input}]) String output of shell command/filter {expr}
|
||||
tabpage( [{expr}]) Number number of current tab page
|
||||
taglist( {expr}) List list of tags matching {expr}
|
||||
tabpagebuflist( [{arg}]) List list of buffer numbers in tab page
|
||||
tabpagenr( [{arg}]) Number number of current or last tab page
|
||||
tabpagewinnr( {tabarg}[, {arg}])
|
||||
Number number of current window in tab page
|
||||
taglist( {expr}) List list of tags matching {expr}
|
||||
tagfiles() List tags files used
|
||||
tempname() String name for a temporary file
|
||||
tolower( {expr}) String the String {expr} switched to lowercase
|
||||
@ -3861,10 +3864,12 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}]])
|
||||
Search for the match of a nested start-end pair. This can be
|
||||
used to find the "endif" that matches an "if", while other
|
||||
if/endif pairs in between are ignored.
|
||||
The search starts at the cursor. If a match is found, the
|
||||
cursor is positioned at it and the line number is returned.
|
||||
If no match is found 0 or -1 is returned and the cursor
|
||||
doesn't move. No error message is given.
|
||||
The search starts at the cursor. The default is to search
|
||||
forward, include 'b' in {flags} to search backward.
|
||||
If a match is found, the cursor is positioned at it and the
|
||||
line number is returned. If no match is found 0 or -1 is
|
||||
returned and the cursor doesn't move. No error message is
|
||||
given.
|
||||
|
||||
{start}, {middle} and {end} are patterns, see |pattern|. They
|
||||
must not contain \( \) pairs. Use of \%( \) is allowed. When
|
||||
@ -4448,7 +4453,21 @@ system({expr} [, {input}]) *system()* *E677*
|
||||
Use |:checktime| to force a check.
|
||||
|
||||
|
||||
tabpagenr([{arg}]) *tabpagenr()*
|
||||
tabpagebuflist([{arg}]) *tabpagebuflist()*
|
||||
The result is a List, where each item is the number of the
|
||||
buffer associated with each window in the current tab page.
|
||||
{arg} specifies the number of tab page to be used. When
|
||||
omitted the current tab page is used.
|
||||
When {arg} is invalid the number zero is returned.
|
||||
To get a list of all buffers in all tabs use this: >
|
||||
tablist = []
|
||||
for i in range(tabpagenr('$'))
|
||||
call extend(tablist, tabpagebuflist(i + 1))
|
||||
endfor
|
||||
< Note that a buffer may appear in more than one window.
|
||||
|
||||
|
||||
tabpagenr([{arg}]) *tabpagenr()*
|
||||
The result is a Number, which is the number of the current
|
||||
tab page. The first tab page has number 1.
|
||||
When the optional argument is "$", the number of the last tab
|
||||
@ -4456,6 +4475,19 @@ tabpagenr([{arg}]) *tabpagenr()*
|
||||
The number can be used with the |:tab| command.
|
||||
|
||||
|
||||
tabpagewinnr({tabarg}, [{arg}]) *tabpagewinnr()*
|
||||
Like |winnr()| but for tab page {arg}.
|
||||
{tabarg} specifies the number of tab page to be used.
|
||||
{arg} is used like with |winnr()|:
|
||||
- When omitted the current window number is returned. This is
|
||||
the window which will be used when going to this tab page.
|
||||
- When "$" the number of windows is returned.
|
||||
- When "#" the previous window nr is returned.
|
||||
Useful examples: >
|
||||
tabpagewinnr(1) " current window of tab page 1
|
||||
tabpagewinnr(4, '$') " number of windows in tab page 4
|
||||
< When {tabarg} is invalid zero is returned.
|
||||
|
||||
taglist({expr}) *taglist()*
|
||||
Returns a list of tags matching the regular expression {expr}.
|
||||
Each list item is a dictionary with at least the following
|
||||
|
@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
*options.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -4614,7 +4614,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
{only available when compiled with the |+linebreak|
|
||||
feature}
|
||||
Minimal number of columns to use for the line number. Only relevant
|
||||
when the 'number' option is set.
|
||||
when the 'number' option is set or printint lines with a line number.
|
||||
Since one space is always between the number and the text, there is
|
||||
one less character for the number itself.
|
||||
The value is the minimum width. A bigger width is used when needed to
|
||||
@ -5680,6 +5680,21 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
NOTE: This option is set to the Vi default value when 'compatible' is
|
||||
set and to the Vim default value when 'compatible' is reset.
|
||||
|
||||
*'showtabline'* *'stal'*
|
||||
'showtabline' 'stal' number (default 1)
|
||||
global
|
||||
{not in Vi}
|
||||
{not available when compiled without the +windows
|
||||
feature}
|
||||
The value of this option specifies when the line with tab page labels
|
||||
will be displayed:
|
||||
0: never
|
||||
1: only if there are at least two tab pages
|
||||
2: always
|
||||
This is both for the GUI and non-GUI implementation of the tab pages
|
||||
line.
|
||||
See |tab-page| for more information about tab pages.
|
||||
|
||||
*'sidescroll'* *'ss'*
|
||||
'sidescroll' 'ss' number (default 0)
|
||||
global
|
||||
@ -6235,17 +6250,25 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Only normal file name characters can be used, "/\*?[|<>" are illegal.
|
||||
|
||||
*'tabline'* *'tal'*
|
||||
'tabline' 'tal' number (default 1)
|
||||
'tabline' 'tal' string (default empty)
|
||||
global
|
||||
{not in Vi}
|
||||
{not available when compiled without the +windows
|
||||
feature}
|
||||
The value of this option specifies when the line with tab page labels
|
||||
will be displayed:
|
||||
0: never
|
||||
1: only if there are at least two tab pages
|
||||
2: always
|
||||
|tab-page|
|
||||
When nonempty, this option determines the content of the tab pages
|
||||
line at the top of the Vim window. When empty Vim will use a default
|
||||
tab pages line. |tab-page|
|
||||
|
||||
The tab pages line only appears as specified with the 'showtabline'
|
||||
option and only when there is no GUI implementation for tabs.
|
||||
|
||||
The value is evaluated like with 'statusline'. You can use
|
||||
|tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out
|
||||
the text to be displayed.
|
||||
|
||||
Keep in mind that only one of the tab pages is the current one, others
|
||||
are invisible and you can't jump to their windows.
|
||||
|
||||
|
||||
*'tabstop'* *'ts'*
|
||||
'tabstop' 'ts' number (default 8)
|
||||
|
@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
|
||||
*syntax.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -4020,6 +4020,12 @@ StatusLine status line of current window
|
||||
StatusLineNC status lines of not-current windows
|
||||
Note: if this is equal to "StatusLine" Vim will use "^^^" in
|
||||
the status line of the current window.
|
||||
*hl-TabLine*
|
||||
TabLine tab pages line, not active tab page label
|
||||
*hl-TabLineFill*
|
||||
TabLineFill tab pages line, where there are no labels
|
||||
*hl-TabLineSel*
|
||||
TabLineSel tab pages line, active tab page label
|
||||
*hl-Title*
|
||||
Title titles for output from ":set all", ":autocmd" etc.
|
||||
*hl-Visual*
|
||||
|
@ -718,6 +718,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'showfulltag' options.txt /*'showfulltag'*
|
||||
'showmatch' options.txt /*'showmatch'*
|
||||
'showmode' options.txt /*'showmode'*
|
||||
'showtabline' options.txt /*'showtabline'*
|
||||
'shq' options.txt /*'shq'*
|
||||
'si' options.txt /*'si'*
|
||||
'sidescroll' options.txt /*'sidescroll'*
|
||||
@ -758,6 +759,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'ssop' options.txt /*'ssop'*
|
||||
'st' options.txt /*'st'*
|
||||
'sta' options.txt /*'sta'*
|
||||
'stal' options.txt /*'stal'*
|
||||
'startofline' options.txt /*'startofline'*
|
||||
'statusline' options.txt /*'statusline'*
|
||||
'stl' options.txt /*'stl'*
|
||||
@ -2646,6 +2648,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:tabclose tabpage.txt /*:tabclose*
|
||||
:tabe tabpage.txt /*:tabe*
|
||||
:tabedit tabpage.txt /*:tabedit*
|
||||
:tabf tabpage.txt /*:tabf*
|
||||
:tabfind tabpage.txt /*:tabfind*
|
||||
:tabn tabpage.txt /*:tabn*
|
||||
:tabnew tabpage.txt /*:tabnew*
|
||||
:tabo tabpage.txt /*:tabo*
|
||||
:tabonly tabpage.txt /*:tabonly*
|
||||
:tabs tabpage.txt /*:tabs*
|
||||
@ -4098,8 +4104,8 @@ TCL if_tcl.txt /*TCL*
|
||||
TERM starting.txt /*TERM*
|
||||
TTpro-telnet syntax.txt /*TTpro-telnet*
|
||||
Tab intro.txt /*Tab*
|
||||
TabEnterPost autocmd.txt /*TabEnterPost*
|
||||
TabLeavePre autocmd.txt /*TabLeavePre*
|
||||
TabEnter autocmd.txt /*TabEnter*
|
||||
TabLeave autocmd.txt /*TabLeave*
|
||||
Tcl if_tcl.txt /*Tcl*
|
||||
TermChanged autocmd.txt /*TermChanged*
|
||||
TermResponse autocmd.txt /*TermResponse*
|
||||
@ -5515,6 +5521,9 @@ hl-SpellLocal syntax.txt /*hl-SpellLocal*
|
||||
hl-SpellRare syntax.txt /*hl-SpellRare*
|
||||
hl-StatusLine syntax.txt /*hl-StatusLine*
|
||||
hl-StatusLineNC syntax.txt /*hl-StatusLineNC*
|
||||
hl-TabLine syntax.txt /*hl-TabLine*
|
||||
hl-TabLineFill syntax.txt /*hl-TabLineFill*
|
||||
hl-TabLineSel syntax.txt /*hl-TabLineSel*
|
||||
hl-Title syntax.txt /*hl-Title*
|
||||
hl-Tooltip syntax.txt /*hl-Tooltip*
|
||||
hl-User1 syntax.txt /*hl-User1*
|
||||
@ -6949,7 +6958,9 @@ tab-page-intro tabpage.txt /*tab-page-intro*
|
||||
tab-page-other tabpage.txt /*tab-page-other*
|
||||
tabpage tabpage.txt /*tabpage*
|
||||
tabpage.txt tabpage.txt /*tabpage.txt*
|
||||
tabpagebuflist() eval.txt /*tabpagebuflist()*
|
||||
tabpagenr() eval.txt /*tabpagenr()*
|
||||
tabpagewinnr() eval.txt /*tabpagewinnr()*
|
||||
tag tagsrch.txt /*tag*
|
||||
tag-! tagsrch.txt /*tag-!*
|
||||
tag-any-white tagsrch.txt /*tag-any-white*
|
||||
|
@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 18
|
||||
*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -30,6 +30,50 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
'tabline' documentation with an example; esp for the highlighting
|
||||
|
||||
P_INSECURE should be remembered for local option values separately.
|
||||
|
||||
Completion: <Up> and <Down> don't insert completion, <PageUp> and <PageDown>
|
||||
shouldn't either.
|
||||
|
||||
Completion: case sensitiveness when typing BS: make it an option?
|
||||
|
||||
Completion: When back at the original word behave like after BS.
|
||||
|
||||
Completion: When to get out of the BS state when the user keeps on typing?
|
||||
|
||||
TabLineMod, TabLineModSel hl when a buffer is modified in a tab.
|
||||
Command(s) to reorder tabs? ":tabmove N".
|
||||
Open new tab by double click in tab line.
|
||||
"gT", ":tpNext" and ":tpprev" to go to previous tab?
|
||||
":tab" -> ":tpnext".
|
||||
":tab" or ":tabpage" modifier to open new window in new tab.
|
||||
E.g., ":tab help gt"
|
||||
Keep a few commands as shortcuts:
|
||||
:tpnew :tab new
|
||||
:tpedit -
|
||||
:tpclose :tab close
|
||||
:tponly :tab only
|
||||
:tpnext -
|
||||
:tpprevious -
|
||||
:tpNext -
|
||||
:tplast -
|
||||
:tpfirst -
|
||||
":tab!" to open it at the end, ":0tab" to open at the start.
|
||||
":tab split" opens tab with window same as current window.
|
||||
":tpsplit" would split the tab with all its windows.
|
||||
Option to put tab line at the left or right? Need an option to specify its
|
||||
witdh. It's like a separate window with ":tabs" output.
|
||||
:tabdo ":tabdo windo cmd" should also work
|
||||
|
||||
Add an argument to search functions to stop at a certain line number.
|
||||
search('{', 'b', line('w0'))
|
||||
search('{', '', line('w$'))
|
||||
Also start at a specified position?
|
||||
|
||||
undo could remember the '< and '> marks.
|
||||
|
||||
Support WINDOW TABS. Works like several pages, each with their own split
|
||||
windows. Let's call them "tab pages".
|
||||
- line at top of frame with tabs.
|
||||
@ -103,6 +147,7 @@ closing it, executing the command and re-opening it (at the same position).
|
||||
all. (Gautam Iyer)
|
||||
|
||||
Mac unicode patch (Da Woon Jung):
|
||||
- configuration option for platform: i386, ppc or both.
|
||||
- selecting proportional font breaks display
|
||||
- UTF-8 text causes display problems. Font replacement causes this.
|
||||
- Command-key mappings do not work. (Alan Schmitt)
|
||||
|
@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 7.0aa. Last change: 2006 Jan 08
|
||||
*various.txt* For Vim version 7.0aa. Last change: 2006 Feb 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -94,7 +94,8 @@ g8 Print the hex values of the bytes used in the
|
||||
*:nu* *:number*
|
||||
:[range]nu[mber] [count] [flags]
|
||||
Same as :print, but precede each line with its line
|
||||
number. (See also 'highlight' option).
|
||||
number. (See also 'highlight' and 'numberwidth'
|
||||
option).
|
||||
See |ex-flags| for [flags].
|
||||
|
||||
*:#*
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim script for testing colors
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Contributors: Rafael Garcia-Suarez, Charles Campbell
|
||||
" Last Change: 2006 Feb 16
|
||||
" Last Change: 2006 Feb 20
|
||||
|
||||
" edit this file, then do ":source %", and check if the colors match
|
||||
|
||||
@ -54,11 +54,12 @@
|
||||
|
||||
" Open this file in a window if it isn't edited yet.
|
||||
" Use the current window if it's empty.
|
||||
if &mod || line('$') != 1 || getline(1) != ''
|
||||
new
|
||||
endif
|
||||
if expand('%:p') != expand('<sfile>:p')
|
||||
exe "edit " . expand('<sfile>')
|
||||
if &mod || line('$') != 1 || getline(1) != ''
|
||||
exe "new " . expand('<sfile>')
|
||||
else
|
||||
exe "edit " . expand('<sfile>')
|
||||
endif
|
||||
endif
|
||||
|
||||
syn clear
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -547,6 +547,10 @@ LINT_OPTIONS = -beprxzF
|
||||
#PROFILE_CFLAGS = -DEXITFREE
|
||||
#PROFILE_LIBS = -lccmalloc
|
||||
|
||||
# MAC OS X platform
|
||||
#MAC_OSX_ARCH = -arch ppc
|
||||
MAC_OSX_ARCH = -arch i386 -arch ppc
|
||||
|
||||
#####################################################
|
||||
### Specific systems, check if yours is listed! ### {{{
|
||||
#####################################################
|
||||
@ -1197,11 +1201,11 @@ PHOTONGUI_BUNDLE =
|
||||
# CARBON GUI
|
||||
CARBONGUI_SRC = gui.c gui_mac.c
|
||||
CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o
|
||||
CARBONGUI_DEFS = -DFEAT_GUI_MAC -arch ppc -fno-common -fpascal-strings \
|
||||
CARBONGUI_DEFS = -DFEAT_GUI_MAC $(MAC_OSX_ARCH) -fno-common -fpascal-strings \
|
||||
-Wall -Wno-unknown-pragmas \
|
||||
-mdynamic-no-pic -pipe
|
||||
CARBONGUI_IPATH = -I. -Iproto
|
||||
CARBONGUI_LIBS_DIR =
|
||||
CARBONGUI_LIBS_DIR = $(MAC_OSX_ARCH)
|
||||
CARBONGUI_LIBS1 = -framework Carbon
|
||||
CARBONGUI_LIBS2 =
|
||||
CARBONGUI_INSTALL = install_macosx
|
||||
|
@ -106,7 +106,7 @@ if test "`(uname) 2>/dev/null`" = Darwin; then
|
||||
MACOSX=yes
|
||||
OS_EXTRA_SCR="os_macosx.c os_mac_conv.c";
|
||||
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
|
||||
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp -arch i386 -arch ppc"
|
||||
|
||||
dnl If Carbon is found, assume we don't want X11
|
||||
dnl unless it was specifically asked for (--with-x)
|
||||
|
@ -2845,7 +2845,7 @@ ins_compl_addfrommatch()
|
||||
int c;
|
||||
|
||||
p = compl_shown_match->cp_str;
|
||||
if (STRLEN(p) <= len) /* the match is too short */
|
||||
if ((int)STRLEN(p) <= len) /* the match is too short */
|
||||
return;
|
||||
p += len;
|
||||
#ifdef FEAT_MBYTE
|
||||
|
148
src/eval.c
148
src/eval.c
@ -621,7 +621,9 @@ static void f_synID __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_synIDattr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_synIDtrans __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_system __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tabpagebuflist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tabpagenr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tabpagewinnr __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_taglist __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tagfiles __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
static void f_tempname __ARGS((typval_T *argvars, typval_T *rettv));
|
||||
@ -6984,7 +6986,9 @@ static struct fst
|
||||
{"synIDattr", 2, 3, f_synIDattr},
|
||||
{"synIDtrans", 1, 1, f_synIDtrans},
|
||||
{"system", 1, 2, f_system},
|
||||
{"tabpagebuflist", 0, 1, f_tabpagebuflist},
|
||||
{"tabpagenr", 0, 1, f_tabpagenr},
|
||||
{"tabpagewinnr", 1, 2, f_tabpagewinnr},
|
||||
{"tagfiles", 0, 0, f_tagfiles},
|
||||
{"taglist", 1, 1, f_taglist},
|
||||
{"tempname", 0, 0, f_tempname},
|
||||
@ -14869,6 +14873,52 @@ done:
|
||||
rettv->vval.v_string = res;
|
||||
}
|
||||
|
||||
/*
|
||||
* "tabpagebuflist()" function
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
f_tabpagebuflist(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
#ifndef FEAT_WINDOWS
|
||||
rettv->vval.v_number = 0;
|
||||
#else
|
||||
tabpage_T *tp;
|
||||
win_T *wp = NULL;
|
||||
list_T *l;
|
||||
|
||||
if (argvars[0].v_type == VAR_UNKNOWN)
|
||||
wp = firstwin;
|
||||
else
|
||||
{
|
||||
tp = find_tabpage((int)get_tv_number(&argvars[0]));
|
||||
if (tp != NULL)
|
||||
wp = tp->tp_firstwin;
|
||||
}
|
||||
if (wp == NULL)
|
||||
rettv->vval.v_number = 0;
|
||||
else
|
||||
{
|
||||
l = list_alloc();
|
||||
if (l == NULL)
|
||||
rettv->vval.v_number = 0;
|
||||
else
|
||||
{
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
|
||||
for (; wp != NULL; wp = wp->w_next)
|
||||
if (list_append_number(l, wp->w_buffer->b_fnum) == FAIL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "tabpagenr()" function
|
||||
*/
|
||||
@ -14903,6 +14953,75 @@ f_tabpagenr(argvars, rettv)
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
static int get_winnr __ARGS((tabpage_T *tp, typval_T *argvar));
|
||||
|
||||
/*
|
||||
* Common code for tabpagewinnr() and winnr().
|
||||
*/
|
||||
static int
|
||||
get_winnr(tp, argvar)
|
||||
tabpage_T *tp;
|
||||
typval_T *argvar;
|
||||
{
|
||||
win_T *twin;
|
||||
int nr = 1;
|
||||
win_T *wp;
|
||||
char_u *arg;
|
||||
|
||||
twin = (tp == curtab) ? curwin : tp->tp_curwin;
|
||||
if (argvar->v_type != VAR_UNKNOWN)
|
||||
{
|
||||
arg = get_tv_string_chk(argvar);
|
||||
if (arg == NULL)
|
||||
nr = 0; /* type error; errmsg already given */
|
||||
else if (STRCMP(arg, "$") == 0)
|
||||
twin = (tp == curtab) ? lastwin : tp->tp_lastwin;
|
||||
else if (STRCMP(arg, "#") == 0)
|
||||
{
|
||||
twin = (tp == curtab) ? prevwin : tp->tp_prevwin;
|
||||
if (twin == NULL)
|
||||
nr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
EMSG2(_(e_invexpr2), arg);
|
||||
nr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (nr > 0)
|
||||
for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
|
||||
wp != twin; wp = wp->w_next)
|
||||
++nr;
|
||||
return nr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* "tabpagewinnr()" function
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
f_tabpagewinnr(argvars, rettv)
|
||||
typval_T *argvars;
|
||||
typval_T *rettv;
|
||||
{
|
||||
int nr = 1;
|
||||
#ifdef FEAT_WINDOWS
|
||||
tabpage_T *tp;
|
||||
|
||||
tp = find_tabpage((int)get_tv_number(&argvars[0]));
|
||||
if (tp == NULL)
|
||||
nr = 0;
|
||||
else
|
||||
nr = get_winnr(tp, &argvars[1]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* "tagfiles()" function
|
||||
*/
|
||||
@ -15357,34 +15476,9 @@ f_winnr(argvars, rettv)
|
||||
typval_T *rettv;
|
||||
{
|
||||
int nr = 1;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
win_T *wp;
|
||||
win_T *twin = curwin;
|
||||
char_u *arg;
|
||||
|
||||
if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
arg = get_tv_string_chk(&argvars[0]);
|
||||
if (arg == NULL)
|
||||
nr = 0; /* type error; errmsg already given */
|
||||
else if (STRCMP(arg, "$") == 0)
|
||||
twin = lastwin;
|
||||
else if (STRCMP(arg, "#") == 0)
|
||||
{
|
||||
twin = prevwin;
|
||||
if (prevwin == NULL)
|
||||
nr = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
EMSG2(_(e_invexpr2), arg);
|
||||
nr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (nr > 0)
|
||||
for (wp = firstwin; wp != twin; wp = wp->w_next)
|
||||
++nr;
|
||||
nr = get_winnr(curtab, &argvars[0]);
|
||||
#endif
|
||||
rettv->vval.v_number = nr;
|
||||
}
|
||||
|
@ -3425,7 +3425,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
|
||||
* autocommands. This allows for the autocommands to position the
|
||||
* cursor.
|
||||
*/
|
||||
win_init(curwin);
|
||||
curwin_init();
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* It's like all lines in the buffer changed. Need to update
|
||||
|
@ -881,11 +881,11 @@ EX(CMD_tab, "tab", ex_tab,
|
||||
RANGE|NOTADR|COUNT|TRLBAR),
|
||||
EX(CMD_tabclose, "tabclose", ex_tabclose,
|
||||
RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN),
|
||||
EX(CMD_tabedit, "tabedit", ex_tabedit,
|
||||
EX(CMD_tabedit, "tabedit", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
|
||||
EX(CMD_tabfind, "tabfind", ex_tabedit,
|
||||
EX(CMD_tabfind, "tabfind", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|NEEDARG|TRLBAR),
|
||||
EX(CMD_tabnew, "tabnew", ex_tabedit,
|
||||
EX(CMD_tabnew, "tabnew", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
|
||||
EX(CMD_tabonly, "tabonly", ex_tabonly,
|
||||
TRLBAR|CMDWIN),
|
||||
|
@ -495,6 +495,7 @@ EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
||||
# define lastwin curwin
|
||||
# define W_NEXT(wp) NULL
|
||||
# define FOR_ALL_WINDOWS(wp) wp = curwin;
|
||||
# define FOR_ALL_TAB_WINDOWS(tp, wp) wp = curwin;
|
||||
#endif
|
||||
|
||||
EXTERN win_T *curwin; /* currently active window */
|
||||
|
@ -475,6 +475,7 @@ prt_header(psettings, pagenum, lnum)
|
||||
if (*p_header != NUL)
|
||||
{
|
||||
linenr_T tmp_lnum, tmp_topline, tmp_botline;
|
||||
int use_sandbox = FALSE;
|
||||
|
||||
/*
|
||||
* Need to (temporarily) set current line number and first/last line
|
||||
@ -490,8 +491,12 @@ prt_header(psettings, pagenum, lnum)
|
||||
curwin->w_botline = lnum + 63;
|
||||
printer_page_num = pagenum;
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"printheader");
|
||||
# endif
|
||||
build_stl_str_hl(curwin, tbuf, (size_t)(width + IOSIZE),
|
||||
p_header, ' ', width, NULL);
|
||||
p_header, use_sandbox,
|
||||
' ', width, NULL);
|
||||
|
||||
/* Reset line numbers */
|
||||
curwin->w_cursor.lnum = tmp_lnum;
|
||||
|
31
src/option.c
31
src/option.c
@ -1142,7 +1142,7 @@ static struct vimoption
|
||||
{(char_u *)FALSE, (char_u *)0L}},
|
||||
{"highlight", "hl", P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
|
||||
(char_u *)&p_hl, PV_NONE,
|
||||
{(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabPage,#:TabPageSel,_:TabPageFill",
|
||||
{(char_u *)"8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill",
|
||||
(char_u *)0L}},
|
||||
{"history", "hi", P_NUM|P_VIM,
|
||||
(char_u *)&p_hi, PV_NONE,
|
||||
@ -2046,6 +2046,13 @@ static struct vimoption
|
||||
{"showmode", "smd", P_BOOL|P_VIM,
|
||||
(char_u *)&p_smd, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)TRUE}},
|
||||
{"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL,
|
||||
#ifdef FEAT_WINDOWS
|
||||
(char_u *)&p_stal, PV_NONE,
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)1L, (char_u *)0L}},
|
||||
{"sidescroll", "ss", P_NUM|P_VI_DEF,
|
||||
(char_u *)&p_ss, PV_NONE,
|
||||
{(char_u *)0L, (char_u *)0L}},
|
||||
@ -2181,13 +2188,13 @@ static struct vimoption
|
||||
{(char_u *)0L, (char_u *)0L}
|
||||
#endif
|
||||
},
|
||||
{"tabline", "tal", P_NUM|P_VI_DEF|P_RALL,
|
||||
#ifdef FEAT_WINDOWS
|
||||
{"tabline", "tal", P_STRING|P_VI_DEF|P_RALL,
|
||||
#ifdef FEAT_STL_OPT
|
||||
(char_u *)&p_tal, PV_NONE,
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)1L, (char_u *)0L}},
|
||||
{(char_u *)"", (char_u *)0L}},
|
||||
{"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF,
|
||||
(char_u *)&p_ts, PV_TS,
|
||||
{(char_u *)8L, (char_u *)0L}},
|
||||
@ -3181,8 +3188,10 @@ set_option_default(opt_idx, opt_flags, compatible)
|
||||
*(int *)varp;
|
||||
}
|
||||
|
||||
/* the default value is not insecure */
|
||||
options[opt_idx].flags &= ~P_INSECURE;
|
||||
/* The default value is not insecure. But if there are local values
|
||||
* we can't be sure. */
|
||||
if (options[opt_idx].indir == PV_NONE)
|
||||
options[opt_idx].flags &= ~P_INSECURE;
|
||||
}
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
@ -3351,12 +3360,12 @@ set_init_2()
|
||||
static char_u *
|
||||
term_bg_default()
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
#if defined(MSDOS) || defined(OS2) || defined(WIN3264)
|
||||
/* DOS console nearly always black */
|
||||
return (char_u *)"dark";
|
||||
#else
|
||||
char_u *p;
|
||||
|
||||
if (STRCMP(T_NAME, "linux") == 0
|
||||
|| STRCMP(T_NAME, "screen.linux") == 0
|
||||
|| STRCMP(T_NAME, "cygwin") == 0
|
||||
@ -4462,14 +4471,14 @@ did_set_option(opt_idx, opt_flags, new_value)
|
||||
|
||||
/* When an option is set in the sandbox, from a modeline or in secure mode
|
||||
* set the P_INSECURE flag. Otherwise, if a new value is stored reset the
|
||||
* flag. */
|
||||
* flag. But not when there are local values. */
|
||||
if (secure
|
||||
#ifdef HAVE_SANDBOX
|
||||
|| sandbox != 0
|
||||
#endif
|
||||
|| (opt_flags & OPT_MODELINE))
|
||||
options[opt_idx].flags |= P_INSECURE;
|
||||
else if (new_value)
|
||||
else if (new_value && options[opt_idx].indir == PV_NONE)
|
||||
options[opt_idx].flags &= ~P_INSECURE;
|
||||
}
|
||||
|
||||
@ -7284,7 +7293,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
|
||||
}
|
||||
|
||||
/* (re)set tab page line */
|
||||
else if (pp == &p_tal)
|
||||
else if (pp == &p_stal)
|
||||
{
|
||||
shell_new_rows(); /* recompute window positions and heights */
|
||||
}
|
||||
|
@ -577,7 +577,7 @@ EXTERN char_u *p_lispwords; /* 'lispwords' */
|
||||
#endif
|
||||
#ifdef FEAT_WINDOWS
|
||||
EXTERN long p_ls; /* 'laststatus' */
|
||||
EXTERN long p_tal; /* 'tabline' */
|
||||
EXTERN long p_stal; /* 'showtabline' */
|
||||
#endif
|
||||
EXTERN char_u *p_lcs; /* 'listchars' */
|
||||
|
||||
@ -716,6 +716,9 @@ EXTERN int p_scs; /* 'smartcase' */
|
||||
EXTERN int p_sta; /* 'smarttab' */
|
||||
#ifdef FEAT_WINDOWS
|
||||
EXTERN int p_sb; /* 'splitbelow' */
|
||||
# if defined(FEAT_STL_OPT)
|
||||
EXTERN char_u *p_tal; /* 'tabline' */
|
||||
# endif
|
||||
#endif
|
||||
#ifdef FEAT_SYN_HL
|
||||
EXTERN char_u *p_sps; /* 'spellsuggest' */
|
||||
|
@ -11,7 +11,7 @@ void win_close __ARGS((win_T *win, int free_buf));
|
||||
void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
|
||||
void win_free_all __ARGS((void));
|
||||
void close_others __ARGS((int message, int forceit));
|
||||
void win_init __ARGS((win_T *wp));
|
||||
void curwin_init __ARGS((void));
|
||||
int win_alloc_first __ARGS((void));
|
||||
void win_init_size __ARGS((void));
|
||||
int win_new_tabpage __ARGS((void));
|
||||
|
@ -2887,11 +2887,14 @@ ex_vimgrep(eap)
|
||||
int found_match;
|
||||
buf_T *first_match_buf = NULL;
|
||||
time_t seconds = 0;
|
||||
int save_mls;
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
|
||||
char_u *save_ei = NULL;
|
||||
aco_save_T aco;
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCMD
|
||||
#ifndef FEAT_AUTOCMD
|
||||
buf_T *save_curbuf;
|
||||
#else
|
||||
aco_save_T aco;
|
||||
char_u *au_name = NULL;
|
||||
int flags = 0;
|
||||
colnr_T col;
|
||||
@ -2999,11 +3002,15 @@ ex_vimgrep(eap)
|
||||
* indent scripts, a great speed improvement. */
|
||||
save_ei = au_event_disable(",Filetype");
|
||||
#endif
|
||||
/* Don't use modelines here, it's useless. */
|
||||
save_mls = p_mls;
|
||||
p_mls = 0;
|
||||
|
||||
/* Load file into a buffer, so that 'fileencoding' is detected,
|
||||
* autocommands applied, etc. */
|
||||
buf = load_dummy_buffer(fnames[fi]);
|
||||
|
||||
p_mls = save_mls;
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
|
||||
au_event_restore(save_ei);
|
||||
#endif
|
||||
@ -3089,19 +3096,30 @@ ex_vimgrep(eap)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
|
||||
if (buf != NULL)
|
||||
{
|
||||
/* The buffer is still loaded, the Filetype autocommands
|
||||
* need to be done now, in that buffer. And then the
|
||||
* modelines need to be done (again). */
|
||||
* need to be done now, in that buffer. And the modelines
|
||||
* need to be done (again). */
|
||||
#if defined(FEAT_AUTOCMD)
|
||||
aucmd_prepbuf(&aco, buf);
|
||||
#else
|
||||
save_curbuf = curbuf;
|
||||
curbuf = buf;
|
||||
curwin->w_buffer = curbuf;
|
||||
#endif
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
|
||||
apply_autocmds(EVENT_FILETYPE, buf->b_p_ft,
|
||||
buf->b_fname, TRUE, buf);
|
||||
do_modelines(FALSE);
|
||||
aucmd_restbuf(&aco);
|
||||
}
|
||||
#endif
|
||||
do_modelines(FALSE);
|
||||
#if defined(FEAT_AUTOCMD)
|
||||
aucmd_restbuf(&aco);
|
||||
#else
|
||||
curbuf = save_curbuf;
|
||||
curwin->w_buffer = curbuf;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
232
src/screen.c
232
src/screen.c
@ -168,7 +168,7 @@ static int win_do_lines __ARGS((win_T *wp, int row, int line_count, int mayclear
|
||||
static void win_rest_invalid __ARGS((win_T *wp));
|
||||
static void msg_pos_mode __ARGS((void));
|
||||
#if defined(FEAT_WINDOWS)
|
||||
static void draw_tabpage __ARGS((void));
|
||||
static void draw_tabline __ARGS((void));
|
||||
#endif
|
||||
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT)
|
||||
static int fillchar_status __ARGS((int *attr, int is_curwin));
|
||||
@ -420,7 +420,7 @@ update_screen(type)
|
||||
#ifdef FEAT_LINEBREAK
|
||||
/* Force redraw when width of 'number' column changes. */
|
||||
if (curwin->w_redr_type < NOT_VALID
|
||||
&& curwin->w_nrwidth != number_width(curwin))
|
||||
&& curwin->w_nrwidth != (curwin->w_p_nu ? number_width(curwin) : 0))
|
||||
curwin->w_redr_type = NOT_VALID;
|
||||
#endif
|
||||
|
||||
@ -477,7 +477,7 @@ update_screen(type)
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* Redraw the tab pages line if needed. */
|
||||
if (redraw_tabline || type >= NOT_VALID)
|
||||
draw_tabpage();
|
||||
draw_tabline();
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -707,7 +707,7 @@ updateWindow(wp)
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* When the screen was cleared redraw the tab pages line. */
|
||||
if (redraw_tabline)
|
||||
draw_tabpage();
|
||||
draw_tabline();
|
||||
|
||||
if (wp->w_redr_status
|
||||
# ifdef FEAT_CMDL_INFO
|
||||
@ -845,11 +845,11 @@ win_update(wp)
|
||||
|
||||
#ifdef FEAT_LINEBREAK
|
||||
/* Force redraw when width of 'number' column changes. */
|
||||
i = number_width(curwin);
|
||||
if (curwin->w_nrwidth != i)
|
||||
i = wp->w_p_nu ? number_width(wp) : 0;
|
||||
if (wp->w_nrwidth != i)
|
||||
{
|
||||
type = NOT_VALID;
|
||||
curwin->w_nrwidth = i;
|
||||
wp->w_nrwidth = i;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@ -4965,7 +4965,7 @@ redraw_statuslines()
|
||||
if (wp->w_redr_status)
|
||||
win_redr_status(wp);
|
||||
if (redraw_tabline)
|
||||
draw_tabpage();
|
||||
draw_tabline();
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -5543,7 +5543,8 @@ get_keymap_str(wp, buf, len)
|
||||
|
||||
#if defined(FEAT_STL_OPT) || defined(PROTO)
|
||||
/*
|
||||
* Redraw the status line or ruler of window wp.
|
||||
* Redraw the status line or ruler of window "wp".
|
||||
* When "wp" is NULL redraw the tab pages line from 'tabline'.
|
||||
*/
|
||||
static void
|
||||
win_redr_custom(wp, draw_ruler)
|
||||
@ -5562,56 +5563,88 @@ win_redr_custom(wp, draw_ruler)
|
||||
char_u buf[MAXPATHL];
|
||||
char_u *p;
|
||||
struct stl_hlrec hl[STL_MAX_ITEM];
|
||||
int use_sandbox = FALSE;
|
||||
|
||||
/* setup environment for the task at hand */
|
||||
row = W_WINROW(wp) + wp->w_height;
|
||||
fillchar = fillchar_status(&attr, wp == curwin);
|
||||
maxwidth = W_WIDTH(wp);
|
||||
if (*wp->w_p_stl != NUL)
|
||||
p = wp->w_p_stl;
|
||||
else
|
||||
p = p_stl;
|
||||
if (draw_ruler)
|
||||
if (wp == NULL)
|
||||
{
|
||||
p = p_ruf;
|
||||
/* advance past any leading group spec - implicit in ru_col */
|
||||
if (*p == '%')
|
||||
{
|
||||
if (*++p == '-')
|
||||
p++;
|
||||
if (atoi((char *) p))
|
||||
while (VIM_ISDIGIT(*p))
|
||||
p++;
|
||||
if (*p++ != '(')
|
||||
p = p_ruf;
|
||||
}
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
col = ru_col - (Columns - W_WIDTH(wp));
|
||||
if (col < (W_WIDTH(wp) + 1) / 2)
|
||||
col = (W_WIDTH(wp) + 1) / 2;
|
||||
#else
|
||||
col = ru_col;
|
||||
if (col > (Columns + 1) / 2)
|
||||
col = (Columns + 1) / 2;
|
||||
#endif
|
||||
maxwidth = W_WIDTH(wp) - col;
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (!wp->w_status_height)
|
||||
#endif
|
||||
{
|
||||
row = Rows - 1;
|
||||
--maxwidth; /* writing in last column may cause scrolling */
|
||||
fillchar = ' ';
|
||||
attr = 0;
|
||||
}
|
||||
/* Use 'tabline'. Always at the first line of the screen. */
|
||||
p = p_tal;
|
||||
row = 0;
|
||||
fillchar = t_colors < 8 ? '_' : ' ';
|
||||
attr = hl_attr(HLF_TPF);
|
||||
maxwidth = Columns;
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"tabline");
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
row = W_WINROW(wp) + wp->w_height;
|
||||
fillchar = fillchar_status(&attr, wp == curwin);
|
||||
maxwidth = W_WIDTH(wp);
|
||||
|
||||
if (draw_ruler)
|
||||
{
|
||||
p = p_ruf;
|
||||
/* advance past any leading group spec - implicit in ru_col */
|
||||
if (*p == '%')
|
||||
{
|
||||
if (*++p == '-')
|
||||
p++;
|
||||
if (atoi((char *) p))
|
||||
while (VIM_ISDIGIT(*p))
|
||||
p++;
|
||||
if (*p++ != '(')
|
||||
p = p_ruf;
|
||||
}
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
col = ru_col - (Columns - W_WIDTH(wp));
|
||||
if (col < (W_WIDTH(wp) + 1) / 2)
|
||||
col = (W_WIDTH(wp) + 1) / 2;
|
||||
#else
|
||||
col = ru_col;
|
||||
if (col > (Columns + 1) / 2)
|
||||
col = (Columns + 1) / 2;
|
||||
#endif
|
||||
maxwidth = W_WIDTH(wp) - col;
|
||||
#ifdef FEAT_WINDOWS
|
||||
if (!wp->w_status_height)
|
||||
#endif
|
||||
{
|
||||
row = Rows - 1;
|
||||
--maxwidth; /* writing in last column may cause scrolling */
|
||||
fillchar = ' ';
|
||||
attr = 0;
|
||||
}
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"rulerformat");
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*wp->w_p_stl != NUL)
|
||||
p = wp->w_p_stl;
|
||||
else
|
||||
p = p_stl;
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"statusline");
|
||||
# endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
col += W_WINCOL(wp);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (maxwidth <= 0)
|
||||
return;
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
col += W_WINCOL(wp);
|
||||
#endif
|
||||
|
||||
width = build_stl_str_hl(wp, buf, sizeof(buf), p, fillchar, maxwidth, hl);
|
||||
width = build_stl_str_hl(wp == NULL ? curwin : wp,
|
||||
buf, sizeof(buf),
|
||||
p, use_sandbox,
|
||||
fillchar, maxwidth, hl);
|
||||
len = STRLEN(buf);
|
||||
|
||||
while (width < maxwidth && len < sizeof(buf) - 1)
|
||||
@ -6822,7 +6855,7 @@ screenalloc(clear)
|
||||
new_TabPageIdxs = (char_u *)lalloc((long_u)(Columns * sizeof(char_u)), FALSE);
|
||||
#endif
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
{
|
||||
if (win_alloc_lines(wp) == FAIL)
|
||||
{
|
||||
@ -8456,14 +8489,13 @@ unshowmode(force)
|
||||
* Draw the tab pages line at the top of the Vim window.
|
||||
*/
|
||||
static void
|
||||
draw_tabpage()
|
||||
draw_tabline()
|
||||
{
|
||||
int tabcount = 0;
|
||||
tabpage_T *tp;
|
||||
int tabwidth;
|
||||
int col = 0;
|
||||
int scol = 0;
|
||||
int had_current = FALSE;
|
||||
int attr;
|
||||
win_T *wp;
|
||||
win_T *cwp;
|
||||
@ -8475,12 +8507,27 @@ draw_tabpage()
|
||||
int attr_nosel = hl_attr(HLF_TP);
|
||||
int attr_fill = hl_attr(HLF_TPF);
|
||||
char_u *p;
|
||||
int room;
|
||||
int use_sep_chars = (t_colors < 8
|
||||
#ifdef FEAT_GUI
|
||||
&& !gui.in_use
|
||||
#endif
|
||||
);
|
||||
|
||||
redraw_tabline = FALSE;
|
||||
|
||||
if (tabpageline_height() < 1)
|
||||
return;
|
||||
|
||||
#if defined(FEAT_STL_OPT)
|
||||
/* Use the 'tabline' option if it's set. */
|
||||
if (*p_tal != NUL)
|
||||
{
|
||||
win_redr_custom(NULL, FALSE);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
++tabcount;
|
||||
|
||||
@ -8495,17 +8542,9 @@ draw_tabpage()
|
||||
scol = col;
|
||||
|
||||
if (tp->tp_topframe == topframe)
|
||||
{
|
||||
c = '/';
|
||||
had_current = TRUE;
|
||||
attr = attr_sel;
|
||||
}
|
||||
else if (!had_current)
|
||||
c = '/';
|
||||
else
|
||||
c = '\\';
|
||||
if (t_colors < 8)
|
||||
screen_putchar(c, 0, col++, attr);
|
||||
if (use_sep_chars && col > 0)
|
||||
screen_putchar('|', 0, col++, attr);
|
||||
|
||||
if (tp->tp_topframe != topframe)
|
||||
attr = attr_nosel;
|
||||
@ -8531,32 +8570,49 @@ draw_tabpage()
|
||||
{
|
||||
if (wincount > 1)
|
||||
{
|
||||
vim_snprintf((char *)NameBuff, MAXPATHL, "#%d", wincount);
|
||||
vim_snprintf((char *)NameBuff, MAXPATHL, "%d", wincount);
|
||||
len = STRLEN(NameBuff);
|
||||
screen_puts_len(NameBuff, len, 0, col, attr);
|
||||
screen_puts_len(NameBuff, len, 0, col,
|
||||
#if defined(FEAT_SYN_HL)
|
||||
hl_combine_attr(attr, hl_attr(HLF_T))
|
||||
#else
|
||||
attr
|
||||
#endif
|
||||
);
|
||||
col += len;
|
||||
}
|
||||
if (modified)
|
||||
screen_puts_len((char_u *)"+", 2, 0, col++, attr);
|
||||
screen_puts_len((char_u *)"+", 1, 0, col++, attr);
|
||||
screen_putchar(' ', 0, col++, attr);
|
||||
}
|
||||
|
||||
if (buf_spname(cwp->w_buffer) != NULL)
|
||||
STRCPY(NameBuff, buf_spname(cwp->w_buffer));
|
||||
else
|
||||
home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
|
||||
room = scol - col + tabwidth - 1;
|
||||
if (room > 0)
|
||||
{
|
||||
if (buf_spname(cwp->w_buffer) != NULL)
|
||||
STRCPY(NameBuff, buf_spname(cwp->w_buffer));
|
||||
else
|
||||
home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff,
|
||||
MAXPATHL, TRUE);
|
||||
trans_characters(NameBuff, MAXPATHL);
|
||||
len = STRLEN(NameBuff);
|
||||
p = NameBuff;
|
||||
if (len > scol - col + tabwidth - 1) /* TODO: multi-byte chars */
|
||||
{
|
||||
p += len - (scol - col + tabwidth - 1);
|
||||
len = scol - col + tabwidth - 1;
|
||||
}
|
||||
if (len > 0)
|
||||
{
|
||||
screen_puts_len(p, len, 0, col, attr);
|
||||
trans_characters(NameBuff, MAXPATHL);
|
||||
len = vim_strsize(NameBuff);
|
||||
p = NameBuff;
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
while (len > room)
|
||||
{
|
||||
len -= ptr2cells(p);
|
||||
mb_ptr_adv(p);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (len > room)
|
||||
{
|
||||
p += len - room;
|
||||
len = room;
|
||||
}
|
||||
|
||||
screen_puts_len(p, STRLEN(p), 0, col, attr);
|
||||
col += len;
|
||||
}
|
||||
screen_putchar(' ', 0, col++, attr);
|
||||
@ -8568,11 +8624,8 @@ draw_tabpage()
|
||||
TabPageIdxs[scol++] = tabcount;
|
||||
}
|
||||
|
||||
if (t_colors < 8)
|
||||
{
|
||||
screen_putchar('\\', 0, col++, attr);
|
||||
if (use_sep_chars)
|
||||
c = '_';
|
||||
}
|
||||
else
|
||||
c = ' ';
|
||||
screen_fill(0, 1, col, (int)Columns, c, c, attr_fill);
|
||||
@ -8902,7 +8955,7 @@ win_redr_ruler(wp, always)
|
||||
#if defined(FEAT_LINEBREAK) || defined(PROTO)
|
||||
/*
|
||||
* Return the width of the 'number' column.
|
||||
* Zero when 'number' isn't set.
|
||||
* Caller may need to check if 'number' is set.
|
||||
* Otherwise it depends on 'numberwidth' and the line count.
|
||||
*/
|
||||
int
|
||||
@ -8912,9 +8965,6 @@ number_width(wp)
|
||||
int n;
|
||||
linenr_T lnum;
|
||||
|
||||
if (!wp->w_p_nu)
|
||||
return 0;
|
||||
|
||||
lnum = wp->w_buffer->b_ml.ml_line_count;
|
||||
if (lnum == wp->w_nrwidth_line_count)
|
||||
return wp->w_nrwidth_width;
|
||||
|
@ -1578,6 +1578,7 @@ struct tabpage_S
|
||||
buf_T *(tp_diffbuf[DB_COUNT]);
|
||||
int tp_diff_invalid; /* list of diffs is outdated */
|
||||
#endif
|
||||
frame_T *tp_snapshot; /* window layout snapshot */
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -6079,8 +6079,8 @@ static char *(highlight_init_both[]) =
|
||||
"DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red",
|
||||
"PmenuThumb cterm=reverse gui=reverse",
|
||||
"PmenuSbar ctermbg=Grey guibg=Grey",
|
||||
"TabPageSel term=bold cterm=bold gui=bold",
|
||||
"TabPageFill term=reverse cterm=reverse gui=reverse",
|
||||
"TabLineSel term=bold cterm=bold gui=bold",
|
||||
"TabLineFill term=reverse cterm=reverse gui=reverse",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -6109,7 +6109,7 @@ static char *(highlight_init_light[]) =
|
||||
"DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
|
||||
"DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
|
||||
"DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
|
||||
"TabPage term=underline cterm=underline ctermbg=LightGrey gui=underline guibg=LightGrey",
|
||||
"TabLine term=underline cterm=underline ctermbg=LightGrey gui=underline guibg=LightGrey",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -6138,7 +6138,7 @@ static char *(highlight_init_dark[]) =
|
||||
"DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
|
||||
"DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
|
||||
"DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",
|
||||
"TabPage term=underline cterm=underline ctermbg=DarkGrey gui=underline guibg=DarkGrey",
|
||||
"TabLine term=underline cterm=underline ctermbg=DarkGrey gui=underline guibg=DarkGrey",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -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 18)"
|
||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 18, compiled "
|
||||
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20)"
|
||||
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 20, compiled "
|
||||
|
Reference in New Issue
Block a user