Compare commits

...

21 Commits

Author SHA1 Message Date
Bram Moolenaar
20de1c20e6 updated for version 7.2-237 2009-07-22 11:28:11 +00:00
Bram Moolenaar
996b6d86cc updated for version 7.2-236 2009-07-22 09:17:23 +00:00
Bram Moolenaar
b245016c15 updated for version 7.2-235 2009-07-22 09:04:20 +00:00
Bram Moolenaar
055a2ba10e updated for version 7.2-234 2009-07-14 19:40:21 +00:00
Bram Moolenaar
a2974d70f1 updated for version 7.2-233 2009-07-14 16:38:36 +00:00
Bram Moolenaar
2572492eba updated for version 7.2-232 2009-07-14 15:38:41 +00:00
Bram Moolenaar
3f947ead6f updated for version 7.2-231 2009-07-14 14:04:54 +00:00
Bram Moolenaar
d31aca26de updated for version 7.2-230 2009-07-14 11:44:30 +00:00
Bram Moolenaar
262735ed58 updated for version 7.2-229 2009-07-14 10:20:22 +00:00
Bram Moolenaar
9fa49da747 updated for version 7.2-228 2009-07-10 13:11:26 +00:00
Bram Moolenaar
fcfbc670c7 updated for version 7.2-227 2009-07-09 18:13:49 +00:00
Bram Moolenaar
cdcaa58929 updated for version 7.2-226 2009-07-09 18:06:49 +00:00
Bram Moolenaar
13df0fea4b updated for version 7.2-225 2009-07-09 16:24:19 +00:00
Bram Moolenaar
031e0dd663 updated for version 7.2-224 2009-07-09 16:15:16 +00:00
Bram Moolenaar
8e258a4a94 updated for version 7.2-223 2009-07-09 13:55:43 +00:00
Bram Moolenaar
8d5946760b updated for version 7.2-222 2009-07-01 18:18:57 +00:00
Bram Moolenaar
bbc936bebe updated for version 7.2-221 2009-07-01 16:04:58 +00:00
Bram Moolenaar
2bc76e617b updated for version 7.2-220 2009-07-01 15:13:56 +00:00
Bram Moolenaar
a0b1997e13 updated for version 7.2-219 2009-07-01 14:13:18 +00:00
Bram Moolenaar
a48b1659b3 updated for version 7.2-218 2009-06-24 16:32:08 +00:00
Bram Moolenaar
0c77b7ba51 updated for version 7.2-217 2009-06-24 16:08:18 +00:00
35 changed files with 381 additions and 155 deletions

View File

@@ -441,13 +441,20 @@ between files with almost the same name. If there are multiple matches,
those files with an extension that is in the 'suffixes' option are ignored.
The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
It is impossible to ignore suffixes with two dots. Examples:
An empty entry, two consecutive commas, match a file name that does not
contain a ".", thus has no suffix. This is useful to ignore "prog" and prefer
"prog.c".
Examples:
pattern: files: match: ~
test* test.c test.h test.o test.c
test* test.h test.o test.h and test.o
test* test.i test.h test.c test.i and test.c
It is impossible to ignore suffixes with two dots.
If there is more than one matching file (after ignoring the ones matching
the 'suffixes' option) the first file name is inserted. You can see that
there is only one match when you type 'wildchar' twice and the completed

View File

@@ -355,13 +355,8 @@ cscope version for Win32 see:
The DJGPP-built version from http://cscope.sourceforge.net is known to not
work with Vim.
There are a couple of hard-coded limitations:
1. The maximum number of cscope connections allowed is 8. Do you
really need more?
2. Doing a |:tjump| when |:cstag| searches the tag files is not
configurable (e.g., you can't do a tselect instead).
Hard-coded limitation: doing a |:tjump| when |:cstag| searches the tag files
is not configurable (e.g., you can't do a tselect instead).
==============================================================================
6. Suggested usage *cscope-suggestions*

View File

@@ -508,6 +508,17 @@ N *+X11* Unix only: can restore window title |X11|
messages though. Use ":silent" in the command itself
to avoid that: ":silent menu .... :silent command".
*:uns* *:unsilent*
:uns[ilent] {command} Execute {command} not silently. Only makes a
difference when |:silent| was used to get to this
command.
Use this for giving a message even when |:silent| was
used. In this example |:silent| is used to avoid the
message about reading the file and |:unsilent| to be
able to list the first line of each file. >
:silent argdo unsilent echo expand('%') . ": " . getline(1)
<
*:verb* *:verbose*
:[count]verb[ose] {command}
Execute {command} with 'verbose' set to [count]. If

5
src/auto/configure vendored
View File

@@ -5780,7 +5780,10 @@ $as_echo "$rubyhdrdir" >&6; }
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
fi
RUBY_SRC="if_ruby.c"
RUBY_OBJ="objects/if_ruby.o"

View File

@@ -984,7 +984,13 @@ if test "$enable_rubyinterp" = "yes"; then
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
dnl be included if requested by passing --with-mac-arch to
dnl configure, so strip these flags first (if present)
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//'`
if test "X$rubyldflags" != "X"; then
LDFLAGS="$rubyldflags $LDFLAGS"
fi
fi
RUBY_SRC="if_ruby.c"
RUBY_OBJ="objects/if_ruby.o"

View File

@@ -114,6 +114,10 @@ static int compl_restarting = FALSE; /* don't insert match */
* FALSE the word to be completed must be located. */
static int compl_started = FALSE;
/* Set when doing something for completion that may call edit() recursively,
* which is not allowed. */
static int compl_busy = FALSE;
static int compl_matches = 0;
static char_u *compl_pattern = NULL;
static int compl_direction = FORWARD;
@@ -346,7 +350,7 @@ edit(cmdchar, startln, count)
#ifdef FEAT_INS_EXPAND
/* Don't allow recursive insert mode when busy with completion. */
if (compl_started || pum_visible())
if (compl_started || compl_busy || pum_visible())
{
EMSG(_(e_secure));
return FALSE;
@@ -1340,8 +1344,10 @@ doESCkey:
goto normalchar;
docomplete:
compl_busy = TRUE;
if (ins_complete(c) == FAIL)
compl_cont_status = 0;
compl_busy = FALSE;
break;
#endif /* FEAT_INS_EXPAND */
@@ -3172,6 +3178,7 @@ ins_compl_free()
vim_free(match);
} while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
compl_first_match = compl_curr_match = NULL;
compl_shown_match = NULL;
}
static void

