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-27 00:11:10 +00:00
parent a23ccb8ac6
commit eddf53b02e
8 changed files with 152 additions and 208 deletions

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 *todo.txt* For Vim version 7.0aa. Last change: 2006 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,49 +30,17 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Tab pages: Script ID is only remembered for global options. Should remember it for every
- Add 'guitablabel' option. local option separately.
- GTK GUI implementation for the tab pages line: Change PV_XXX values in separate ranges for buffer and window.
handling of tab in insert mode (like clicking mouse in other window) Move the enums to option.h so that the size is known in structs.h
and cmdline mode (keep current tab) use array for each window and buffer with scriptID values.
9 GUI implementation for the tab pages line for other systems.
8 Make GUI menu in tab pages line configurable. Like the popup menu.
8 tab pages in the session file, if "tabpages" in 'sessionoptions'
8 :tabmove +N move tab page N pages forward
8 :tabmove -N move tab page N pages backward
7 :tabdup duplicate the tab with all its windows.
6 :tab ball tab page for each buffer
6 :tab all tab page for each argument
7 In GUI: right click can popup a menu to close a specific tab.
7 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.
7 Add local variables for each tab page?
8 Add local options for each tab page? E.g., 'diffopt' could differ between
tab pages.
7 Add local highlighting for a tab page?
Spelling: m'n -> no suggestion for "mijn"?
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.
Crash with X command server (Ciaran McCreesh). Crash with X command server (Ciaran McCreesh).
Make virtcol([lnum, col]) work?
"dip" in end empty lines at end of file leaves one line. (Matt Mzyzik)
Ctags still hasn't included the patch. Darren is looking for someone to do Ctags still hasn't included the patch. Darren is looking for someone to do
maintanance. maintanance.
Script ID is only remembered for global options. Should remember it for every
local option separately.
"fsutil hardlink" can create a hard link on an NTFS file system. (Daniel "fsutil hardlink" can create a hard link on an NTFS file system. (Daniel
Einspanjer) What library function can detect that? Einspanjer) What library function can detect that?
@ -1391,6 +1359,23 @@ User Friendlier:
global_event_filter() for GTK. global_event_filter() for GTK.
Tab pages:
9 GUI implementation for the tab pages line for other systems.
8 Make GUI menu in tab pages line configurable. Like the popup menu.
8 tab pages in the session file, if "tabpages" in 'sessionoptions'
8 :tabmove +N move tab page N pages forward
8 :tabmove -N move tab page N pages backward
7 :tabdup duplicate the tab with all its windows.
6 :tab ball tab page for each buffer
6 :tab all tab page for each argument
7 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.
7 Add local variables for each tab page?
8 Add local options for each tab page? E.g., 'diffopt' could differ between
tab pages.
7 Add local highlighting for each tab page?
Spell checking: Spell checking:
9 Work together with OpenOffice.org to update the wordlists. (Adri Verhoef, 9 Work together with OpenOffice.org to update the wordlists. (Adri Verhoef,
Aad Nales) Setup vim-spell maillist? Aad Nales) Setup vim-spell maillist?

View File

