mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge branch 'vim'
This commit is contained in:
@@ -1793,3 +1793,17 @@ f1cde9cf023e15cd1bc26ae720d6380fa5ceac7d v7-3-452
|
||||
1632640a24b42a9193eeb8f6e8150afaeee5ee35 v7-3-454
|
||||
e6392f2aed4c13170664b4ec13dd2d8b3ce968aa v7-3-455
|
||||
07fd030f89be62aa11c4ea1a188ee2d8f4348677 v7-3-456
|
||||
4a2744311b3f3c8207189dee4ef405959a2e2446 v7-3-457
|
||||
da670fb71d30a1eefb07b19256f8c0d677807550 v7-3-458
|
||||
cb2ae92ce106de532c53f8a16a82bc2bf6edacd2 v7-3-459
|
||||
981c7ad9dd48cac1b4030b97c2f0dc0b8fe82337 v7-3-460
|
||||
de60f6fa3d8d77442a39ec13efef89f6ca76af03 v7-3-461
|
||||
70eff6af1158f9dc99118ba73e81f456015c3ebd v7-3-462
|
||||
8e0fe5a723adfb45c44978083db7aeac11e6d72b v7-3-463
|
||||
43259e4542c76e950fecc86114c43065064d1b34 v7-3-464
|
||||
d1096a4e96bdd5bfc0ce2f1aaddcbff1475c69ad v7-3-465
|
||||
df9c7798b5e2c022310cd12e199c9de8d866aa39 v7-3-466
|
||||
276d58e9265cfee76c04bc5450681090900a16f4 v7-3-467
|
||||
38a1357304234dcea96f96019abf0f3e5ae290ab v7-3-468
|
||||
e61c3b09ae86a8a448ad2d028df6fa6b9778666b v7-3-469
|
||||
636e4db6e2075bd22640cfc8229af62059f8ffe0 v7-3-470
|
||||
|
||||
@@ -711,7 +711,10 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
*QuickFixCmdPost*
|
||||
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
|
||||
command is run, before jumping to the first
|
||||
location. See |QuickFixCmdPost-example|.
|
||||
location. For |:cfile| and |:lfile| commands
|
||||
it is run after error file is read and before
|
||||
moving to the first error.
|
||||
See |QuickFixCmdPost-example|.
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|. The
|
||||
|
||||
@@ -1746,7 +1746,8 @@ exists( {expr}) Number TRUE if {expr} exists
|
||||
extend( {expr1}, {expr2} [, {expr3}])
|
||||
List/Dict insert items of {expr2} into {expr1}
|
||||
exp( {expr}) Float exponential of {expr}
|
||||
expand( {expr} [, {flag}]) String expand special keywords in {expr}
|
||||
expand( {expr} [, {nosuf} [, {list}]])
|
||||
any expand special keywords in {expr}
|
||||
feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
|
||||
filereadable( {file}) Number TRUE if {file} is a readable file
|
||||
filewritable( {file}) Number TRUE if {file} is a writable file
|
||||
@@ -1800,7 +1801,8 @@ gettabwinvar( {tabnr}, {winnr}, {name})
|
||||
getwinposx() Number X coord in pixels of GUI Vim window
|
||||
getwinposy() Number Y coord in pixels of GUI Vim window
|
||||
getwinvar( {nr}, {varname}) any variable {varname} in window {nr}
|
||||
glob( {expr} [, {flag}]) String expand file wildcards in {expr}
|
||||
glob( {expr} [, {nosuf} [, {list}]])
|
||||
any expand file wildcards in {expr}
|
||||
globpath( {path}, {expr} [, {flag}])
|
||||
String do glob({expr}) for all dirs in {path}
|
||||
has( {feature}) Number TRUE if feature {feature} supported
|
||||
@@ -2802,10 +2804,10 @@ expand({expr} [, {flag}]) *expand()*
|
||||
When {expr} does not start with '%', '#' or '<', it is
|
||||
expanded like a file name is expanded on the command line.
|
||||
'suffixes' and 'wildignore' are used, unless the optional
|
||||
{flag} argument is given and it is non-zero. Names for
|
||||
non-existing files are included. The "**" item can be used to
|
||||
search in a directory tree. For example, to find all "README"
|
||||
files in the current directory and below: >
|
||||
{nosuf} argument is given and it is non-zero.
|
||||
Names for non-existing files are included. The "**" item can
|
||||
be used to search in a directory tree. For example, to find
|
||||
all "README" files in the current directory and below: >
|
||||
:echo expand("**/README")
|
||||
<
|
||||
Expand() can also be used to expand variables and environment
|
||||
|
||||
@@ -239,6 +239,12 @@ If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
|
||||
found at
|
||||
http://www.upx.org/
|
||||
|
||||
As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
|
||||
built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
|
||||
at:
|
||||
http://www.matcode.com/mpress.htm
|
||||
|
||||
|
||||
ADDITION: NLS support with MinGW
|
||||
|
||||
(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
|
||||
|
||||
+8
-2
@@ -14,9 +14,11 @@
|
||||
# it's just run out of memory or something. Run again, and it will continue
|
||||
# with 'xxd'.
|
||||
#
|
||||
# "make upx" makes *compressed* versions of the GUI and console EXEs, using the
|
||||
# excellent UPX compressor:
|
||||
# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
|
||||
# using the excellent UPX compressor:
|
||||
# http://upx.sourceforge.net/
|
||||
# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
|
||||
# http://www.matcode.com/mpress.htm
|
||||
#
|
||||
# Maintained by Ron Aaron <ronaharon@yahoo.com>
|
||||
# updated 2003 Jan 20
|
||||
@@ -640,6 +642,10 @@ upx: exes
|
||||
upx gvim.exe
|
||||
upx vim.exe
|
||||
|
||||
mpress: exes
|
||||
mpress gvim.exe
|
||||
mpress vim.exe
|
||||
|
||||
xxd/xxd.exe: xxd/xxd.c
|
||||
$(MAKE) -C xxd -f Make_ming.mak CC=$(CC)
|
||||
|
||||
|
||||
+1
-1
@@ -329,7 +329,7 @@ close_buffer(win, buf, action, abort_if_last)
|
||||
win_T *win; /* if not NULL, set b_last_cursor */
|
||||
buf_T *buf;
|
||||
int action;
|
||||
int abort_if_last;
|
||||
int abort_if_last UNUSED;
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
int is_curbuf;
|
||||
|
||||
+75
-22
@@ -259,6 +259,9 @@ static int ins_ctrl_ey __ARGS((int tc));
|
||||
static void ins_try_si __ARGS((int c));
|
||||
#endif
|
||||
static colnr_T get_nolist_virtcol __ARGS((void));
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static char_u *do_insert_char_pre __ARGS((int c));
|
||||
#endif
|
||||
|
||||
static colnr_T Insstart_textlen; /* length of line when insert started */
|
||||
static colnr_T Insstart_blank_vcol; /* vcol for first inserted blank */
|
||||
@@ -784,7 +787,20 @@ edit(cmdchar, startln, count)
|
||||
* completion: Add to "compl_leader". */
|
||||
if (ins_compl_accept_char(c))
|
||||
{
|
||||
ins_compl_addleader(c);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Trigger InsertCharPre. */
|
||||
char_u *str = do_insert_char_pre(c);
|
||||
char_u *p;
|
||||
|
||||
if (str != NULL)
|
||||
{
|
||||
for (p = str; *p != NUL; mb_ptr_adv(p))
|
||||
ins_compl_addleader(PTR2CHAR(p));
|
||||
vim_free(str);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
ins_compl_addleader(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1403,34 +1419,31 @@ normalchar:
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!p_paste)
|
||||
{
|
||||
/* Trigger the InsertCharPre event. Lock the text to avoid
|
||||
* weird things from happening. */
|
||||
set_vim_var_char(c);
|
||||
++textlock;
|
||||
if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL,
|
||||
FALSE, curbuf))
|
||||
/* Trigger InsertCharPre. */
|
||||
char_u *str = do_insert_char_pre(c);
|
||||
char_u *p;
|
||||
|
||||
if (str != NULL)
|
||||
{
|
||||
/* Get the new value of v:char. If it is more than one
|
||||
* character insert it literally. */
|
||||
char_u *s = get_vim_var_str(VV_CHAR);
|
||||
if (MB_CHARLEN(s) > 1)
|
||||
if (*str != NUL && stop_arrow() != FAIL)
|
||||
{
|
||||
if (stop_arrow() != FAIL)
|
||||
/* Insert the new value of v:char literally. */
|
||||
for (p = str; *p != NUL; mb_ptr_adv(p))
|
||||
{
|
||||
ins_str(s);
|
||||
AppendToRedobuffLit(s, -1);
|
||||
c = PTR2CHAR(p);
|
||||
if (c == CAR || c == K_KENTER || c == NL)
|
||||
ins_eol(c);
|
||||
else
|
||||
ins_char(c);
|
||||
}
|
||||
c = NUL;
|
||||
AppendToRedobuffLit(str, -1);
|
||||
}
|
||||
else
|
||||
c = PTR2CHAR(s);
|
||||
vim_free(str);
|
||||
c = NUL;
|
||||
}
|
||||
|
||||
set_vim_var_string(VV_CHAR, NULL, -1);
|
||||
--textlock;
|
||||
|
||||
/* If the new value is an empty string then don't insert a
|
||||
* char. */
|
||||
/* If the new value is already inserted or an empty string
|
||||
* then don't insert any character. */
|
||||
if (c == NUL)
|
||||
break;
|
||||
}
|
||||
@@ -5898,6 +5911,8 @@ insertchar(c, flags, second_indent)
|
||||
* Don't do this when 'cindent' or 'indentexpr' is set, because we might
|
||||
* need to re-indent at a ':', or any other character (but not what
|
||||
* 'paste' is set)..
|
||||
* Don't do this when there an InsertCharPre autocommand is defined,
|
||||
* because we need to fire the event for every character.
|
||||
*/
|
||||
#ifdef USE_ON_FLY_SCROLL
|
||||
dont_scroll = FALSE; /* allow scrolling here */
|
||||
@@ -5914,6 +5929,9 @@ insertchar(c, flags, second_indent)
|
||||
#endif
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
&& !p_ri
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !has_insertcharpre()
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -10102,3 +10120,38 @@ get_nolist_virtcol()
|
||||
validate_virtcol();
|
||||
return curwin->w_virtcol;
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/*
|
||||
* Handle the InsertCharPre autocommand.
|
||||
* "c" is the character that was typed.
|
||||
* Return a pointer to allocated memory with the replacement string.
|
||||
* Return NULL to continue inserting "c".
|
||||
*/
|
||||
static char_u *
|
||||
do_insert_char_pre(c)
|
||||
int c;
|
||||
{
|
||||
char_u *res;
|
||||
|
||||
/* Return quickly when there is nothing to do. */
|
||||
if (!has_insertcharpre())
|
||||
return NULL;
|
||||
|
||||
/* Lock the text to avoid weird things from happening. */
|
||||
++textlock;
|
||||
set_vim_var_char(c); /* set v:char */
|
||||
|
||||
if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
|
||||
/* Get the new value of v:char. It may be empty or more than one
|
||||
* character. */
|
||||
res = vim_strsave(get_vim_var_str(VV_CHAR));
|
||||
else
|
||||
res = NULL;
|
||||
|
||||
set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
|
||||
--textlock;
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
+59
-9
@@ -7853,7 +7853,7 @@ static struct fst
|
||||
#ifdef FEAT_FLOAT
|
||||
{"exp", 1, 1, f_exp},
|
||||
#endif
|
||||
{"expand", 1, 2, f_expand},
|
||||
{"expand", 1, 3, f_expand},
|
||||
{"extend", 2, 3, f_extend},
|
||||
{"feedkeys", 1, 2, f_feedkeys},
|
||||
{"file_readable", 1, 1, f_filereadable}, /* obsolete */
|
||||
@@ -7904,7 +7904,7 @@ static struct fst
|
||||
{"getwinposx", 0, 0, f_getwinposx},
|
||||
{"getwinposy", 0, 0, f_getwinposy},
|
||||
{"getwinvar", 2, 2, f_getwinvar},
|
||||
{"glob", 1, 2, f_glob},
|
||||
{"glob", 1, 3, f_glob},
|
||||
{"globpath", 2, 3, f_globpath},
|
||||
{"has", 1, 1, f_has},
|
||||
{"has_key", 2, 2, f_has_key},
|
||||
@@ -10020,14 +10020,33 @@ f_expand(argvars, rettv)
|
||||
int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
|
||||
expand_T xpc;
|
||||
int error = FALSE;
|
||||
char_u *result;
|
||||
|
||||
rettv->v_type = VAR_STRING;
|
||||
if (argvars[1].v_type != VAR_UNKNOWN
|
||||
&& argvars[2].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[2], &error)
|
||||
&& !error)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
}
|
||||
|
||||
s = get_tv_string(&argvars[0]);
|
||||
if (*s == '%' || *s == '#' || *s == '<')
|
||||
{
|
||||
++emsg_off;
|
||||
rettv->vval.v_string = eval_vars(s, s, &len, NULL, &errormsg, NULL);
|
||||
result = eval_vars(s, s, &len, NULL, &errormsg, NULL);
|
||||
--emsg_off;
|
||||
if (rettv->v_type == VAR_LIST)
|
||||
{
|
||||
if (rettv_list_alloc(rettv) != FAIL && result != NULL)
|
||||
list_append_string(rettv->vval.v_list, result, -1);
|
||||
else
|
||||
vim_free(result);
|
||||
}
|
||||
else
|
||||
rettv->vval.v_string = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -10042,7 +10061,18 @@ f_expand(argvars, rettv)
|
||||
xpc.xp_context = EXPAND_FILES;
|
||||
if (p_wic)
|
||||
options += WILD_ICASE;
|
||||
rettv->vval.v_string = ExpandOne(&xpc, s, NULL, options, WILD_ALL);
|
||||
if (rettv->v_type == VAR_STRING)
|
||||
rettv->vval.v_string = ExpandOne(&xpc, s, NULL,
|
||||
options, WILD_ALL);
|
||||
else if (rettv_list_alloc(rettv) != FAIL)
|
||||
{
|
||||
int i;
|
||||
|
||||
ExpandOne(&xpc, s, NULL, options, WILD_ALL_KEEP);
|
||||
for (i = 0; i < xpc.xp_numfiles; i++)
|
||||
list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1);
|
||||
ExpandCleanup(&xpc);
|
||||
}
|
||||
}
|
||||
else
|
||||
rettv->vval.v_string = NULL;
|
||||
@@ -11841,19 +11871,39 @@ f_glob(argvars, rettv)
|
||||
int error = FALSE;
|
||||
|
||||
/* When the optional second argument is non-zero, don't remove matches
|
||||
* for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
||||
if (argvars[1].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[1], &error))
|
||||
options |= WILD_KEEP_ALL;
|
||||
* for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
||||
rettv->v_type = VAR_STRING;
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
{
|
||||
if (get_tv_number_chk(&argvars[1], &error))
|
||||
options |= WILD_KEEP_ALL;
|
||||
if (argvars[2].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[2], &error))
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
}
|
||||
}
|
||||
if (!error)
|
||||
{
|
||||
ExpandInit(&xpc);
|
||||
xpc.xp_context = EXPAND_FILES;
|
||||
if (p_wic)
|
||||
options += WILD_ICASE;
|
||||
rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
||||
if (rettv->v_type == VAR_STRING)
|
||||
rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
||||
NULL, options, WILD_ALL);
|
||||
else if (rettv_list_alloc(rettv) != FAIL)
|
||||
{
|
||||
int i;
|
||||
|
||||
ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
||||
NULL, options, WILD_ALL_KEEP);
|
||||
for (i = 0; i < xpc.xp_numfiles; i++)
|
||||
list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1);
|
||||
|
||||
ExpandCleanup(&xpc);
|
||||
}
|
||||
}
|
||||
else
|
||||
rettv->vval.v_string = NULL;
|
||||
|
||||
+7
-4
@@ -5151,10 +5151,13 @@ outofmem:
|
||||
|
||||
if (!global_busy)
|
||||
{
|
||||
if (endcolumn)
|
||||
coladvance((colnr_T)MAXCOL);
|
||||
else
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
if (!do_ask) /* when interactive leave cursor on the match */
|
||||
{
|
||||
if (endcolumn)
|
||||
coladvance((colnr_T)MAXCOL);
|
||||
else
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
}
|
||||
if (!do_sub_msg(do_count) && do_ask)
|
||||
MSG("");
|
||||
}
|
||||
|
||||
+3
-1
@@ -3472,6 +3472,7 @@ nextwild(xp, type, options)
|
||||
* mode = WILD_PREV: use previous match in multiple match, wrap to first
|
||||
* mode = WILD_ALL: return all matches concatenated
|
||||
* mode = WILD_LONGEST: return longest matched part
|
||||
* mode = WILD_ALL_KEEP: get all matches, keep matches
|
||||
*
|
||||
* options = WILD_LIST_NOTFOUND: list entries without a match
|
||||
* options = WILD_HOME_REPLACE: do home_replace() for buffer names
|
||||
@@ -3595,7 +3596,8 @@ ExpandOne(xp, str, orig, options, mode)
|
||||
/*
|
||||
* Check for matching suffixes in file names.
|
||||
*/
|
||||
if (mode != WILD_ALL && mode != WILD_LONGEST)
|
||||
if (mode != WILD_ALL && mode != WILD_ALL_KEEP
|
||||
&& mode != WILD_LONGEST)
|
||||
{
|
||||
if (xp->xp_numfiles)
|
||||
non_suf_match = xp->xp_numfiles;
|
||||
|
||||
@@ -9154,6 +9154,15 @@ has_cursormovedI()
|
||||
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is an InsertCharPre autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_insertcharpre()
|
||||
{
|
||||
return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
||||
event_T event;
|
||||
|
||||
+47
-11
@@ -3292,7 +3292,8 @@ foldlevelSyntax(flp)
|
||||
/* put_folds() {{{2 */
|
||||
#if defined(FEAT_SESSION) || defined(PROTO)
|
||||
static int put_folds_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
|
||||
static int put_foldopen_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
|
||||
static int put_foldopen_recurse __ARGS((FILE *fd, win_T *wp, garray_T *gap, linenr_T off));
|
||||
static int put_fold_open_close __ARGS((FILE *fd, fold_T *fp, linenr_T off));
|
||||
|
||||
/*
|
||||
* Write commands to "fd" to restore the manual folds in window "wp".
|
||||
@@ -3312,7 +3313,7 @@ put_folds(fd, wp)
|
||||
|
||||
/* If some folds are manually opened/closed, need to restore that. */
|
||||
if (wp->w_fold_manual)
|
||||
return put_foldopen_recurse(fd, &wp->w_folds, (linenr_T)0);
|
||||
return put_foldopen_recurse(fd, wp, &wp->w_folds, (linenr_T)0);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -3352,12 +3353,14 @@ put_folds_recurse(fd, gap, off)
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_foldopen_recurse(fd, gap, off)
|
||||
put_foldopen_recurse(fd, wp, gap, off)
|
||||
FILE *fd;
|
||||
win_T *wp;
|
||||
garray_T *gap;
|
||||
linenr_T off;
|
||||
{
|
||||
int i;
|
||||
int level;
|
||||
fold_T *fp;
|
||||
|
||||
fp = (fold_T *)gap->ga_data;
|
||||
@@ -3367,27 +3370,60 @@ put_foldopen_recurse(fd, gap, off)
|
||||
{
|
||||
if (fp->fd_nested.ga_len > 0)
|
||||
{
|
||||
/* open/close nested folds while this fold is open */
|
||||
/* open nested folds while this fold is open */
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|| put_line(fd, "normal zo") == FAIL)
|
||||
return FAIL;
|
||||
if (put_foldopen_recurse(fd, &fp->fd_nested, off + fp->fd_top)
|
||||
if (put_foldopen_recurse(fd, wp, &fp->fd_nested,
|
||||
off + fp->fd_top)
|
||||
== FAIL)
|
||||
return FAIL;
|
||||
/* close the parent when needed */
|
||||
if (fp->fd_flags == FD_CLOSED)
|
||||
{
|
||||
if (put_fold_open_close(fd, fp, off) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open or close the leaf according to the window foldlevel.
|
||||
* Do not close a leaf that is already closed, as it will close
|
||||
* the parent. */
|
||||
level = foldLevelWin(wp, off + fp->fd_top);
|
||||
if ((fp->fd_flags == FD_CLOSED && wp->w_p_fdl >= level)
|
||||
|| (fp->fd_flags != FD_CLOSED && wp->w_p_fdl < level))
|
||||
if (put_fold_open_close(fd, fp, off) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|| fprintf(fd, "normal z%c",
|
||||
fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
|
||||
|| put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
++fp;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* put_fold_open_close() {{{2 */
|
||||
/*
|
||||
* Write the open or close command to "fd".
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_fold_open_close(fd, fp, off)
|
||||
FILE *fd;
|
||||
fold_T *fp;
|
||||
linenr_T off;
|
||||
{
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|| fprintf(fd, "normal z%c",
|
||||
fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
|
||||
|| put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif /* FEAT_SESSION */
|
||||
|
||||
/* }}}1 */
|
||||
|
||||
+2
-1
@@ -4523,7 +4523,8 @@ im_show_info(void)
|
||||
vgetc_busy = TRUE;
|
||||
showmode();
|
||||
vgetc_busy = old_vgetc_busy;
|
||||
setcursor();
|
||||
if ((State & NORMAL) || (State & INSERT))
|
||||
setcursor();
|
||||
out_flush();
|
||||
}
|
||||
|
||||
|
||||
+16
-11
@@ -4139,17 +4139,6 @@ vim_getenv(name, mustfree)
|
||||
{
|
||||
vim_setenv((char_u *)"VIMRUNTIME", p);
|
||||
didset_vimruntime = TRUE;
|
||||
#ifdef FEAT_GETTEXT
|
||||
{
|
||||
char_u *buf = concat_str(p, (char_u *)"/lang");
|
||||
|
||||
if (buf != NULL)
|
||||
{
|
||||
bindtextdomain(VIMPACKAGE, (char *)buf);
|
||||
vim_free(buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4227,6 +4216,22 @@ vim_setenv(name, val)
|
||||
putenv((char *)envbuf);
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_GETTEXT
|
||||
/*
|
||||
* When setting $VIMRUNTIME adjust the directory to find message
|
||||
* translations to $VIMRUNTIME/lang.
|
||||
*/
|
||||
if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0)
|
||||
{
|
||||
char_u *buf = concat_str(val, (char_u *)"/lang");
|
||||
|
||||
if (buf != NULL)
|
||||
{
|
||||
bindtextdomain(VIMPACKAGE, (char *)buf);
|
||||
vim_free(buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||
|
||||
+1
-1
@@ -2074,7 +2074,7 @@ ga_grow(gap, n)
|
||||
n = gap->ga_growsize;
|
||||
new_len = gap->ga_itemsize * (gap->ga_len + n);
|
||||
pp = (gap->ga_data == NULL)
|
||||
? alloc(new_len) : vim_realloc(gap->ga_data, new_len);
|
||||
? alloc((unsigned)new_len) : vim_realloc(gap->ga_data, new_len);
|
||||
if (pp == NULL)
|
||||
return FAIL;
|
||||
old_len = gap->ga_itemsize * gap->ga_maxlen;
|
||||
|
||||
@@ -1957,6 +1957,9 @@ op_delete(oap)
|
||||
++curwin->w_cursor.lnum;
|
||||
del_lines((long)(oap->line_count - 2), FALSE);
|
||||
|
||||
if (delete_last_line)
|
||||
oap->end.lnum = curbuf->b_ml.ml_line_count;
|
||||
|
||||
n = (oap->end.col + 1 - !oap->inclusive);
|
||||
if (oap->inclusive && delete_last_line
|
||||
&& n > (int)STRLEN(ml_get(oap->end.lnum)))
|
||||
|
||||
+2
-1
@@ -11126,7 +11126,8 @@ has_format_option(x)
|
||||
shortmess(x)
|
||||
int x;
|
||||
{
|
||||
return ( vim_strchr(p_shm, x) != NULL
|
||||
return p_shm != NULL &&
|
||||
( vim_strchr(p_shm, x) != NULL
|
||||
|| (vim_strchr(p_shm, 'a') != NULL
|
||||
&& vim_strchr((char_u *)SHM_A, x) != NULL));
|
||||
}
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ get_exe_name(void)
|
||||
static void
|
||||
unescape_shellxquote(char_u *p, char_u *escaped)
|
||||
{
|
||||
int l = STRLEN(p);
|
||||
int l = (int)STRLEN(p);
|
||||
int n;
|
||||
|
||||
while (*p != NUL)
|
||||
|
||||
@@ -44,6 +44,7 @@ int has_cursorhold __ARGS((void));
|
||||
int trigger_cursorhold __ARGS((void));
|
||||
int has_cursormoved __ARGS((void));
|
||||
int has_cursormovedI __ARGS((void));
|
||||
int has_insertcharpre __ARGS((void));
|
||||
void block_autocmds __ARGS((void));
|
||||
void unblock_autocmds __ARGS((void));
|
||||
int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
|
||||
|
||||
+30
-1
@@ -2995,11 +2995,28 @@ ex_cfile(eap)
|
||||
{
|
||||
win_T *wp = NULL;
|
||||
qf_info_T *qi = &ql_info;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
char_u *au_name = NULL;
|
||||
#endif
|
||||
|
||||
if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
|
||||
|| eap->cmdidx == CMD_laddfile)
|
||||
|| eap->cmdidx == CMD_laddfile)
|
||||
wp = curwin;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_cfile: au_name = (char_u *)"cfile"; break;
|
||||
case CMD_cgetfile: au_name = (char_u *)"cgetfile"; break;
|
||||
case CMD_caddfile: au_name = (char_u *)"caddfile"; break;
|
||||
case CMD_lfile: au_name = (char_u *)"lfile"; break;
|
||||
case CMD_lgetfile: au_name = (char_u *)"lgetfile"; break;
|
||||
case CMD_laddfile: au_name = (char_u *)"laddfile"; break;
|
||||
default: break;
|
||||
}
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, NULL, FALSE, curbuf);
|
||||
#endif
|
||||
#ifdef FEAT_BROWSE
|
||||
if (cmdmod.browse)
|
||||
{
|
||||
@@ -3031,10 +3048,22 @@ ex_cfile(eap)
|
||||
&& (eap->cmdidx == CMD_cfile
|
||||
|| eap->cmdidx == CMD_lfile))
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
|
||||
#endif
|
||||
if (wp != NULL)
|
||||
qi = GET_LOC_LIST(wp);
|
||||
qf_jump(qi, 0, 0, eap->forceit); /* display first error */
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -49,7 +49,7 @@ STARTTEST
|
||||
:tabclose
|
||||
:call append(line('$'), test_status)
|
||||
:"
|
||||
:"
|
||||
:if has('gui') || has('clientserver')
|
||||
:" Test for ":tab drop exist-file" to keep current window.
|
||||
:sp test1
|
||||
:tab drop test1
|
||||
@@ -85,6 +85,12 @@ STARTTEST
|
||||
:tabclose
|
||||
:q
|
||||
:call append(line('$'), test_status)
|
||||
:else
|
||||
:" :drop not supported
|
||||
:call append(line('$'), 'tab drop 1: pass')
|
||||
:call append(line('$'), 'tab drop 2: pass')
|
||||
:call append(line('$'), 'tab drop 3: pass')
|
||||
:endif
|
||||
:"
|
||||
:"
|
||||
:/^Results/,$w! test.out
|
||||
|
||||
+31
-6
@@ -729,6 +729,34 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
470,
|
||||
/**/
|
||||
469,
|
||||
/**/
|
||||
468,
|
||||
/**/
|
||||
467,
|
||||
/**/
|
||||
466,
|
||||
/**/
|
||||
465,
|
||||
/**/
|
||||
464,
|
||||
/**/
|
||||
463,
|
||||
/**/
|
||||
462,
|
||||
/**/
|
||||
461,
|
||||
/**/
|
||||
460,
|
||||
/**/
|
||||
459,
|
||||
/**/
|
||||
458,
|
||||
/**/
|
||||
457,
|
||||
/**/
|
||||
456,
|
||||
/**/
|
||||
@@ -2197,12 +2225,9 @@ do_intro_line(row, mesg, add_version, attr)
|
||||
/* Check for 9.9x or 9.9xx, alpha/beta version */
|
||||
if (isalpha((int)vers[3]))
|
||||
{
|
||||
if (isalpha((int)vers[4]))
|
||||
sprintf((char *)vers + 5, ".%d%s", highest_patch(),
|
||||
mediumVersion + 5);
|
||||
else
|
||||
sprintf((char *)vers + 4, ".%d%s", highest_patch(),
|
||||
mediumVersion + 4);
|
||||
int len = (isalpha((int)vers[4])) ? 5 : 4;
|
||||
sprintf((char *)vers + len, ".%d%s", highest_patch(),
|
||||
mediumVersion + len);
|
||||
}
|
||||
else
|
||||
sprintf((char *)vers + 3, ".%d", highest_patch());
|
||||
|
||||
Reference in New Issue
Block a user