View File

@@ -4013,6 +4013,9 @@ ex_change(eap)
break;
ml_delete(eap->line1, FALSE);
}
/* make sure the cursor is not beyond the end of the file now */
check_cursor_lnum();
deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum));
/* ":append" on the line above the deleted lines. */

View File

@@ -991,6 +991,8 @@ EX(CMD_unmap, "unmap", ex_unmap,
BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_unmenu, "unmenu", ex_menu,
BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_unsilent, "unsilent", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
EX(CMD_update, "update", ex_update,
RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
EX(CMD_vglobal, "vglobal", ex_global,

View File

@@ -1677,8 +1677,8 @@ do_one_cmd(cmdlinep, sourcing,
char_u *errormsg = NULL; /* error message */
exarg_T ea; /* Ex command arguments */
long verbose_save = -1;
int save_msg_scroll = 0;
int did_silent = 0;
int save_msg_scroll = msg_scroll;
int save_msg_silent = -1;
int did_esilent = 0;
#ifdef HAVE_SANDBOX
int did_sandbox = FALSE;
@@ -1856,9 +1856,9 @@ do_one_cmd(cmdlinep, sourcing,
}
if (!checkforcmd(&ea.cmd, "silent", 3))
break;
++did_silent;
if (save_msg_silent == -1)
save_msg_silent = msg_silent;
++msg_silent;
save_msg_scroll = msg_scroll;
if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1]))
{
/* ":silent!", but not "silent !cmd" */
@@ -1886,6 +1886,13 @@ do_one_cmd(cmdlinep, sourcing,
#endif
continue;
case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3))
break;
if (save_msg_silent == -1)
save_msg_silent = msg_silent;
msg_silent = 0;
continue;
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
{
#ifdef FEAT_VERTSPLIT
@@ -2684,13 +2691,12 @@ doend:
cmdmod = save_cmdmod;
if (did_silent > 0)
if (save_msg_silent != -1)
{
/* messages could be enabled for a serious error, need to check if the
* counters don't become negative */
msg_silent -= did_silent;
if (msg_silent < 0)
msg_silent = 0;
if (!did_emsg)
msg_silent = save_msg_silent;
emsg_silent -= did_esilent;
if (emsg_silent < 0)
emsg_silent = 0;
@@ -2987,6 +2993,7 @@ static struct cmdmod
{"silent", 3, FALSE},
{"tab", 3, TRUE},
{"topleft", 2, FALSE},
{"unsilent", 3, FALSE},
{"verbose", 4, TRUE},
{"vertical", 4, FALSE},
};
@@ -7838,10 +7845,10 @@ ex_read(eap)
if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK)
{
ml_delete(lnum, FALSE);
deleted_lines_mark(lnum, 1L);
if (curwin->w_cursor.lnum > 1
&& curwin->w_cursor.lnum >= lnum)
--curwin->w_cursor.lnum;
deleted_lines_mark(lnum, 1L);
}
}
redraw_curbuf_later(VALID);
@@ -7957,7 +7964,7 @@ ex_cd(eap)
shorten_fnames(TRUE);
/* Echo the new current directory if the command was typed. */
if (KeyTyped)
if (KeyTyped || p_verbose >= 5)
ex_pwd(eap);
}
vim_free(tofree);
@@ -8686,6 +8693,8 @@ ex_mkrc(eap)
}
#ifdef FEAT_SESSION
/* Use the short file name until ":lcd" is used. We also don't use the
* short file name when 'acd' is set, that is checked later. */
did_lcd = FALSE;
/* ":mkview" or ":mkview 9": generate file name with 'viewdir' */
@@ -10573,6 +10582,9 @@ ses_fname(fd, buf, flagp)
if (buf->b_sfname != NULL
&& flagp == &ssop_flags
&& (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR))
#ifdef FEAT_AUTOCHDIR
&& !p_acd
#endif
&& !did_lcd)
name = buf->b_sfname;
else