@ -1,4 +1,4 @@
*usr_12.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 *usr_12.txt* For Vim version 7.0aa. Last change: 2006 Feb 26
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -273,7 +273,7 @@ To display a man page for the word under the cursor, use this: >
For example, you want to know the return value of "strstr()" while editing For example, you want to know the return value of "strstr()" while editing
this line: this line:
if (strstr(input, "aap") == ) ~ if ( strstr (input, "aap") == ) ~
Move the cursor to somewhere on "strstr" and type "\K". A window will open Move the cursor to somewhere on "strstr" and type "\K". A window will open
to display the man page for strstr(). to display the man page for strstr().

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 25 *version7.txt* For Vim version 7.0aa. Last change: 2006 Feb 26
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -734,6 +734,9 @@ other Vim to the foreground.
When starting Vim with a "-t tag" argument, there is an existing swapfile and When starting Vim with a "-t tag" argument, there is an existing swapfile and
the user selects "quit" or "abort" then exit Vim. the user selects "quit" or "abort" then exit Vim.
Undo now also restores the '< and '> marks. "gv" selects the same area as
before the change and undo.
============================================================================== ==============================================================================
IMPROVEMENTS *improvements-7* IMPROVEMENTS *improvements-7*
@ -948,6 +951,9 @@ Win32: Balloons can have multiple lines if common controls supports it.
The 's' flag is added to the search() and searchpair() function to set the The 's' flag is added to the search() and searchpair() function to set the
' mark if the cursor is moved. (Yegappan Lakshmanan) ' mark if the cursor is moved. (Yegappan Lakshmanan)
The search() and searchpair() functions have an extra argument to specify
where to stop searching. Speeds up searches that should not continue too far.
For 'errorformat' it was not possible to have a file name that contains the For 'errorformat' it was not possible to have a file name that contains the
character that follows after "%f". For example, in "%f:%l:%m" the file name character that follows after "%f". For example, in "%f:%l:%m" the file name
could not contain ":". Now include the first ":" where the rest of the could not contain ":". Now include the first ":" where the rest of the
@ -1077,6 +1083,9 @@ Mac: When running "make install" the runtime files are installed as for Unix.
Avoids that too many files are copied. When running "make" a link to the Avoids that too many files are copied. When running "make" a link to the
runtime files is created to avoid a recursive copy that takes much time. runtime files is created to avoid a recursive copy that takes much time.
Mac: Configure will attempt to build Vim for both Intel and PowerPC. The
--with-mac-arch configure argument can change it.
============================================================================== ==============================================================================
BUG FIXES *bug-fixes-7* BUG FIXES *bug-fixes-7*
@ -1756,4 +1765,6 @@ block could be unhighlighted.
When counting words for the Visual block area and using "$" to select until When counting words for the Visual block area and using "$" to select until
the end of every line only up to the length of the last line was counted. the end of every line only up to the length of the last line was counted.
"dip" in trailing empty lines left one empty line behind.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -400,6 +400,7 @@ static int get_option_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int get_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); static int get_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int rettv_list_alloc __ARGS((typval_T *rettv));
static listitem_T *listitem_alloc __ARGS((void)); static listitem_T *listitem_alloc __ARGS((void));
static void listitem_free __ARGS((listitem_T *item)); static void listitem_free __ARGS((listitem_T *item));
static void listitem_remove __ARGS((list_T *l, listitem_T *item)); static void listitem_remove __ARGS((list_T *l, listitem_T *item));
@ -5222,6 +5223,25 @@ list_alloc()
return l; return l;
} }
/*
* Allocate an empty list for a return value.
* Returns OK or FAIL.
*/
static int
rettv_list_alloc(rettv)
typval_T *rettv;
{
list_T *l = list_alloc();
if (l == NULL)
return FAIL;
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
return OK;
}
/* /*
* Unreference a list: decrement the reference count and free it when it * Unreference a list: decrement the reference count and free it when it
* becomes zero. * becomes zero.
@ -6952,11 +6972,11 @@ static struct fst
{"repeat", 2, 2, f_repeat}, {"repeat", 2, 2, f_repeat},
{"resolve", 1, 1, f_resolve}, {"resolve", 1, 1, f_resolve},
{"reverse", 1, 1, f_reverse}, {"reverse", 1, 1, f_reverse},
{"search", 1, 2, f_search}, {"search", 1, 3, f_search},
{"searchdecl", 1, 3, f_searchdecl}, {"searchdecl", 1, 3, f_searchdecl},
{"searchpair", 3, 5, f_searchpair}, {"searchpair", 3, 6, f_searchpair},
{"searchpairpos", 3, 5, f_searchpairpos}, {"searchpairpos", 3, 6, f_searchpairpos},
{"searchpos", 1, 2, f_searchpos}, {"searchpos", 1, 3, f_searchpos},
{"server2client", 2, 2, f_server2client}, {"server2client", 2, 2, f_server2client},
{"serverlist", 0, 0, f_serverlist}, {"serverlist", 0, 0, f_serverlist},
{"setbufvar", 3, 3, f_setbufvar}, {"setbufvar", 3, 3, f_setbufvar},
@ -9353,17 +9373,11 @@ get_buffer_lines(buf, start, end, retlist, rettv)
typval_T *rettv; typval_T *rettv;
{ {
char_u *p; char_u *p;
list_T *l = NULL;
if (retlist) if (retlist)
{ {
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
} }
else else
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
@ -9391,8 +9405,8 @@ get_buffer_lines(buf, start, end, retlist, rettv)
if (end > buf->b_ml.ml_line_count) if (end > buf->b_ml.ml_line_count)
end = buf->b_ml.ml_line_count; end = buf->b_ml.ml_line_count;
while (start <= end) while (start <= end)
if (list_append_string(l, ml_get_buf(buf, start++, FALSE), -1) if (list_append_string(rettv->vval.v_list,
== FAIL) ml_get_buf(buf, start++, FALSE), -1) == FAIL)
break; break;
} }
} }
@ -9846,18 +9860,13 @@ f_getqflist(argvars, rettv)
typval_T *rettv; typval_T *rettv;
{ {
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
list_T *l;
win_T *wp; win_T *wp;
#endif #endif
rettv->vval.v_number = FALSE; rettv->vval.v_number = FALSE;
#ifdef FEAT_QUICKFIX #ifdef FEAT_QUICKFIX
l = list_alloc(); if (rettv_list_alloc(rettv) == OK)
if (l != NULL)
{ {
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
wp = NULL; wp = NULL;
if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */ if (argvars[0].v_type != VAR_UNKNOWN) /* getloclist() */
{ {
@ -9866,7 +9875,7 @@ f_getqflist(argvars, rettv)
return; return;
} }
(void)get_errorlist(wp, l); (void)get_errorlist(wp, rettv->vval.v_list);
} }
#endif #endif
} }
@ -11297,7 +11306,6 @@ dict_list(argvars, rettv, what)
typval_T *rettv; typval_T *rettv;
int what; int what;
{ {
list_T *l;
list_T *l2; list_T *l2;
dictitem_T *di; dictitem_T *di;
hashitem_T *hi; hashitem_T *hi;
@ -11315,12 +11323,8 @@ dict_list(argvars, rettv, what)
if ((d = argvars[0].vval.v_dict) == NULL) if ((d = argvars[0].vval.v_dict) == NULL)
return; return;
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
todo = d->dv_hashtab.ht_used; todo = d->dv_hashtab.ht_used;
for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
@ -11333,7 +11337,7 @@ dict_list(argvars, rettv, what)
li = listitem_alloc(); li = listitem_alloc();
if (li == NULL) if (li == NULL)
break; break;
list_append(l, li); list_append(rettv->vval.v_list, li);
if (what == 0) if (what == 0)
{ {
@ -11741,10 +11745,8 @@ find_some_match(argvars, rettv, type)
if (type == 3) if (type == 3)
{ {
/* return empty list when there are no matches */ /* return empty list when there are no matches */
if ((rettv->vval.v_list = list_alloc()) == NULL) if (rettv_list_alloc(rettv) == FAIL)
goto theend; goto theend;
rettv->v_type = VAR_LIST;
++rettv->vval.v_list->lv_refcount;
} }
else if (type == 2) else if (type == 2)
{ {
@ -12259,7 +12261,6 @@ f_range(argvars, rettv)
long end; long end;
long stride = 1; long stride = 1;
long i; long i;
list_T *l;
int error = FALSE; int error = FALSE;
start = get_tv_number_chk(&argvars[0], &error); start = get_tv_number_chk(&argvars[0], &error);
@ -12284,17 +12285,11 @@ f_range(argvars, rettv)
EMSG(_("E727: Start past end")); EMSG(_("E727: Start past end"));
else else
{ {
l = list_alloc(); if (rettv_list_alloc(rettv) == OK)
if (l != NULL)
{
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
for (i = start; stride > 0 ? i <= end : i >= end; i += stride) for (i = start; stride > 0 ? i <= end : i >= end; i += stride)
if (list_append_number(l, (varnumber_T)i) == FAIL) if (list_append_number(rettv->vval.v_list,
(varnumber_T)i) == FAIL)
break; break;
}
} }
} }
@ -12309,7 +12304,6 @@ f_readfile(argvars, rettv)
int binary = FALSE; int binary = FALSE;
char_u *fname; char_u *fname;
FILE *fd; FILE *fd;
list_T *l;
listitem_T *li; listitem_T *li;
#define FREAD_SIZE 200 /* optimized for text lines */ #define FREAD_SIZE 200 /* optimized for text lines */
char_u buf[FREAD_SIZE]; char_u buf[FREAD_SIZE];
@ -12333,12 +12327,8 @@ f_readfile(argvars, rettv)
maxline = get_tv_number(&argvars[2]); maxline = get_tv_number(&argvars[2]);
} }
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
l->lv_refcount = 1;
/* Always open the file in binary mode, library functions have a mind of /* Always open the file in binary mode, library functions have a mind of
* their own about CR-LF conversion. */ * their own about CR-LF conversion. */
@ -12397,7 +12387,7 @@ f_readfile(argvars, rettv)
li->li_tv.v_type = VAR_STRING; li->li_tv.v_type = VAR_STRING;
li->li_tv.v_lock = 0; li->li_tv.v_lock = 0;
li->li_tv.vval.v_string = s; li->li_tv.vval.v_string = s;
list_append(l, li); list_append(rettv->vval.v_list, li);
if (++cnt >= maxline && maxline >= 0) if (++cnt >= maxline && maxline >= 0)
break; break;
@ -12446,7 +12436,7 @@ f_readfile(argvars, rettv)
if (maxline < 0) if (maxline < 0)
while (cnt > -maxline) while (cnt > -maxline)
{ {
listitem_remove(l, l->lv_first); listitem_remove(rettv->vval.v_list, rettv->vval.v_list->lv_first);
--cnt; --cnt;
} }
@ -12788,14 +12778,11 @@ f_remove(argvars, rettv)
else else
{ {
list_remove(l, item, item2); list_remove(l, item, item2);
l = list_alloc(); if (rettv_list_alloc(rettv) == OK)
if (l != NULL)
{ {
rettv->v_type = VAR_LIST; l = rettv->vval.v_list;
rettv->vval.v_list = l;
l->lv_first = item; l->lv_first = item;
l->lv_last = item2; l->lv_last = item2;
l->lv_refcount = 1;
item->li_prev = NULL; item->li_prev = NULL;
item2->li_next = NULL; item2->li_next = NULL;
l->lv_len = cnt; l->lv_len = cnt;
@ -12839,21 +12826,15 @@ f_repeat(argvars, rettv)
int len; int len;
char_u *r; char_u *r;
int i; int i;
list_T *l;
n = get_tv_number(&argvars[1]); n = get_tv_number(&argvars[1]);
if (argvars[0].v_type == VAR_LIST) if (argvars[0].v_type == VAR_LIST)
{ {
l = list_alloc(); if (rettv_list_alloc(rettv) == OK && argvars[0].vval.v_list != NULL)
if (l != NULL && argvars[0].vval.v_list != NULL)
{
l->lv_refcount = 1;
while (n-- > 0) while (n-- > 0)
if (list_extend(l, argvars[0].vval.v_list, NULL) == FAIL) if (list_extend(rettv->vval.v_list,
argvars[0].vval.v_list, NULL) == FAIL)
break; break;
}
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
} }
else else
{ {
@ -13174,7 +13155,7 @@ get_search_arg(varp, flagsp)
static int static int
search_cmn(argvars, match_pos) search_cmn(argvars, match_pos)
typval_T *argvars; typval_T *argvars;
pos_T *match_pos; pos_T *match_pos;
{ {
char_u *pat; char_u *pat;
pos_T pos; pos_T pos;
@ -13183,11 +13164,22 @@ search_cmn(argvars, match_pos)
int dir; int dir;
int flags = 0; int flags = 0;
int retval = 0; /* default: FAIL */ int retval = 0; /* default: FAIL */
long lnum_stop = 0;
pat = get_tv_string(&argvars[0]); pat = get_tv_string(&argvars[0]);
dir = get_search_arg(&argvars[1], &flags); /* may set p_ws */ dir = get_search_arg(&argvars[1], &flags); /* may set p_ws */
if (dir == 0) if (dir == 0)
goto theend; goto theend;
/* Optional extra argument: line number to stop searching. */
if (argvars[1].v_type != VAR_UNKNOWN
&& argvars[2].v_type != VAR_UNKNOWN)
{
lnum_stop = get_tv_number_chk(&argvars[2], NULL);
if (lnum_stop < 0)
goto theend;
}
/* /*
* This function accepts only SP_NOMOVE and SP_SETPCMARK flags. * This function accepts only SP_NOMOVE and SP_SETPCMARK flags.
* Check to make sure only those flags are set. * Check to make sure only those flags are set.
@ -13203,7 +13195,7 @@ search_cmn(argvars, match_pos)
pos = save_cursor = curwin->w_cursor; pos = save_cursor = curwin->w_cursor;
if (searchit(curwin, curbuf, &pos, dir, pat, 1L, if (searchit(curwin, curbuf, &pos, dir, pat, 1L,
SEARCH_KEEP, RE_SEARCH) != FAIL) SEARCH_KEEP, RE_SEARCH, (linenr_T)lnum_stop) != FAIL)
{ {
retval = pos.lnum; retval = pos.lnum;
if (flags & SP_SETPCMARK) if (flags & SP_SETPCMARK)
@ -13284,6 +13276,7 @@ searchpair_cmn(argvars, match_pos)
char_u nbuf2[NUMBUFLEN]; char_u nbuf2[NUMBUFLEN];
char_u nbuf3[NUMBUFLEN]; char_u nbuf3[NUMBUFLEN];
int retval = 0; /* default: FAIL */ int retval = 0; /* default: FAIL */
long lnum_stop = 0;
/* Get the three pattern arguments: start, middle, end. */ /* Get the three pattern arguments: start, middle, end. */
spat = get_tv_string_chk(&argvars[0]); spat = get_tv_string_chk(&argvars[0]);
@ -13310,11 +13303,20 @@ searchpair_cmn(argvars, match_pos)
|| argvars[4].v_type == VAR_UNKNOWN) || argvars[4].v_type == VAR_UNKNOWN)
skip = (char_u *)""; skip = (char_u *)"";
else else
{
skip = get_tv_string_buf_chk(&argvars[4], nbuf3); skip = get_tv_string_buf_chk(&argvars[4], nbuf3);
if (argvars[5].v_type != VAR_UNKNOWN)
{
lnum_stop = get_tv_number_chk(&argvars[5], NULL);
if (lnum_stop < 0)
goto theend;
}
}
if (skip == NULL) if (skip == NULL)
goto theend; /* type error */ goto theend; /* type error */
retval = do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos); retval = do_searchpair(spat, mpat, epat, dir, skip, flags,
match_pos, lnum_stop);
theend: theend:
p_ws = save_p_ws; p_ws = save_p_ws;
@ -13341,19 +13343,14 @@ f_searchpairpos(argvars, rettv)
typval_T *argvars; typval_T *argvars;
typval_T *rettv; typval_T *rettv;
{ {
list_T *l;
pos_T match_pos; pos_T match_pos;
int lnum = 0; int lnum = 0;
int col = 0; int col = 0;
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
if (searchpair_cmn(argvars, &match_pos) > 0) if (searchpair_cmn(argvars, &match_pos) > 0)
{ {
@ -13361,8 +13358,8 @@ f_searchpairpos(argvars, rettv)
col = match_pos.col; col = match_pos.col;
} }
list_append_number(l, (varnumber_T)lnum); list_append_number(rettv->vval.v_list, (varnumber_T)lnum);
list_append_number(l, (varnumber_T)col); list_append_number(rettv->vval.v_list, (varnumber_T)col);
} }
/* /*
@ -13371,7 +13368,7 @@ f_searchpairpos(argvars, rettv)
* Returns 0 or -1 for no match, * Returns 0 or -1 for no match,
*/ */
long long
do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos) do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos, lnum_stop)
char_u *spat; /* start pattern */ char_u *spat; /* start pattern */
char_u *mpat; /* middle pattern */ char_u *mpat; /* middle pattern */
char_u *epat; /* end pattern */ char_u *epat; /* end pattern */
@ -13379,6 +13376,7 @@ do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos)
char_u *skip; /* skip expression */ char_u *skip; /* skip expression */
int flags; /* SP_RETCOUNT, SP_REPEAT, SP_NOMOVE */ int flags; /* SP_RETCOUNT, SP_REPEAT, SP_NOMOVE */
pos_T *match_pos; pos_T *match_pos;
linenr_T lnum_stop; /* stop at this line if not zero */
{ {
char_u *save_cpo; char_u *save_cpo;
char_u *pat, *pat2 = NULL, *pat3 = NULL; char_u *pat, *pat2 = NULL, *pat3 = NULL;
@ -13418,7 +13416,7 @@ do_searchpair(spat, mpat, epat, dir, skip, flags, match_pos)
for (;;) for (;;)
{ {
n = searchit(curwin, curbuf, &pos, dir, pat, 1L, n = searchit(curwin, curbuf, &pos, dir, pat, 1L,
SEARCH_KEEP, RE_SEARCH); SEARCH_KEEP, RE_SEARCH, lnum_stop);
if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos))) if (n == FAIL || (firstpos.lnum != 0 && equalpos(pos, firstpos)))
/* didn't find it or found the first match again: FAIL */ /* didn't find it or found the first match again: FAIL */
break; break;
@ -13513,19 +13511,14 @@ f_searchpos(argvars, rettv)
typval_T *argvars; typval_T *argvars;
typval_T *rettv; typval_T *rettv;
{ {
list_T *l;
pos_T match_pos; pos_T match_pos;
int lnum = 0; int lnum = 0;
int col = 0; int col = 0;
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
if (search_cmn(argvars, &match_pos) > 0) if (search_cmn(argvars, &match_pos) > 0)
{ {
@ -13533,8 +13526,8 @@ f_searchpos(argvars, rettv)
col = match_pos.col; col = match_pos.col;
} }
list_append_number(l, (varnumber_T)lnum); list_append_number(rettv->vval.v_list, (varnumber_T)lnum);
list_append_number(l, (varnumber_T)col); list_append_number(rettv->vval.v_list, (varnumber_T)col);
} }
@ -14167,14 +14160,9 @@ f_spellbadword(argvars, rettv)
char_u *word = (char_u *)""; char_u *word = (char_u *)"";
hlf_T attr = HLF_COUNT; hlf_T attr = HLF_COUNT;
int len = 0; int len = 0;
list_T *l;
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
if (argvars[0].v_type == VAR_UNKNOWN) if (argvars[0].v_type == VAR_UNKNOWN)
@ -14206,8 +14194,8 @@ f_spellbadword(argvars, rettv)
} }
#endif #endif
list_append_string(l, word, len); list_append_string(rettv->vval.v_list, word, len);
list_append_string(l, (char_u *)( list_append_string(rettv->vval.v_list, (char_u *)(
attr == HLF_SPB ? "bad" : attr == HLF_SPB ? "bad" :
attr == HLF_SPR ? "rare" : attr == HLF_SPR ? "rare" :
attr == HLF_SPL ? "local" : attr == HLF_SPL ? "local" :
@ -14223,7 +14211,6 @@ f_spellsuggest(argvars, rettv)
typval_T *argvars; typval_T *argvars;
typval_T *rettv; typval_T *rettv;
{ {
list_T *l;
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
char_u *str; char_u *str;
int typeerr = FALSE; int typeerr = FALSE;
@ -14234,12 +14221,8 @@ f_spellsuggest(argvars, rettv)
int need_capital = FALSE; int need_capital = FALSE;
#endif #endif
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
#ifdef FEAT_SYN_HL #ifdef FEAT_SYN_HL
if (curwin->w_p_spell && *curbuf->b_p_spl != NUL) if (curwin->w_p_spell && *curbuf->b_p_spl != NUL)
@ -14274,7 +14257,7 @@ f_spellsuggest(argvars, rettv)
li->li_tv.v_type = VAR_STRING; li->li_tv.v_type = VAR_STRING;
li->li_tv.v_lock = 0; li->li_tv.v_lock = 0;
li->li_tv.vval.v_string = str; li->li_tv.vval.v_string = str;
list_append(l, li); list_append(rettv->vval.v_list, li);
} }
} }
ga_clear(&ga); ga_clear(&ga);
@ -14294,7 +14277,6 @@ f_split(argvars, rettv)
char_u patbuf[NUMBUFLEN]; char_u patbuf[NUMBUFLEN];
char_u *save_cpo; char_u *save_cpo;
int match; int match;
list_T *l;
colnr_T col = 0; colnr_T col = 0;
int keepempty = FALSE; int keepempty = FALSE;
int typeerr = FALSE; int typeerr = FALSE;
@ -14315,12 +14297,8 @@ f_split(argvars, rettv)
if (pat == NULL || *pat == NUL) if (pat == NULL || *pat == NUL)
pat = (char_u *)"[\\x01- ]\\+"; pat = (char_u *)"[\\x01- ]\\+";
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
return; return;
rettv->v_type = VAR_LIST;
rettv->vval.v_list = l;
++l->lv_refcount;
if (typeerr) if (typeerr)
return; return;
@ -14338,10 +14316,11 @@ f_split(argvars, rettv)
end = regmatch.startp[0]; end = regmatch.startp[0];
else else
end = str + STRLEN(str); end = str + STRLEN(str);
if (keepempty || end > str || (l->lv_len > 0 && *str != NUL if (keepempty || end > str || (rettv->vval.v_list->lv_len > 0
&& match && end < regmatch.endp[0])) && *str != NUL && match && end < regmatch.endp[0]))
{ {
if (list_append_string(l, str, (int)(end - str)) == FAIL) if (list_append_string(rettv->vval.v_list, str,
(int)(end - str)) == FAIL)
break; break;
} }
if (!match) if (!match)
@ -14891,7 +14870,6 @@ f_tabpagebuflist(argvars, rettv)
#else #else
tabpage_T *tp; tabpage_T *tp;
win_T *wp = NULL; win_T *wp = NULL;
list_T *l;
if (argvars[0].v_type == VAR_UNKNOWN) if (argvars[0].v_type == VAR_UNKNOWN)
wp = firstwin; wp = firstwin;
@ -14905,17 +14883,13 @@ f_tabpagebuflist(argvars, rettv)
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
else else
{ {
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
else else
{ {
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
for (; wp != NULL; wp = wp->w_next) for (; wp != NULL; wp = wp->w_next)
if (list_append_number(l, wp->w_buffer->b_fnum) == FAIL) if (list_append_number(rettv->vval.v_list,
wp->w_buffer->b_fnum) == FAIL)
break; break;
} }
} }
@ -15033,23 +15007,20 @@ f_tagfiles(argvars, rettv)
typval_T *rettv; typval_T *rettv;
{ {
char_u fname[MAXPATHL + 1]; char_u fname[MAXPATHL + 1];
list_T *l; tagname_T tn;
int first;
l = list_alloc(); if (rettv_list_alloc(rettv) == FAIL)
if (l == NULL)
{ {
rettv->vval.v_number = 0; rettv->vval.v_number = 0;
return; return;
} }
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
get_tagfname(TRUE, NULL); for (first = TRUE; ; first = FALSE)
for (;;) if (get_tagfname(&tn, first, fname) == FAIL
if (get_tagfname(FALSE, fname) == FAIL || list_append_string(rettv->vval.v_list, fname, -1) == FAIL)
|| list_append_string(l, fname, -1) == FAIL)
break; break;
tagname_free(&tn);
} }
/* /*
@ -15061,7 +15032,6 @@ f_taglist(argvars, rettv)
typval_T *rettv; typval_T *rettv;
{ {
char_u *tag_pattern; char_u *tag_pattern;
list_T *l;
tag_pattern = get_tv_string(&argvars[0]); tag_pattern = get_tv_string(&argvars[0]);
@ -15069,18 +15039,8 @@ f_taglist(argvars, rettv)
if (*tag_pattern == NUL) if (*tag_pattern == NUL)
return; return;
l = list_alloc(); if (rettv_list_alloc(rettv) == OK)
if (l != NULL) (void)get_tags(rettv->vval.v_list, tag_pattern);
{
if (get_tags(l, tag_pattern) != FAIL)
{
rettv->vval.v_list = l;
rettv->v_type = VAR_LIST;
++l->lv_refcount;
}
else
list_free(l);
}
} }
/* /*

View File

@ -3086,25 +3086,6 @@ tabline_menu_handler(GtkMenuItem *item, gpointer user_data)
gtk_main_quit(); gtk_main_quit();
} }
/*
* Send the event for clicking to select tab page "nr".
*/
static void
send_tabline_event(int nr)
{
char_u string[3];
string[0] = CSI;
string[1] = KS_TABLINE;
string[2] = KE_FILLER;
add_to_input_buf(string, 3);
string[0] = nr;
add_to_input_buf_csi(string, 1);
if (gtk_main_level() > 0)
gtk_main_quit();
}
/* /*
* Create a menu for the tab line. * Create a menu for the tab line.
*/ */
@ -3178,8 +3159,11 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
return TRUE; return TRUE;
} }
else if (bevent->button == 1 && clicked_page == 0) else if (bevent->button == 1 && clicked_page == 0)
{
/* Click after all tabs moves to next tab page. */ /* Click after all tabs moves to next tab page. */
send_tabline_event(0); if (send_tabline_event(0) && gtk_main_level() > 0)
gtk_main_quit();
}
} }
/* We didn't handle the event. */ /* We didn't handle the event. */
return FALSE; return FALSE;
@ -3197,7 +3181,10 @@ on_select_tab(
gpointer data) gpointer data)
{ {
if (!ignore_tabline_evt) if (!ignore_tabline_evt)
send_tabline_event(index + 1); {
if (send_tabline_event(index + 1) && gtk_main_level() > 0)
gtk_main_quit();
}
} }
/* /*

View File

@ -2129,14 +2129,14 @@ ex_emenu(eap)
* quick way of detecting whether we are doing this from a * quick way of detecting whether we are doing this from a
* selection - see if the range matches up with the visual * selection - see if the range matches up with the visual
* select start and end. */ * select start and end. */
if ((curbuf->b_visual_start.lnum == eap->line1) if ((curbuf->b_visual.vi_start.lnum == eap->line1)
&& (curbuf->b_visual_end.lnum) == eap->line2) && (curbuf->b_visual.vi_end.lnum) == eap->line2)
{ {
/* Set it up for visual mode - equivalent to gv. */ /* Set it up for visual mode - equivalent to gv. */
VIsual_mode = curbuf->b_visual_mode; VIsual_mode = curbuf->b_visual.vi_mode;
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;
curwin->w_curswant = curbuf->b_visual_curswant; curwin->w_curswant = curbuf->b_visual.vi_curswant;
} }
else else
{ {

View File

@ -9,7 +9,7 @@ char_u *last_search_pat __ARGS((void));
void reset_search_dir __ARGS((void)); void reset_search_dir __ARGS((void));
void set_last_search_pat __ARGS((char_u *s, int idx, int magic, int setlast)); void set_last_search_pat __ARGS((char_u *s, int idx, int magic, int setlast));
void last_pat_prog __ARGS((regmmatch_T *regmatch)); void last_pat_prog __ARGS((regmmatch_T *regmatch));
int searchit __ARGS((win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use)); int searchit __ARGS((win_T *win, buf_T *buf, pos_T *pos, int dir, char_u *pat, long count, int options, int pat_use, linenr_T stop_lnum));
int do_search __ARGS((oparg_T *oap, int dirc, char_u *pat, long count, int options)); int do_search __ARGS((oparg_T *oap, int dirc, char_u *pat, long count, int options));
int search_for_exact_line __ARGS((buf_T *buf, pos_T *pos, int dir, char_u *pat)); int search_for_exact_line __ARGS((buf_T *buf, pos_T *pos, int dir, char_u *pat));
int searchc __ARGS((cmdarg_T *cap, int t_cmd)); int searchc __ARGS((cmdarg_T *cap, int t_cmd));

View File

@ -4,7 +4,8 @@ void tag_freematch __ARGS((void));
void do_tags __ARGS((exarg_T *eap)); void do_tags __ARGS((exarg_T *eap));
int find_tags __ARGS((char_u *pat, int *num_matches, char_u ***matchesp, int flags, int mincount, char_u *buf_ffname)); int find_tags __ARGS((char_u *pat, int *num_matches, char_u ***matchesp, int flags, int mincount, char_u *buf_ffname));
void free_tag_stuff __ARGS((void)); void free_tag_stuff __ARGS((void));
int get_tagfname __ARGS((int first, char_u *buf)); int get_tagfname __ARGS((tagname_T *tnp, int first, char_u *buf));
void tagname_free __ARGS((tagname_T *tnp));
void simplify_filename __ARGS((char_u *filename)); void simplify_filename __ARGS((char_u *filename));
int expand_tags __ARGS((int tagnames, char_u *pat, int *num_file, char_u ***file)); int expand_tags __ARGS((int tagnames, char_u *pat, int *num_file, char_u ***file));
int get_tags __ARGS((list_T *list, char_u *pat)); int get_tags __ARGS((list_T *list, char_u *pat));