0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.0208

This commit is contained in:
Bram Moolenaar 2006-02-26 23:59:20 +00:00
parent a562149de3
commit a226a6dd9f
8 changed files with 97 additions and 64 deletions

View File

@ -1,4 +1,4 @@
*tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 *tabpage.txt* For Vim version 7.0aa. Last change: 2006 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -284,19 +284,20 @@ label separately.
See the 'statusline' option for the format of the value. See the 'statusline' option for the format of the value.
The "%N" item can be used for the current tab page number. The |v:lnum| The "%N" item can be used for the current tab page number. The |v:lnum|
variable is also set to this number. variable is also set to this number when 'guitablabel' is evaluated.
The items that use a file name refer to the current window of the tab page.
Note that syntax highlighting is not used for 'guitablabel'. The %T and %X Note that syntax highlighting is not used for 'guitablabel'. The %T and %X
are also ignored. items are also ignored.
A simple example that puts the tab page number and the buffer name in the label: >
A simple example that puts the tab page number and the buffer name in the
label: >
:set guitablabel=%N\ %f :set guitablabel=%N\ %f
An example that resembles the default: Show the number of windows in the tab An example that resembles the default: Show the number of windows in the tab
page and a '+' if there is a modifed buffer: > page and a '+' if there is a modifed buffer: >
function! GuiTabLabel() function GuiTabLabel()
let label = '' let label = ''
let bufnrlist = tabpagebuflist(v:lnum) let bufnrlist = tabpagebuflist(v:lnum)
@ -320,7 +321,11 @@ page and a '+' if there is a modifed buffer: >
" Append the buffer name " Append the buffer name
return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]) return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
endfunction endfunction
set guitablabel=%{GuiTabLabel()} set guitablabel=%{GuiTabLabel()}
<
Note that the function must be defined before setting the option, otherwise
you get an error message for the function not being known.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -2509,6 +2509,7 @@ do_one_cmd(cmdlinep, sourcing,
case CMD_snomagic: case CMD_snomagic:
case CMD_substitute: case CMD_substitute:
case CMD_syntax: case CMD_syntax:
case CMD_tab:
case CMD_tcl: case CMD_tcl:
case CMD_throw: case CMD_throw:
case CMD_tilde: case CMD_tilde:
@ -2963,6 +2964,7 @@ cmd_exists(name)
{"rightbelow", 6}, {"rightbelow", 6},
{"sandbox", 3}, {"sandbox", 3},
{"silent", 3}, {"silent", 3},
{"tab", 3},
{"topleft", 2}, {"topleft", 2},
{"verbose", 4}, {"verbose", 4},
{"vertical", 4}, {"vertical", 4},
@ -3353,6 +3355,7 @@ set_one_cmd_context(xp, buff)
case CMD_rightbelow: case CMD_rightbelow:
case CMD_sandbox: case CMD_sandbox:
case CMD_silent: case CMD_silent:
case CMD_tab:
case CMD_topleft: case CMD_topleft:
case CMD_verbose: case CMD_verbose:
case CMD_vertical: case CMD_vertical:
@ -3880,7 +3883,8 @@ get_address(ptr, skip, to_other_file)
if (searchit(curwin, curbuf, &pos, if (searchit(curwin, curbuf, &pos,
*cmd == '?' ? BACKWARD : FORWARD, *cmd == '?' ? BACKWARD : FORWARD,
(char_u *)"", 1L, (char_u *)"", 1L,
SEARCH_MSG + SEARCH_START, i) != FAIL) SEARCH_MSG + SEARCH_START,
i, (linenr_T)0) != FAIL)
lnum = pos.lnum; lnum = pos.lnum;
else else
{ {

View File

@ -73,6 +73,11 @@
# Include the recipe that autoconf generated. # Include the recipe that autoconf generated.
:include auto/config.aap :include auto/config.aap
# Unfortunately "-M" doesn't work when building for two architectures. Switch
# back to PPC only.
@if string.find(_no.CPPFLAGS, "-arch i386 -arch ppc") >= 0:
CPPFLAGS = `string.replace(_no.CPPFLAGS, "-arch i386 -arch ppc", "-arch ppc")`
# A "PREFIX=dir" argument overrules the value of $prefix # A "PREFIX=dir" argument overrules the value of $prefix
@if _no.get("PREFIX"): @if _no.get("PREFIX"):
prefix = $PREFIX prefix = $PREFIX

View File

@ -345,8 +345,8 @@ getmark(c, changefile)
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
else if (c == '<' || c == '>') /* start/end of visual area */ else if (c == '<' || c == '>') /* start/end of visual area */
{ {
startp = &curbuf->b_visual_start; startp = &curbuf->b_visual.vi_start;
endp = &curbuf->b_visual_end; endp = &curbuf->b_visual.vi_end;
if ((c == '<') == lt(*startp, *endp)) if ((c == '<') == lt(*startp, *endp))
posp = startp; posp = startp;
else else
@ -354,7 +354,7 @@ getmark(c, changefile)
/* /*
* For Visual line mode, set mark at begin or end of line * For Visual line mode, set mark at begin or end of line
*/ */
if (curbuf->b_visual_mode == 'V') if (curbuf->b_visual.vi_mode == 'V')
{ {
pos_copy = *posp; pos_copy = *posp;
posp = &pos_copy; posp = &pos_copy;
@ -679,8 +679,8 @@ do_marks(eap)
show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE); show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE);
show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE); show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE);
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
show_one_mark('<', arg, &curbuf->b_visual_start, NULL, TRUE); show_one_mark('<', arg, &curbuf->b_visual.vi_start, NULL, TRUE);
show_one_mark('>', arg, &curbuf->b_visual_end, NULL, TRUE); show_one_mark('>', arg, &curbuf->b_visual.vi_end, NULL, TRUE);
#endif #endif
show_one_mark(-1, arg, NULL, NULL, FALSE); show_one_mark(-1, arg, NULL, NULL, FALSE);
} }
@ -814,8 +814,8 @@ ex_delmarks(eap)
case '[': curbuf->b_op_start.lnum = 0; break; case '[': curbuf->b_op_start.lnum = 0; break;
case ']': curbuf->b_op_end.lnum = 0; break; case ']': curbuf->b_op_end.lnum = 0; break;
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
case '<': curbuf->b_visual_start.lnum = 0; break; case '<': curbuf->b_visual.vi_start.lnum = 0; break;
case '>': curbuf->b_visual_end.lnum = 0; break; case '>': curbuf->b_visual.vi_end.lnum = 0; break;
#endif #endif
case ' ': break; case ' ': break;
default: EMSG2(_(e_invarg2), p); default: EMSG2(_(e_invarg2), p);
@ -998,8 +998,8 @@ mark_adjust(line1, line2, amount, amount_after)
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
/* Visual area */ /* Visual area */
one_adjust_nodel(&(curbuf->b_visual_start.lnum)); one_adjust_nodel(&(curbuf->b_visual.vi_start.lnum));
one_adjust_nodel(&(curbuf->b_visual_end.lnum)); one_adjust_nodel(&(curbuf->b_visual.vi_end.lnum));
#endif #endif
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
@ -1173,8 +1173,8 @@ mark_col_adjust(lnum, mincol, lnum_amount, col_amount)
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
/* Visual area */ /* Visual area */
col_adjust(&(curbuf->b_visual_start)); col_adjust(&(curbuf->b_visual.vi_start));
col_adjust(&(curbuf->b_visual_end)); col_adjust(&(curbuf->b_visual.vi_end));
#endif #endif
/* previous context mark */ /* previous context mark */

View File

@ -1474,13 +1474,13 @@ do_pending_operator(cap, old_col, gui_yank)
else if (VIsual_active) else if (VIsual_active)
{ {
/* Save the current VIsual area for '< and '> marks, and "gv" */ /* Save the current VIsual area for '< and '> marks, and "gv" */
curbuf->b_visual_start = VIsual; curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual_end = curwin->w_cursor; curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual_mode = VIsual_mode; curbuf->b_visual.vi_mode = VIsual_mode;
curbuf->b_visual.vi_curswant = curwin->w_curswant;
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
curbuf->b_visual_mode_eval = VIsual_mode; curbuf->b_visual_mode_eval = VIsual_mode;
# endif # endif
curbuf->b_visual_curswant = curwin->w_curswant;
/* In Select mode, a linewise selection is operated upon like a /* In Select mode, a linewise selection is operated upon like a
* characterwise selection. */ * characterwise selection. */
@ -2126,7 +2126,7 @@ op_colon(oap)
* Handle the "g@" operator: call 'operatorfunc'. * Handle the "g@" operator: call 'operatorfunc'.
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
void static void
op_function(oap) op_function(oap)
oparg_T *oap; oparg_T *oap;
{ {
@ -3176,13 +3176,13 @@ end_visual_mode()
#endif #endif
/* Save the current VIsual area for '< and '> marks, and "gv" */ /* Save the current VIsual area for '< and '> marks, and "gv" */
curbuf->b_visual_mode = VIsual_mode; curbuf->b_visual.vi_mode = VIsual_mode;
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_curswant = curwin->w_curswant;
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
curbuf->b_visual_mode_eval = VIsual_mode; curbuf->b_visual_mode_eval = VIsual_mode;
#endif #endif
curbuf->b_visual_start = VIsual;
curbuf->b_visual_end = curwin->w_cursor;
curbuf->b_visual_curswant = curwin->w_curswant;
#ifdef FEAT_VIRTUALEDIT #ifdef FEAT_VIRTUALEDIT
if (!virtual_active()) if (!virtual_active())
curwin->w_cursor.coladd = 0; curwin->w_cursor.coladd = 0;
@ -4150,7 +4150,7 @@ find_decl(ptr, len, locally, thisblock, searchflags)
for (;;) for (;;)
{ {
t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD, t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD,
pat, 1L, searchflags, RE_LAST); pat, 1L, searchflags, RE_LAST, (linenr_T)0);
if (curwin->w_cursor.lnum >= old_pos.lnum) if (curwin->w_cursor.lnum >= old_pos.lnum)
t = FAIL; /* match after start is failure too */ t = FAIL; /* match after start is failure too */
@ -4985,7 +4985,7 @@ nv_hor_scrollbar(cap)
} }
#endif #endif
#ifdef FEAT_GUI_TABLINE #if defined(FEAT_GUI_TABLINE) || defined(PROTO)
/* /*
* Click in GUI tab. * Click in GUI tab.
*/ */
@ -5011,6 +5011,16 @@ nv_tabmenu(cap)
clearopbeep(cap->oap); clearopbeep(cap->oap);
/* Even if an operator was pending, we still want to jump tabs. */ /* Even if an operator was pending, we still want to jump tabs. */
handle_tabmenu();
}
/*
* Handle selecting an item of the GUI tab line menu.
* Used in Normal and Insert mode.
*/
void
handle_tabmenu()
{
switch (current_tabmenu) switch (current_tabmenu)
{ {
case TABLINE_MENU_CLOSE: case TABLINE_MENU_CLOSE:
@ -7475,9 +7485,9 @@ nv_g_cmd(cap)
if (checkclearop(oap)) if (checkclearop(oap))
break; break;
if ( curbuf->b_visual_start.lnum == 0 if ( curbuf->b_visual.vi_start.lnum == 0
|| curbuf->b_visual_start.lnum > curbuf->b_ml.ml_line_count || curbuf->b_visual.vi_start.lnum > curbuf->b_ml.ml_line_count
|| curbuf->b_visual_end.lnum == 0) || curbuf->b_visual.vi_end.lnum == 0)
beep_flush(); beep_flush();
else else
{ {
@ -7485,26 +7495,26 @@ nv_g_cmd(cap)
if (VIsual_active) if (VIsual_active)
{ {
i = VIsual_mode; i = VIsual_mode;
VIsual_mode = curbuf->b_visual_mode; VIsual_mode = curbuf->b_visual.vi_mode;
curbuf->b_visual_mode = i; curbuf->b_visual.vi_mode = i;
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
curbuf->b_visual_mode_eval = i; curbuf->b_visual_mode_eval = i;
# endif # endif
i = curwin->w_curswant; i = curwin->w_curswant;
curwin->w_curswant = curbuf->b_visual_curswant; curwin->w_curswant = curbuf->b_visual.vi_curswant;
curbuf->b_visual_curswant = i; curbuf->b_visual.vi_curswant = i;
tpos = curbuf->b_visual_end; tpos = curbuf->b_visual.vi_end;
curbuf->b_visual_end = curwin->w_cursor; curbuf->b_visual.vi_end = curwin->w_cursor;
curwin->w_cursor = curbuf->b_visual_start; curwin->w_cursor = curbuf->b_visual.vi_start;
curbuf->b_visual_start = VIsual; curbuf->b_visual.vi_start = VIsual;
} }
else else
{ {
VIsual_mode = curbuf->b_visual_mode; VIsual_mode = curbuf->b_visual.vi_mode;
curwin->w_curswant = curbuf->b_visual_curswant; curwin->w_curswant = curbuf->b_visual.vi_curswant;
tpos = curbuf->b_visual_end; tpos = curbuf->b_visual.vi_end;
curwin->w_cursor = curbuf->b_visual_start; curwin->w_cursor = curbuf->b_visual.vi_start;
} }
VIsual_active = TRUE; VIsual_active = TRUE;
@ -8941,8 +8951,8 @@ nv_put(cap)
* be the most useful, since the original text was removed. */ * be the most useful, since the original text was removed. */
if (was_visual) if (was_visual)
{ {
curbuf->b_visual_start = curbuf->b_op_start; curbuf->b_visual.vi_start = curbuf->b_op_start;
curbuf->b_visual_end = curbuf->b_op_end; curbuf->b_visual.vi_end = curbuf->b_op_end;
} }
/* When all lines were selected and deleted do_put() leaves an empty /* When all lines were selected and deleted do_put() leaves an empty

View File

@ -988,6 +988,11 @@ spell_check(wp, ptr, attrp, capcol, docount)
* then, skipping over the character. */ * then, skipping over the character. */
if (*ptr <= ' ') if (*ptr <= ' ')
return 1; return 1;
/* Return here when loading language files failed. */
if (wp->w_buffer->b_langp.ga_len == 0)
return 1;
vim_memset(&mi, 0, sizeof(matchinf_T)); vim_memset(&mi, 0, sizeof(matchinf_T));
/* A number is always OK. Also skip hexadecimal numbers 0xFF99 and /* A number is always OK. Also skip hexadecimal numbers 0xFF99 and
@ -1942,7 +1947,8 @@ spell_valid_case(wordflags, treeflags)
no_spell_checking(wp) no_spell_checking(wp)
win_T *wp; win_T *wp;
{ {
if (!wp->w_p_spell || *wp->w_buffer->b_p_spl == NUL) if (!wp->w_p_spell || *wp->w_buffer->b_p_spl == NUL
|| wp->w_buffer->b_langp.ga_len == 0)
{ {
EMSG(_("E756: Spell checking is not enabled")); EMSG(_("E756: Spell checking is not enabled"));
return TRUE; return TRUE;

View File

@ -1465,6 +1465,24 @@ int vim_memcmp __ARGS((void *, void *, size_t));
*/ */
#define vim_iswhite(x) ((x) == ' ' || (x) == '\t') #define vim_iswhite(x) ((x) == ' ' || (x) == '\t')
/*
* EXTERN is only defined in main.c. That's where global variables are
* actually defined and initialized.
*/
#ifndef EXTERN
# define EXTERN extern
# define INIT(x)
#else
# ifndef INIT
# define INIT(x) x
# define DO_INIT
# endif
#endif
/* Include option.h before structs.h, because the number of window-local and
* buffer-local options is used there. */
#include "option.h" /* options and default values */
/* Note that gui.h is included by structs.h */ /* Note that gui.h is included by structs.h */
#include "structs.h" /* file that defines many structures */ #include "structs.h" /* file that defines many structures */
@ -1663,20 +1681,6 @@ typedef int VimClipboard; /* This is required for the prototypes. */
# define stat(a,b) (access(a,0) ? -1 : stat(a,b)) # define stat(a,b) (access(a,0) ? -1 : stat(a,b))
#endif #endif
/*
* EXTERN is only defined in main.c. That's where global variables are
* actually defined and initialized.
*/
#ifndef EXTERN
# define EXTERN extern
# define INIT(x)
#else
# ifndef INIT
# define INIT(x) x
# define DO_INIT
# endif
#endif
#ifdef FEAT_PROFILE #ifdef FEAT_PROFILE
# ifdef WIN3264 # ifdef WIN3264
typedef LARGE_INTEGER proftime_T; typedef LARGE_INTEGER proftime_T;
@ -1687,7 +1691,6 @@ typedef struct timeval proftime_T;
typedef int proftime_T; /* dummy for function prototypes */ typedef int proftime_T; /* dummy for function prototypes */
#endif #endif
#include "option.h" /* option variables and defines */
#include "ex_cmds.h" /* Ex command defines */ #include "ex_cmds.h" /* Ex command defines */
#include "proto.h" /* function prototypes */ #include "proto.h" /* function prototypes */

View File

@ -3323,7 +3323,7 @@ goto_tabpage(n)
#ifdef FEAT_GUI_TABLINE #ifdef FEAT_GUI_TABLINE
if (gui_use_tabline()) if (gui_use_tabline())
gui_mch_set_curtab(tabpage_index(tp)); gui_mch_set_curtab(tabpage_index(curtab));
#endif #endif
} }