View File

@@ -8441,13 +8441,16 @@ aucmd_prepbuf(aco, buf)
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
#ifdef FEAT_WINDOWS
/* Split the current window, put the aucmd_win in the upper half. */
/* Split the current window, put the aucmd_win in the upper half.
* We don't want the BufEnter or WinEnter autocommands. */
block_autocmds();
make_snapshot(SNAP_AUCMD_IDX);
save_ea = p_ea;
p_ea = FALSE;
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
(void)win_comp_pos(); /* recompute window positions */
p_ea = save_ea;
unblock_autocmds();
#endif
curwin = aucmd_win;
}
@@ -8474,7 +8477,8 @@ aucmd_restbuf(aco)
--curbuf->b_nwindows;
#ifdef FEAT_WINDOWS
/* Find "aucmd_win", it can't be closed, but it may be in another tab
* page. */
* page. Do not trigger autocommands here. */
block_autocmds();
if (curwin != aucmd_win)
{
tabpage_T *tp;
@@ -8498,6 +8502,7 @@ aucmd_restbuf(aco)
last_status(FALSE); /* may need to remove last status line */
restore_snapshot(SNAP_AUCMD_IDX, FALSE);
(void)win_comp_pos(); /* recompute window positions */
unblock_autocmds();
if (win_valid(aco->save_curwin))
curwin = aco->save_curwin;

View File

@@ -1309,6 +1309,9 @@ save_typebuf()
return OK;
}
static int old_char = -1; /* character put back by vungetc() */
static int old_mod_mask; /* mod_mask for ungotten character */
#if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
/*
@@ -1323,6 +1326,10 @@ save_typeahead(tp)
if (!tp->typebuf_valid)
typebuf = tp->save_typebuf;
tp->old_char = old_char;
tp->old_mod_mask = old_mod_mask;
old_char = -1;
tp->save_stuffbuff = stuffbuff;
stuffbuff.bh_first.b_next = NULL;
# ifdef USE_INPUT_BUF
@@ -1344,6 +1351,9 @@ restore_typeahead(tp)
typebuf = tp->save_typebuf;
}
old_char = tp->old_char;
old_mod_mask = tp->old_mod_mask;
free_buff(&stuffbuff);
stuffbuff = tp->save_stuffbuff;
# ifdef USE_INPUT_BUF
@@ -1499,9 +1509,6 @@ updatescript(c)
#define KL_PART_KEY -1 /* keylen value for incomplete key-code */
#define KL_PART_MAP -2 /* keylen value for incomplete mapping */
static int old_char = -1; /* character put back by vungetc() */
static int old_mod_mask; /* mod_mask for ungotten character */
/*
* Get the next input character.
* Can return a special key or a multi-byte character.
@@ -3701,11 +3708,10 @@ get_map_mode(cmdp, forceit)
* Clear all mappings or abbreviations.
* 'abbr' should be FALSE for mappings, TRUE for abbreviations.
*/
/*ARGSUSED*/
void
map_clear(cmdp, arg, forceit, abbr)
char_u *cmdp;
char_u *arg;
char_u *arg UNUSED;
int forceit;
int abbr;
{
@@ -3734,13 +3740,12 @@ map_clear(cmdp, arg, forceit, abbr)
/*
* Clear all mappings in "mode".
*/
/*ARGSUSED*/
void
map_clear_int(buf, mode, local, abbr)
buf_T *buf; /* buffer for local mappings */
int mode; /* mode in which to delete */
int local; /* TRUE for buffer-local mappings */
int abbr; /* TRUE for abbreviations */
buf_T *buf UNUSED; /* buffer for local mappings */
int mode; /* mode in which to delete */
int local UNUSED; /* TRUE for buffer-local mappings */
int abbr; /* TRUE for abbreviations */
{
mapblock_T *mp, **mpp;
int hash;

View File

@@ -959,7 +959,7 @@ gui_update_cursor(force, clear_selection)
guicolor_T fg, bg;
if (
# ifdef HAVE_GTK2
# if defined(HAVE_GTK2) && !defined(FEAT_HANGULIN)
preedit_get_status()
# else
im_get_status()

View File

@@ -6717,8 +6717,6 @@ clip_mch_request_selection(VimClipboard *cbd)
{
GdkAtom target;
unsigned i;
int nbytes;
char_u *buffer;
time_t start;
for (i = 0; i < N_SELECTION_TARGETS; ++i)
@@ -6746,22 +6744,7 @@ clip_mch_request_selection(VimClipboard *cbd)
}
/* Final fallback position - use the X CUT_BUFFER0 store */
nbytes = 0;
buffer = (char_u *)XFetchBuffer(GDK_WINDOW_XDISPLAY(gui.mainwin->window),
&nbytes, 0);
if (nbytes > 0)
{
/* Got something */
clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
if (p_verbose > 0)
{
verbose_enter();
smsg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
verbose_leave();
}
}
if (buffer != NULL)
XFree(buffer);
yank_cut_buffer0(GDK_WINDOW_XDISPLAY(gui.mainwin->window), cbd);
}
/*

View File

@@ -838,7 +838,12 @@ gui_ph_handle_window_open(
static void
gui_ph_draw_start( void )
{
PhGC_t *gc;
gc = PgGetGC();
PgSetRegion( PtWidgetRid( PtFindDisjoint( gui.vimTextArea ) ) );
PgClearClippingsCx( gc );
PgClearTranslationCx( gc );
PtWidgetOffset( gui.vimTextArea, &gui_ph_raw_offset );
PhTranslatePoint( &gui_ph_raw_offset, PtWidgetPos( gui.vimTextArea, NULL ) );
@@ -2970,7 +2975,7 @@ gui_mch_init_font(char_u *vim_font_name, int fontset)
if( vim_font_name == NULL )
{
/* Default font */
vim_font_name = "PC Term";
vim_font_name = "PC Terminal";
}
if( STRCMP( vim_font_name, "*" ) == 0 )

View File

@@ -46,7 +46,6 @@ static void cs_fill_results __ARGS((char *, int , int *, char ***,
static int cs_find __ARGS((exarg_T *eap));
static int cs_find_common __ARGS((char *opt, char *pat, int, int, int));
static int cs_help __ARGS((exarg_T *eap));
static void cs_init __ARGS((void));
static void clear_csinfo __ARGS((int i));
static int cs_insert_filelist __ARGS((char *, char *, char *,
struct stat *));
@@ -66,7 +65,10 @@ static char * cs_resolve_file __ARGS((int, char *));
static int cs_show __ARGS((exarg_T *eap));
static csinfo_T csinfo[CSCOPE_MAX_CONNECTIONS];
static csinfo_T * csinfo = NULL;
static int csinfo_size = 0; /* number of items allocated in
csinfo[] */
static int eap_arg_len; /* length of eap->arg, set in
cs_lookup_cmd() */
static cscmd_T cs_cmds[] =
@@ -144,23 +146,20 @@ get_cscope_name(xp, idx)
}
case EXP_CSCOPE_KILL:
{
static char_u connection[2];
static char connection[5];
/* ":cscope kill" accepts connection numbers or partial names of
* the pathname of the cscope database as argument. Only complete
* with connection numbers. -1 can also be used to kill all
* connections. */
for (i = 0, current_idx = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0, current_idx = 0; i < csinfo_size; i++)
{
if (csinfo[i].fname == NULL)
continue;
if (current_idx++ == idx)
{
/* Connection number fits in one character since
* CSCOPE_MAX_CONNECTIONS is < 10 */
connection[0] = i + '0';
connection[1] = NUL;
return connection;
vim_snprintf(connection, sizeof(connection), "%d", i);
return (char_u *)connection;
}
}
return (current_idx == idx && idx > 0) ? (char_u *)"-1" : NULL;
@@ -223,7 +222,6 @@ do_cscope_general(eap, make_split)
{
cscmd_T *cmdp;
cs_init();
if ((cmdp = cs_lookup_cmd(eap)) == NULL)
{
cs_help(eap);
@@ -284,8 +282,6 @@ do_cstag(eap)
{
int ret = FALSE;
cs_init();
if (*eap->arg == NUL)
{
(void)EMSG(_("E562: Usage: cstag <ident>"));
@@ -441,7 +437,7 @@ cs_connection(num, dbpath, ppath)
if (num < 0 || num > 4 || (num > 0 && !dbpath))
return FALSE;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (!csinfo[i].fname)
continue;
@@ -684,7 +680,7 @@ cs_cnt_connections()
short i;
short cnt = 0;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (csinfo[i].fname != NULL)
cnt++;
@@ -1112,7 +1108,8 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
{
int i;
char *cmd;
int nummatches[CSCOPE_MAX_CONNECTIONS], totmatches;
int *nummatches;
int totmatches;
#ifdef FEAT_QUICKFIX
char cmdletter;
char *qfpos;
@@ -1123,13 +1120,17 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
if (cmd == NULL)
return FALSE;
nummatches = (int *)alloc(sizeof(int)*csinfo_size);
if (nummatches == NULL)
return FALSE;
/* send query to all open connections, then count the total number
* of matches so we can alloc matchesp all in one swell foop
*/
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
nummatches[i] = 0;
totmatches = 0;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL)
continue;
@@ -1154,7 +1155,10 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
char *buf;
if (!verbose)
{
vim_free(nummatches);
return FALSE;
}
buf = (char *)alloc((unsigned)(strlen(opt) + strlen(pat) + strlen(nf)));
if (buf == NULL)
@@ -1165,6 +1169,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
(void)EMSG(buf);
vim_free(buf);
}
vim_free(nummatches);
return FALSE;
}
@@ -1217,6 +1222,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
(void)EMSG(buf);
vim_free(buf);
}
vim_free(nummatches);
return FALSE;
}
}
@@ -1264,6 +1270,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
}
mch_remove(tmp);
vim_free(tmp);
vim_free(nummatches);
return TRUE;
}
else
@@ -1275,6 +1282,7 @@ cs_find_common(opt, pat, forceit, verbose, use_ll)
/* read output */
cs_fill_results((char *)pat, totmatches, nummatches, &matches,
&contexts, &matched);
vim_free(nummatches);
if (matches == NULL)
return FALSE;
@@ -1328,26 +1336,6 @@ cs_help(eap)
} /* cs_help */
/*
* PRIVATE: cs_init
*
* initialize cscope structure if not already
*/
static void
cs_init()
{
short i;
static int init_already = FALSE;
if (init_already)
return;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
clear_csinfo(i);
init_already = TRUE;
} /* cs_init */
static void
clear_csinfo(i)
int i;
@@ -1444,7 +1432,7 @@ cs_insert_filelist(fname, ppath, flags, sb)
#endif
i = -1; /* can be set to the index of an empty item in csinfo */
for (j = 0; j < CSCOPE_MAX_CONNECTIONS; j++)
for (j = 0; j < csinfo_size; j++)
{
if (csinfo[j].fname != NULL
#if defined(UNIX)
@@ -1471,9 +1459,25 @@ cs_insert_filelist(fname, ppath, flags, sb)
if (i == -1)
{
if (p_csverbose)
(void)EMSG(_("E569: maximum number of cscope connections reached"));
return -1;
i = csinfo_size;
if (csinfo_size == 0)
{
/* First time allocation: allocate only 1 connection. It should
* be enough for most users. If more is needed, csinfo will be
* reallocated. */
csinfo_size = 1;
csinfo = (csinfo_T *)alloc_clear(sizeof(csinfo_T));
}
else
{
/* Reallocate space for more connections. */
csinfo_size *= 2;
csinfo = vim_realloc(csinfo, sizeof(csinfo_T)*csinfo_size);
}
if (csinfo == NULL)
return -1;
for (j = csinfo_size/2; j < csinfo_size; j++)
clear_csinfo(j);
}
if ((csinfo[i].fname = (char *)alloc((unsigned)strlen(fname)+1)) == NULL)
@@ -1580,15 +1584,14 @@ cs_kill(eap)
/* It must be part of a name. We will try to find a match
* within all the names in the csinfo data structure
*/
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok))
break;
}
}
if ((i >= CSCOPE_MAX_CONNECTIONS || i < -1 || csinfo[i].fname == NULL)
&& i != -1)
if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL))
{
if (p_csverbose)
(void)EMSG2(_("E261: cscope connection %s not found"), stok);
@@ -1597,7 +1600,7 @@ cs_kill(eap)
{
if (i == -1)
{
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (csinfo[i].fname)
cs_kill_execute(i, csinfo[i].fname);
@@ -1857,7 +1860,7 @@ cs_file_results(f, nummatches_a)
if (buf == NULL)
return;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (nummatches_a[i] < 1)
continue;
@@ -1929,7 +1932,7 @@ cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched)
if ((cntxts = (char **)alloc(sizeof(char *) * totmatches)) == NULL)
goto parse_out;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (nummatches_a[i] < 1)
continue;
@@ -2383,10 +2386,13 @@ cs_reset(eap)
int i;
char buf[20]; /* for sprintf " (#%d)" */
if (csinfo_size == 0)
return CSCOPE_SUCCESS;
/* malloc our db and ppath list */
dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
pplist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
fllist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *));
dblist = (char **)alloc(csinfo_size * sizeof(char *));
pplist = (char **)alloc(csinfo_size * sizeof(char *));
fllist = (char **)alloc(csinfo_size * sizeof(char *));
if (dblist == NULL || pplist == NULL || fllist == NULL)
{
vim_free(dblist);
@@ -2395,7 +2401,7 @@ cs_reset(eap)
return CSCOPE_FAILURE;
}
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
dblist[i] = csinfo[i].fname;
pplist[i] = csinfo[i].ppath;
@@ -2405,7 +2411,7 @@ cs_reset(eap)
}
/* rebuild the cscope connection list */
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (dblist[i] != NULL)
{
@@ -2502,7 +2508,7 @@ cs_show(eap)
MSG_PUTS_ATTR(
_(" # pid database name prepend path\n"),
hl_attr(HLF_T));
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
{
if (csinfo[i].fname == NULL)
continue;
@@ -2531,8 +2537,10 @@ cs_end()
{
int i;
for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
for (i = 0; i < csinfo_size; i++)
cs_release_csp(i, TRUE);
vim_free(csinfo);
csinfo_size = 0;
}
#endif /* FEAT_CSCOPE */

View File

@@ -25,7 +25,6 @@
#define CSCOPE_SUCCESS 0
#define CSCOPE_FAILURE -1
#define CSCOPE_MAX_CONNECTIONS 8 /* you actually need more? */
#define CSCOPE_DBFILE "cscope.out"
#define CSCOPE_PROMPT ">> "

View File

@@ -2169,9 +2169,9 @@ set_buffer_line(void *data, int argc, Scheme_Object **argv)
curbuf = savebuf;
raise_vim_exn(_("cannot delete line"));
}
deleted_lines_mark((linenr_T)n, 1L);
if (buf->buf == curwin->w_buffer)
mz_fix_cursor(n, n + 1, -1);
deleted_lines_mark((linenr_T)n, 1L);
curbuf = savebuf;
@@ -2299,9 +2299,9 @@ set_buffer_line_list(void *data, int argc, Scheme_Object **argv)
curbuf = savebuf;
raise_vim_exn(_("cannot delete line"));
}
deleted_lines_mark((linenr_T)lo, (long)old_len);
if (buf->buf == curwin->w_buffer)
mz_fix_cursor(lo, hi, -old_len);
deleted_lines_mark((linenr_T)lo, (long)old_len);
}
curbuf = savebuf;

View File

@@ -720,9 +720,11 @@ ex_perl(eap)
#ifdef HAVE_SANDBOX
if (sandbox)
{
# ifndef MAKE_TEST /* avoid a warning for unreachable code */
if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe))
EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
else
# endif
{
PUSHMARK(SP);
XPUSHs(safe);
@@ -1233,9 +1235,8 @@ Delete(vimbuf, ...)
if (u_savedel(lnum, 1) == OK)
{
ml_delete(lnum, 0);
check_cursor();
deleted_lines_mark(lnum, 1L);
if (aco.save_curbuf == curbuf)
check_cursor();
}
/* restore curwin/curbuf and a few other things */

View File

@@ -2497,9 +2497,9 @@ SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
PyErr_SetVim(_("cannot delete line"));
else
{
deleted_lines_mark((linenr_T)n, 1L);
if (buf == curwin->w_buffer)
py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1);
deleted_lines_mark((linenr_T)n, 1L);
}
curbuf = savebuf;
@@ -2596,10 +2596,9 @@ SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_cha
break;
}
}
deleted_lines_mark((linenr_T)lo, (long)i);
if (buf == curwin->w_buffer)
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
deleted_lines_mark((linenr_T)lo, (long)i);
}
curbuf = savebuf;

View File

@@ -107,7 +107,7 @@ msg(s)
}
#if defined(FEAT_EVAL) || defined(FEAT_X11) || defined(USE_XSMP) \
|| defined(PROTO)
|| defined(FEAT_GUI_GTK) || defined(PROTO)
/*
* Like msg() but keep it silent when 'verbosefile' is set.
*/

View File

@@ -2345,12 +2345,13 @@ del_lines(nlines, undo)
int undo; /* if TRUE, prepare for undo */
{
long n;
linenr_T first = curwin->w_cursor.lnum;
if (nlines <= 0)
return;
/* save the deleted lines for undo */
if (undo && u_savedel(curwin->w_cursor.lnum, nlines) == FAIL)
if (undo && u_savedel(first, nlines) == FAIL)
return;
for (n = 0; n < nlines; )
@@ -2358,18 +2359,21 @@ del_lines(nlines, undo)
if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to delete */
break;
ml_delete(curwin->w_cursor.lnum, TRUE);
ml_delete(first, TRUE);
++n;
/* If we delete the last line in the file, stop */
if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
if (first > curbuf->b_ml.ml_line_count)
break;
}
/* adjust marks, mark the buffer as changed and prepare for displaying */
deleted_lines_mark(curwin->w_cursor.lnum, n);
/* Correct the cursor position before calling deleted_lines_mark(), it may
* trigger a callback to display the cursor. */
curwin->w_cursor.col = 0;
check_cursor_lnum();
/* adjust marks, mark the buffer as changed and prepare for displaying */
deleted_lines_mark(first, n);
}
int
@@ -2621,6 +2625,8 @@ deleted_lines(lnum, count)
/*
* Like deleted_lines(), but adjust marks first.
* Make sure the cursor is on a valid line before calling, a GUI callback may
* be triggered to display the cursor.
*/
void
deleted_lines_mark(lnum, count)
@@ -3270,6 +3276,7 @@ prompt_for_number(mouse_used)
cmdline_row = msg_row - 1;
need_wait_return = FALSE;
msg_didany = FALSE;
msg_didout = FALSE;
}
else
cmdline_row = save_cmdline_row;
@@ -8527,11 +8534,25 @@ match_suffix(fname)
for (setsuf = p_su; *setsuf; )
{
setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,");
if (fnamelen >= setsuflen
&& fnamencmp(suf_buf, fname + fnamelen - setsuflen,
(size_t)setsuflen) == 0)
break;
setsuflen = 0;
if (setsuflen == 0)
{
char_u *tail = gettail(fname);
/* empty entry: match name without a '.' */
if (vim_strchr(tail, '.') == NULL)
{
setsuflen = 1;
break;
}
}
else
{
if (fnamelen >= setsuflen
&& fnamencmp(suf_buf, fname + fnamelen - setsuflen,
(size_t)setsuflen) == 0)
break;
setsuflen = 0;
}
}
return (setsuflen != 0);
}

View File

@@ -5591,6 +5591,29 @@ x11_export_final_selection()
if (dpy != NULL && str != NULL && motion_type >= 0
&& len < 1024*1024 && len > 0)
{
#ifdef FEAT_MBYTE
/* The CUT_BUFFER0 is supposed to always contain latin1. Convert from
* 'enc' when it is a multi-byte encoding. When 'enc' is an 8-bit
* encoding conversion usually doesn't work, so keep the text as-is.
*/
if (has_mbyte)
{
char_u *conv_str = str;
vimconv_T vc;
vc.vc_type = CONV_NONE;
if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
{
conv_str = string_convert(&vc, str, (int*)&len);
if (conv_str != NULL)
{
vim_free(str);
str = conv_str;
}
convert_setup(&vc, NULL, NULL);
}
}
#endif
XStoreBuffer(dpy, (char *)str, (int)len, 0);
XFlush(dpy);
}

View File

@@ -291,7 +291,6 @@
# define HAVE_SETENV
# define HAVE_RENAME
# endif
# define mch_chdir(s) chdir(s)
#endif
#if defined(MACOS_X) && !defined(HAVE_CONFIG_H)

View File

@@ -2039,6 +2039,12 @@ mch_chdir(char *path)
{
if (path[0] == NUL) /* just checking... */
return 0;
if (p_verbose >= 5)
{
verbose_enter();
smsg((char_u *)"chdir(%s)", path);
verbose_leave();
}
if (path[1] == ':') /* has a drive name */
{
if (change_drive(TOLOWER_ASC(path[0]) - 'a' + 1))

View File

@@ -653,6 +653,12 @@ mch_chdir(char *path)
if (path[0] == NUL) /* just checking... */
return -1;
if (p_verbose >= 5)
{
verbose_enter();
smsg((char_u *)"chdir(%s)", path);
verbose_leave();
}
if (isalpha(path[0]) && path[1] == ':') /* has a drive name */
{
/* If we can change to the drive, skip that part of the path. If we

View File

@@ -1203,6 +1203,12 @@ mch_chdir(dir)
int retval;
char_u *new_dir;
if (p_verbose >= 5)
{
verbose_enter();
smsg((char_u *)"chdir(%s)", dir);
verbose_leave();
}
length = strlen(dir);
if (dir[length - 1] != '.')
return chdir(dir); /* No trailing dots - nothing to do. */

View File

@@ -319,6 +319,23 @@ static struct signalinfo
{-1, "Unknown!", FALSE}
};
int
mch_chdir(path)
char *path;
{
if (p_verbose >= 5)
{
verbose_enter();
smsg((char_u *)"chdir(%s)", path);
verbose_leave();
}
# ifdef VMS
return chdir(vms_fixfilename(path));
# else
return chdir(path);
# endif
}
/*
* Write s[len] to the screen.
*/
@@ -1138,10 +1155,10 @@ mch_suspend()
* to happen).
*/
{
long wait;
for (wait = 0; !sigcont_received && wait <= 3L; wait++)
long wait_time;
for (wait_time = 0; !sigcont_received && wait_time <= 3L; wait_time++)
/* Loop is not entered most of the time */
mch_delay(wait, FALSE);
mch_delay(wait_time, FALSE);
}
# endif
@@ -1717,9 +1734,9 @@ get_x11_icon(test_only)
if (oldicon == NULL && !test_only)
{
if (STRNCMP(T_NAME, "builtin_", 8) == 0)
oldicon = T_NAME + 8;
oldicon = vim_strsave(T_NAME + 8);
else
oldicon = T_NAME;
oldicon = vim_strsave(T_NAME);
}
return retval;
@@ -1922,9 +1939,9 @@ get_x11_icon(test_only)
if (!test_only)
{
if (STRNCMP(T_NAME, "builtin_", 8) == 0)
oldicon = T_NAME + 8;
oldicon = vim_strsave(T_NAME + 8);
else
oldicon = T_NAME;
oldicon = vim_strsave(T_NAME);
}
return FALSE;
}
@@ -2424,6 +2441,12 @@ mch_FullName(fname, buf, len, force)
#ifdef HAVE_FCHDIR
if (fd >= 0)
{
if (p_verbose >= 5)
{
verbose_enter();
MSG("fchdir() to previous dir");
verbose_leave();
}
l = fchdir(fd);
close(fd);
}

View File

@@ -482,11 +482,6 @@ typedef struct dsc$descriptor DESC;
# else
int mch_rename __ARGS((const char *src, const char *dest));
# endif
# ifdef VMS
# define mch_chdir(s) chdir(vms_fixfilename(s))
# else
# define mch_chdir(s) chdir(s)
# endif
# ifndef VMS
# ifdef __MVS__
/* on OS390 Unix getenv() doesn't return a pointer to persistent

View File

@@ -1,4 +1,5 @@
/* os_unix.c */
int mch_chdir __ARGS((char *path));
void mch_write __ARGS((char_u *s, int len));
int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt));
int mch_char_avail __ARGS((void));

View File

@@ -48,6 +48,7 @@ int check_row __ARGS((int row));
void open_app_context __ARGS((void));
void x11_setup_atoms __ARGS((Display *dpy));
void clip_x11_request_selection __ARGS((Widget myShell, Display *dpy, VimClipboard *cbd));
void yank_cut_buffer0 __ARGS((Display *dpy, VimClipboard *cbd));
void clip_x11_lose_selection __ARGS((Widget myShell, VimClipboard *cbd));
int clip_x11_own_selection __ARGS((Widget myShell, VimClipboard *cbd));
void clip_x11_set_selection __ARGS((VimClipboard *cbd));

View File

@@ -10252,6 +10252,7 @@ spell_suggest(count)
int limit;
int selected = count;
int badlen = 0;
int msg_scroll_save = msg_scroll;
if (no_spell_checking(curwin))
return;
@@ -10416,7 +10417,9 @@ spell_suggest(count)
selected = prompt_for_number(&mouse_used);
if (mouse_used)
selected -= lines_left;
lines_left = Rows; /* avoid more prompt */
lines_left = Rows; /* avoid more prompt */
/* don't delay for 'smd' in normal_cmd() */
msg_scroll = msg_scroll_save;
}
if (selected > 0 && selected <= sug.su_ga.ga_len && u_save_cursor() == OK)
@@ -10441,7 +10444,8 @@ spell_suggest(count)
}
/* Replace the word. */
p = alloc((unsigned)STRLEN(line) - stp->st_orglen + stp->st_wordlen + 1);
p = alloc((unsigned)STRLEN(line) - stp->st_orglen
+ stp->st_wordlen + 1);
if (p != NULL)
{
c = (int)(sug.su_badptr - line);

View File

@@ -882,6 +882,8 @@ typedef struct
{
typebuf_T save_typebuf;
int typebuf_valid; /* TRUE when save_typebuf valid */
int old_char;
int old_mod_mask;
struct buffheader save_stuffbuff;
#ifdef USE_INPUT_BUF
char_u *save_inputbuf;

View File

@@ -4,9 +4,11 @@
VIMPROG = ../vim
# Uncomment this line for using valgrind.
# The output goes into a file "valgrind.$PID" (sorry, no test number).
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --logfile=valgrind
# Uncomment this line to use valgrind for memory leaks and extra warnings.
# The output goes into a file "valgrind.testN"
# Vim should be compiled with EXITFREE to avoid false warnings.
# This will make testing about 10 times as slow.
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$*
SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test7.out test8.out test9.out test10.out test11.out \

View File

@@ -2104,8 +2104,6 @@ clip_x11_request_selection(myShell, dpy, cbd)
Atom type;
static int success;
int i;
int nbytes = 0;
char_u *buffer;
time_t start_time;
int timed_out = FALSE;
@@ -2185,15 +2183,7 @@ clip_x11_request_selection(myShell, dpy, cbd)
}
/* Final fallback position - use the X CUT_BUFFER0 store */
buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
if (nbytes > 0)
{
/* Got something */
clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
XFree((void *)buffer);
if (p_verbose > 0)
verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
}
yank_cut_buffer0(dpy, cbd);
}
static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *));
@@ -2369,6 +2359,60 @@ clip_x11_set_selection(cbd)
}
#endif
#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \
|| defined(FEAT_GUI_GTK) || defined(PROTO)
/*
* Get the contents of the X CUT_BUFFER0 and put it in "cbd".
*/
void
yank_cut_buffer0(dpy, cbd)
Display *dpy;
VimClipboard *cbd;
{
int nbytes = 0;
char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0);
if (nbytes > 0)
{
#ifdef FEAT_MBYTE
int done = FALSE;
/* CUT_BUFFER0 is supposed to be always latin1. Convert to 'enc' when
* using a multi-byte encoding. Conversion between two 8-bit
* character sets usually fails and the text might actually be in
* 'enc' anyway. */
if (has_mbyte)
{
char_u *conv_buf = buffer;
vimconv_T vc;
vc.vc_type = CONV_NONE;
if (convert_setup(&vc, (char_u *)"latin1", p_enc) == OK)
{
conv_buf = string_convert(&vc, buffer, &nbytes);
if (conv_buf != NULL)
{
clip_yank_selection(MCHAR, conv_buf, (long)nbytes, cbd);
vim_free(conv_buf);
done = TRUE;
}
convert_setup(&vc, NULL, NULL);
}
}
if (!done) /* use the text without conversion */
#endif
clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd);
XFree((void *)buffer);
if (p_verbose > 0)
{
verbose_enter();
verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection"));
verbose_leave();
}
}
}
#endif
#if defined(FEAT_MOUSE) || defined(PROTO)
/*

View File

@@ -676,6 +676,48 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
237,
/**/
236,
/**/
235,
/**/
234,
/**/
233,
/**/
232,
/**/
231,
/**/
230,
/**/
229,
/**/
228,
/**/
227,
/**/
226,
/**/
225,
/**/
224,
/**/
223,
/**/
222,
/**/
221,
/**/
220,
/**/
219,
/**/
218,
/**/
217,
/**/
216,
/**/