Compare commits

...

8 Commits

Author SHA1 Message Date
Bram Moolenaar
b3a6bbc7b6 updated for version 7.3.433
Problem:    Using continued lines in a Vim script can be slow.
Solution:   Instead of reallocating for every line use a growarray. (Yasuhiro
            Matsumoto)
2012-02-05 23:10:30 +01:00
Bram Moolenaar
8d462f9666 updated for version 7.3.432
Problem:    ACLs are not supported for ZFS or NFSv4 on Solaris.
Solution:   Add configure check and code. (Danek Duvall)
2012-02-05 22:51:33 +01:00
Bram Moolenaar
a8c8a688ac updated for version 7.3.431
Problem:    Fetching a key at a prompt may be confused by escape sequences.
            Especially when getting a prompt at a VimEnter autocommand.
            (Alex Efros)
Solution:   Properly handle escape sequences deleted by check_termcode().
2012-02-05 22:05:48 +01:00
Bram Moolenaar
73b2470896 updated for version 7.3.430
Problem:    When a custom filetype detection uses "augroup END" the conf
            fileytpe detection does not have the filetypedetect group.
Solution:   Always end the group and include filetypedetect in the conf
            autocommand. (Lech Lorens)
2012-02-05 20:08:36 +01:00
Bram Moolenaar
be094a1579 updated for version 7.3.429
Problem:    When 'cpoptions' includes "E" "c0" in the first column is an
            error. The redo register is then set to the errornous command.
Solution:   Do not set the redo register if the command fails because of an
            empty region. (Hideki Eiraku)
2012-02-05 01:18:48 +01:00
Bram Moolenaar
e37c611012 updated for version 7.3.428
Problem:    Win32: an xpm file without a mask crashes Vim.
Solution:   Fail when the mask is missing. (Dave Bodenstab)
2012-02-05 00:48:00 +01:00
Bram Moolenaar
a489e1d9d6 updated for version 7.3.427
Problem:    readfile() can be slow with long lines.
Solution:   Use realloc() instead of alloc(). (John Little)
2012-02-05 00:39:18 +01:00
Bram Moolenaar
76b9b3696c updated for version 7.3.426
Problem:    With '$' in 'cpoptions' the $ is not displayed in the first
            column.
Solution:   Use -1 instead of 0 as a special value. (Hideki Eiraku and
            Hirohito Higashi)
2012-02-04 23:35:00 +01:00
20 changed files with 362 additions and 159 deletions

View File

@@ -2545,17 +2545,19 @@ au BufNewFile,BufRead *.txt,*.text setf text
" detected filetypes.
runtime! ftdetect/*.vim
" NOTE: The above command could have ended the filetypedetect autocmd group
" and started another one. Let's make sure it has ended to get to a consistant
" state.
augroup END
" Generic configuration file (check this last, it's just guessing!)
au BufNewFile,BufRead,StdinReadPost *
au filetypedetect BufNewFile,BufRead,StdinReadPost *
\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
\ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
\ || getline(4) =~ '^#' || getline(5) =~ '^#') |
\ setf conf |
\ endif
augroup END
" If the GUI is already running, may still need to install the Syntax menu.
" Don't do it when the 'M' flag is included in 'guioptions'.

44
src/auto/configure vendored
View File

@@ -11328,7 +11328,47 @@ fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get in -lsec" >&5
$as_echo_n "checking for acl_get in -lsec... " >&6; }
if test "${ac_cv_lib_sec_acl_get+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsec $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char acl_get ();
int
main ()
{
return acl_get ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_sec_acl_get=yes
else
ac_cv_lib_sec_acl_get=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_acl_get" >&5
$as_echo "$ac_cv_lib_sec_acl_get" >&6; }
if test "x$ac_cv_lib_sec_acl_get" = x""yes; then :
LIBS="$LIBS -lsec"; $as_echo "#define HAVE_SOLARIS_ZFS_ACL 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5
$as_echo_n "checking for Solaris ACL support... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11355,6 +11395,8 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AIX ACL support" >&5
$as_echo_n "checking for AIX ACL support... " >&6; }

View File

@@ -363,6 +363,7 @@
/* Define if you want to add support for ACL */
#undef HAVE_POSIX_ACL
#undef HAVE_SOLARIS_ZFS_ACL
#undef HAVE_SOLARIS_ACL
#undef HAVE_AIX_ACL

View File

@@ -3106,6 +3106,7 @@ AC_TRY_LINK([
dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
dnl when -lacl works, also try to use -lattr (required for Debian).
dnl On Solaris, use the acl_get/set functions in libsec, if present.
AC_MSG_CHECKING(--disable-acl argument)
AC_ARG_ENABLE(acl,
[ --disable-acl Don't check for ACL support.],
@@ -3128,6 +3129,7 @@ acl_t acl;], [acl = acl_get_file("foo", ACL_TYPE_ACCESS);
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
AC_MSG_RESULT(no))
AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)],
AC_MSG_CHECKING(for Solaris ACL support)
AC_TRY_LINK([
#ifdef HAVE_SYS_ACL_H
@@ -3135,7 +3137,7 @@ AC_TRY_LINK([
#endif], [acl("foo", GETACLCNT, 0, NULL);
],
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
AC_MSG_RESULT(no))
AC_MSG_RESULT(no)))
AC_MSG_CHECKING(for AIX ACL support)
AC_TRY_LINK([

View File

@@ -1763,9 +1763,9 @@ display_dollar(col)
static void
undisplay_dollar()
{
if (dollar_vcol)
if (dollar_vcol >= 0)
{
dollar_vcol = 0;
dollar_vcol = -1;
redrawWinline(curwin->w_cursor.lnum, FALSE);
}
}
@@ -5441,7 +5441,7 @@ ins_complete(c)
compl_curr_match->cp_number);
edit_submode_extra = match_ref;
edit_submode_highl = HLF_R;
if (dollar_vcol)
if (dollar_vcol >= 0)
curs_columns(FALSE);
}
}
@@ -8961,7 +8961,7 @@ ins_bs(c, mode, inserted_space_p)
* We can emulate the vi behaviour by pretending there is a dollar
* displayed even when there isn't.
* --pkv Sun Jan 19 01:56:40 EST 2003 */
if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == 0)
if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == -1)
dollar_vcol = curwin->w_virtcol;
#ifdef FEAT_FOLDING

View File

@@ -14325,22 +14325,19 @@ f_readfile(argvars, rettv)
typval_T *rettv;
{
int binary = FALSE;
int failed = FALSE;
char_u *fname;
FILE *fd;
listitem_T *li;
#define FREAD_SIZE 200 /* optimized for text lines */
char_u buf[FREAD_SIZE];
int readlen; /* size of last fread() */
int buflen; /* nr of valid chars in buf[] */
int filtd; /* how much in buf[] was NUL -> '\n' filtered */
int tolist; /* first byte in buf[] still to be put in list */
int chop; /* how many CR to chop off */
char_u *prev = NULL; /* previously read bytes, if any */
int prevlen = 0; /* length of "prev" if not NULL */
char_u *s;
int len;
long maxline = MAXLNUM;
long cnt = 0;
char_u buf[(IOSIZE/256)*256]; /* rounded to avoid odd + 1 */
int io_size = sizeof(buf);
int readlen; /* size of last fread() */
char_u *prev = NULL; /* previously read bytes, if any */
long prevlen = 0; /* length of data in prev */
long prevsize = 0; /* size of prev buffer */
long maxline = MAXLNUM;
long cnt = 0;
char_u *p; /* position in buf */
char_u *start; /* start of current line */
if (argvars[1].v_type != VAR_UNKNOWN)
{
@@ -14362,49 +14359,61 @@ f_readfile(argvars, rettv)
return;
}
filtd = 0;
while (cnt < maxline || maxline < 0)
{
readlen = (int)fread(buf + filtd, 1, FREAD_SIZE - filtd, fd);
buflen = filtd + readlen;
tolist = 0;
for ( ; filtd < buflen || readlen <= 0; ++filtd)
{
if (readlen <= 0 || buf[filtd] == '\n')
{
/* In binary mode add an empty list item when the last
* non-empty line ends in a '\n'. */
if (!binary && readlen == 0 && filtd == 0 && prev == NULL)
break;
readlen = (int)fread(buf, 1, io_size, fd);
/* Found end-of-line or end-of-file: add a text line to the
* list. */
chop = 0;
if (!binary)
while (filtd - chop - 1 >= tolist
&& buf[filtd - chop - 1] == '\r')
++chop;
len = filtd - tolist - chop;
if (prev == NULL)
s = vim_strnsave(buf + tolist, len);
/* This for loop processes what was read, but is also entered at end
* of file so that either:
* - an incomplete line gets written
* - a "binary" file gets an empty line at the end if it ends in a
* newline. */
for (p = buf, start = buf;
p < buf + readlen || (readlen <= 0 && (prevlen > 0 || binary));
++p)
{
if (*p == '\n' || readlen <= 0)
{
listitem_T *li;
char_u *s = NULL;
long_u len = p - start;
/* Finished a line. Remove CRs before NL. */
if (readlen > 0 && !binary)
{
while (len > 0 && start[len - 1] == '\r')
--len;
/* removal may cross back to the "prev" string */
if (len == 0)
while (prevlen > 0 && prev[prevlen - 1] == '\r')
--prevlen;
}
if (prevlen == 0)
s = vim_strnsave(start, len);
else
{
s = alloc((unsigned)(prevlen + len + 1));
if (s != NULL)
/* Change "prev" buffer to be the right size. This way
* the bytes are only copied once, and very long lines are
* allocated only once. */
if ((s = vim_realloc(prev, prevlen + len + 1)) != NULL)
{
mch_memmove(s, prev, prevlen);
vim_free(prev);
prev = NULL;
mch_memmove(s + prevlen, buf + tolist, len);
mch_memmove(s + prevlen, start, len);
s[prevlen + len] = NUL;
prev = NULL; /* the list will own the string */
prevlen = prevsize = 0;
}
}
tolist = filtd + 1;
if (s == NULL)
{
do_outofmem_msg((long_u) prevlen + len + 1);
failed = TRUE;
break;
}
li = listitem_alloc();
if (li == NULL)
if ((li = listitem_alloc()) == NULL)
{
vim_free(s);
failed = TRUE;
break;
}
li->li_tv.v_type = VAR_STRING;
@@ -14412,74 +14421,109 @@ f_readfile(argvars, rettv)
li->li_tv.vval.v_string = s;
list_append(rettv->vval.v_list, li);
if (++cnt >= maxline && maxline >= 0)
break;
if (readlen <= 0)
start = p + 1; /* step over newline */
if ((++cnt >= maxline && maxline >= 0) || readlen <= 0)
break;
}
else if (buf[filtd] == NUL)
buf[filtd] = '\n';
else if (*p == NUL)
*p = '\n';
#ifdef FEAT_MBYTE
else if (buf[filtd] == 0xef
&& enc_utf8
&& filtd + 2 < buflen
&& !binary
&& buf[filtd + 1] == 0xbb
&& buf[filtd + 2] == 0xbf)
/* Check for utf8 "bom"; U+FEFF is encoded as EF BB BF. Do this
* when finding the BF and check the previous two bytes. */
else if (*p == 0xbf && enc_utf8 && !binary)
{
/* remove utf-8 byte order mark */
mch_memmove(buf + filtd, buf + filtd + 3, buflen - filtd - 3);
--filtd;
buflen -= 3;
}
#endif
}
if (readlen <= 0)
break;
/* Find the two bytes before the 0xbf. If p is at buf, or buf
* + 1, these may be in the "prev" string. */
char_u back1 = p >= buf + 1 ? p[-1]
: prevlen >= 1 ? prev[prevlen - 1] : NUL;
char_u back2 = p >= buf + 2 ? p[-2]
: p == buf + 1 && prevlen >= 1 ? prev[prevlen - 1]
: prevlen >= 2 ? prev[prevlen - 2] : NUL;
if (tolist == 0)
{
if (buflen >= FREAD_SIZE / 2)
{
/* "buf" is full, need to move text to an allocated buffer */
if (prev == NULL)
if (back2 == 0xef && back1 == 0xbb)
{
prev = vim_strnsave(buf, buflen);
prevlen = buflen;
}
else
{
s = alloc((unsigned)(prevlen + buflen));
if (s != NULL)
char_u *dest = p - 2;
/* Usually a BOM is at the beginning of a file, and so at
* the beginning of a line; then we can just step over it.
*/
if (start == dest)
start = p + 1;
else
{
mch_memmove(s, prev, prevlen);
mch_memmove(s + prevlen, buf, buflen);
vim_free(prev);
prev = s;
prevlen += buflen;
/* have to shuffle buf to close gap */
int adjust_prevlen = 0;
if (dest < buf)
{
adjust_prevlen = buf - dest; /* must be 1 or 2 */
dest = buf;
}
if (readlen > p - buf + 1)
mch_memmove(dest, p + 1, readlen - (p - buf) - 1);
readlen -= 3 - adjust_prevlen;
prevlen -= adjust_prevlen;
p = dest - 1;
}
}
filtd = 0;
}
}
else
#endif
} /* for */
if (failed || (cnt >= maxline && maxline >= 0) || readlen <= 0)
break;
if (start < p)
{
mch_memmove(buf, buf + tolist, buflen - tolist);
filtd -= tolist;
/* There's part of a line in buf, store it in "prev". */
if (p - start + prevlen >= prevsize)
{
/* need bigger "prev" buffer */
char_u *newprev;
/* A common use case is ordinary text files and "prev" gets a
* fragment of a line, so the first allocation is made
* small, to avoid repeatedly 'allocing' large and
* 'reallocing' small. */
if (prevsize == 0)
prevsize = p - start;
else
{
long grow50pc = (prevsize * 3) / 2;
long growmin = (p - start) * 2 + prevlen;
prevsize = grow50pc > growmin ? grow50pc : growmin;
}
if ((newprev = vim_realloc(prev, prevsize)) == NULL)
{
do_outofmem_msg((long_u)prevsize);
failed = TRUE;
break;
}
prev = newprev;
}
/* Add the line part to end of "prev". */
mch_memmove(prev + prevlen, start, p - start);
prevlen += p - start;
}
}
} /* while */
/*
* For a negative line count use only the lines at the end of the file,
* free the rest.
*/
if (maxline < 0)
if (!failed && maxline < 0)
while (cnt > -maxline)
{
listitem_remove(rettv->vval.v_list, rettv->vval.v_list->lv_first);
--cnt;
}
if (failed)
{
list_free(rettv->vval.v_list, TRUE);
/* readfile doc says an empty list is returned on error */
rettv->vval.v_list = list_alloc();
}
vim_free(prev);
fclose(fd);
}

View File

@@ -3439,22 +3439,32 @@ getsourceline(c, cookie, indent)
{
/* compensate for the one line read-ahead */
--sourcing_lnum;
for (;;)
/* Get the next line and concatenate it when it starts with a
* backslash. We always need to read the next line, keep it in
* sp->nextline. */
sp->nextline = get_one_sourceline(sp);
if (sp->nextline != NULL && *(p = skipwhite(sp->nextline)) == '\\')
{
sp->nextline = get_one_sourceline(sp);
if (sp->nextline == NULL)
break;
p = skipwhite(sp->nextline);
if (*p != '\\')
break;
s = alloc((unsigned)(STRLEN(line) + STRLEN(p)));
if (s == NULL) /* out of memory */
break;
STRCPY(s, line);
STRCAT(s, p + 1);
garray_T ga;
ga_init2(&ga, (int)sizeof(char_u), 200);
ga_concat(&ga, line);
ga_concat(&ga, p + 1);
for (;;)
{
vim_free(sp->nextline);
sp->nextline = get_one_sourceline(sp);
if (sp->nextline == NULL)
break;
p = skipwhite(sp->nextline);
if (*p != '\\')
break;
ga_concat(&ga, p + 1);
}
ga_append(&ga, NUL);
vim_free(line);
line = s;
vim_free(sp->nextline);
line = ga.ga_data;
}
}

View File

@@ -470,6 +470,24 @@ ResetRedobuff()
}
}
/*
* Discard the contents of the redo buffer and restore the previous redo
* buffer.
*/
void
CancelRedo()
{
if (!block_redo)
{
free_buff(&redobuff);
redobuff = old_redobuff;
old_redobuff.bh_first.b_next = NULL;
start_stuff();
while (read_stuff(TRUE) != NUL)
;
}
}
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
@@ -691,9 +709,9 @@ stuffnumReadbuff(n)
* Read a character from the redo buffer. Translates K_SPECIAL, CSI and
* multibyte characters.
* The redo buffer is left as it is.
* if init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
* otherwise
* if old is TRUE, use old_redobuff instead of redobuff
* If init is TRUE, prepare for redo, return FAIL if nothing to redo, OK
* otherwise.
* If old is TRUE, use old_redobuff instead of redobuff.
*/
static int
read_redo(init, old_redo)
@@ -2264,7 +2282,8 @@ vgetorpeek(advance)
typebuf.tb_off] == RM_YES))
&& !timedout)
{
keylen = check_termcode(max_mlen + 1, NULL, 0);
keylen = check_termcode(max_mlen + 1,
NULL, 0, NULL);
/* If no termcode matched but 'pastetoggle'
* matched partially it's like an incomplete key

View File

@@ -113,9 +113,9 @@ EXTERN int use_crypt_method INIT(= 0);
* When '$' is included in 'cpoptions' option set:
* When a change command is given that deletes only part of a line, a dollar
* is put at the end of the changed text. dollar_vcol is set to the virtual
* column of this '$'.
* column of this '$'. -1 is used to indicate no $ is being displayed.
*/
EXTERN colnr_T dollar_vcol INIT(= 0);
EXTERN colnr_T dollar_vcol INIT(= -1);
#ifdef FEAT_INS_EXPAND
/*

View File

@@ -3105,8 +3105,9 @@ ask_yesno(str, direct)
int
get_keystroke()
{
#define CBUFLEN 151
char_u buf[CBUFLEN];
char_u *buf = NULL;
int buflen = 150;
int maxlen;
int len = 0;
int n;
int save_mapped_ctrl_c = mapped_ctrl_c;
@@ -3118,12 +3119,29 @@ get_keystroke()
cursor_on();
out_flush();
/* Leave some room for check_termcode() to insert a key code into (max
* 5 chars plus NUL). And fix_input_buffer() can triple the number of
* bytes. */
maxlen = (buflen - 6 - len) / 3;
if (buf == NULL)
buf = alloc(buflen);
else if (maxlen < 10)
{
/* Need some more space. This migth happen when receiving a long
* escape sequence. */
buflen += 100;
buf = vim_realloc(buf, buflen);
maxlen = (buflen - 6 - len) / 3;
}
if (buf == NULL)
{
do_outofmem_msg((long_u)buflen);
return ESC; /* panic! */
}
/* First time: blocking wait. Second time: wait up to 100ms for a
* terminal code to complete. Leave some room for check_termcode() to
* insert a key code into (max 5 chars plus NUL). And
* fix_input_buffer() can triple the number of bytes. */
n = ui_inchar(buf + len, (CBUFLEN - 6 - len) / 3,
len == 0 ? -1L : 100L, 0);
* terminal code to complete. */
n = ui_inchar(buf + len, maxlen, len == 0 ? -1L : 100L, 0);
if (n > 0)
{
/* Replace zero and CSI by a special key code. */
@@ -3135,7 +3153,7 @@ get_keystroke()
++waited; /* keep track of the waiting time */
/* Incomplete termcode and not timed out yet: get more characters */
if ((n = check_termcode(1, buf, len)) < 0
if ((n = check_termcode(1, buf, buflen, &len)) < 0
&& (!p_ttimeout || waited * 100L < (p_ttm < 0 ? p_tm : p_ttm)))
continue;
@@ -3203,7 +3221,7 @@ get_keystroke()
{
if (MB_BYTE2LEN(n) > len)
continue; /* more bytes to get */
buf[len >= CBUFLEN ? CBUFLEN - 1 : len] = NUL;
buf[len >= buflen ? buflen - 1 : len] = NUL;
n = (*mb_ptr2char)(buf);
}
#endif
@@ -3213,6 +3231,7 @@ get_keystroke()
#endif
break;
}
vim_free(buf);
mapped_ctrl_c = save_mapped_ctrl_c;
return n;

View File

@@ -362,7 +362,7 @@ update_topline()
#endif
)
{
dollar_vcol = 0;
dollar_vcol = -1;
if (curwin->w_skipcol != 0)
{
curwin->w_skipcol = 0;
@@ -966,7 +966,7 @@ curs_columns(may_scroll)
/* remove '$' from change command when cursor moves onto it */
if (startcol > dollar_vcol)
dollar_vcol = 0;
dollar_vcol = -1;
extra = curwin_col_off();
curwin->w_wcol = curwin->w_virtcol + extra;

View File

@@ -1978,7 +1978,10 @@ do_pending_operator(cap, old_col, gui_yank)
VIsual_reselect = FALSE; /* don't reselect now */
#endif
if (empty_region_error)
{
vim_beep();
CancelRedo();
}
else
{
(void)op_delete(oap);
@@ -1992,7 +1995,10 @@ do_pending_operator(cap, old_col, gui_yank)
if (empty_region_error)
{
if (!gui_yank)
{
vim_beep();
CancelRedo();
}
}
else
(void)op_yank(oap, FALSE, !gui_yank);
@@ -2004,7 +2010,10 @@ do_pending_operator(cap, old_col, gui_yank)
VIsual_reselect = FALSE; /* don't reselect now */
#endif
if (empty_region_error)
{
vim_beep();
CancelRedo();
}
else
{
/* This is a new edit command, not a restart. Need to
@@ -2066,7 +2075,10 @@ do_pending_operator(cap, old_col, gui_yank)
case OP_LOWER:
case OP_ROT13:
if (empty_region_error)
{
vim_beep();
CancelRedo();
}
else
op_tilde(oap);
check_cursor_col();
@@ -2099,7 +2111,10 @@ do_pending_operator(cap, old_col, gui_yank)
#endif
#ifdef FEAT_VISUALEXTRA
if (empty_region_error)
{
vim_beep();
CancelRedo();
}
else
{
/* This is a new edit command, not a restart. Need to
@@ -2129,7 +2144,10 @@ do_pending_operator(cap, old_col, gui_yank)
#ifdef FEAT_VISUALEXTRA
if (empty_region_error)
#endif
{
vim_beep();
CancelRedo();
}
#ifdef FEAT_VISUALEXTRA
else
op_replace(oap, cap->nchar);

View File

@@ -2746,6 +2746,13 @@ mch_get_acl(fname)
#ifdef HAVE_POSIX_ACL
ret = (vim_acl_T)acl_get_file((char *)fname, ACL_TYPE_ACCESS);
#else
#ifdef HAVE_SOLARIS_ZFS_ACL
acl_t *aclent;
if (acl_get((char *)fname, 0, &aclent) < 0)
return NULL;
ret = (vim_acl_T)aclent;
#else
#ifdef HAVE_SOLARIS_ACL
vim_acl_solaris_T *aclent;
@@ -2791,6 +2798,7 @@ mch_get_acl(fname)
ret = (vim_acl_T)aclent;
#endif /* HAVE_AIX_ACL */
#endif /* HAVE_SOLARIS_ACL */
#endif /* HAVE_SOLARIS_ZFS_ACL */
#endif /* HAVE_POSIX_ACL */
return ret;
}
@@ -2808,6 +2816,9 @@ mch_set_acl(fname, aclent)
#ifdef HAVE_POSIX_ACL
acl_set_file((char *)fname, ACL_TYPE_ACCESS, (acl_t)aclent);
#else
#ifdef HAVE_SOLARIS_ZFS_ACL
acl_set((char *)fname, (acl_t *)aclent);
#else
#ifdef HAVE_SOLARIS_ACL
acl((char *)fname, SETACL, ((vim_acl_solaris_T *)aclent)->acl_cnt,
((vim_acl_solaris_T *)aclent)->acl_entry);
@@ -2816,6 +2827,7 @@ mch_set_acl(fname, aclent)
chacl((char *)fname, aclent, ((struct acl *)aclent)->acl_len);
#endif /* HAVE_AIX_ACL */
#endif /* HAVE_SOLARIS_ACL */
#endif /* HAVE_SOLARIS_ZFS_ACL */
#endif /* HAVE_POSIX_ACL */
}
@@ -2828,6 +2840,9 @@ mch_free_acl(aclent)
#ifdef HAVE_POSIX_ACL
acl_free((acl_t)aclent);
#else
#ifdef HAVE_SOLARIS_ZFS_ACL
acl_free((acl_t *)aclent);
#else
#ifdef HAVE_SOLARIS_ACL
free(((vim_acl_solaris_T *)aclent)->acl_entry);
free(aclent);
@@ -2836,6 +2851,7 @@ mch_free_acl(aclent)
free(aclent);
#endif /* HAVE_AIX_ACL */
#endif /* HAVE_SOLARIS_ACL */
#endif /* HAVE_SOLARIS_ZFS_ACL */
#endif /* HAVE_POSIX_ACL */
}
#endif

View File

@@ -4,8 +4,9 @@ char_u *get_recorded __ARGS((void));
char_u *get_inserted __ARGS((void));
int stuff_empty __ARGS((void));
void typeahead_noflush __ARGS((int c));
void flush_buffers __ARGS((int typeahead));
void flush_buffers __ARGS((int flush_typeahead));
void ResetRedobuff __ARGS((void));
void CancelRedo __ARGS((void));
void saveRedobuff __ARGS((void));
void restoreRedobuff __ARGS((void));
void AppendToRedobuff __ARGS((char_u *s));

View File

@@ -50,7 +50,7 @@ char_u *find_termcode __ARGS((char_u *name));
char_u *get_termcode __ARGS((int i));
void del_termcode __ARGS((char_u *name));
void set_mouse_topline __ARGS((win_T *wp));
int check_termcode __ARGS((int max_offset, char_u *buf, int buflen));
int check_termcode __ARGS((int max_offset, char_u *buf, int bufsize, int *buflen));
char_u *replace_termcodes __ARGS((char_u *from, char_u **bufp, int from_part, int do_lt, int special));
int find_term_bykeys __ARGS((char_u *src));
void show_termcodes __ARGS((void));

View File

@@ -1637,11 +1637,11 @@ win_update(wp)
* When at start of changed lines: May scroll following lines
* up or down to minimize redrawing.
* Don't do this when the change continues until the end.
* Don't scroll when dollar_vcol is non-zero, keep the "$".
* Don't scroll when dollar_vcol >= 0, keep the "$".
*/
if (lnum == mod_top
&& mod_bot != MAXLNUM
&& !(dollar_vcol != 0 && mod_bot == mod_top + 1))
&& !(dollar_vcol >= 0 && mod_bot == mod_top + 1))
{
int old_rows = 0;
int new_rows = 0;
@@ -1868,12 +1868,12 @@ win_update(wp)
if (row > wp->w_height) /* past end of screen */
{
/* we may need the size of that too long line later on */
if (dollar_vcol == 0)
if (dollar_vcol == -1)
wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
++idx;
break;
}
if (dollar_vcol == 0)
if (dollar_vcol == -1)
wp->w_lines[idx].wl_size = row - srow;
++idx;
#ifdef FEAT_FOLDING
@@ -1990,7 +1990,7 @@ win_update(wp)
}
#endif
}
else if (dollar_vcol == 0)
else if (dollar_vcol == -1)
wp->w_botline = lnum;
/* make sure the rest of the screen is blank */
@@ -2005,7 +2005,7 @@ win_update(wp)
wp->w_old_botfill = wp->w_botfill;
#endif
if (dollar_vcol == 0)
if (dollar_vcol == -1)
{
/*
* There is a trick with w_botline. If we invalidate it on each
@@ -3564,7 +3564,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
}
/* When still displaying '$' of change command, stop at cursor */
if (dollar_vcol != 0 && wp == curwin
if (dollar_vcol >= 0 && wp == curwin
&& lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
#ifdef FEAT_DIFF
&& filler_todo <= 0

View File

@@ -2501,8 +2501,8 @@ showmatch(c)
save_siso = p_siso;
/* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
* stop displaying the "$". */
if (dollar_vcol > 0 && dollar_vcol == curwin->w_virtcol)
dollar_vcol = 0;
if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol)
dollar_vcol = -1;
++curwin->w_virtcol; /* do display ')' just before "$" */
update_screen(VALID); /* show the new char first */

View File

@@ -3785,14 +3785,16 @@ set_mouse_topline(wp)
* With a match, the match is removed, the replacement code is inserted in
* typebuf.tb_buf[] and the number of characters in typebuf.tb_buf[] is
* returned.
* When "buf" is not NULL, it is used instead of typebuf.tb_buf[]. "buflen" is
* then the length of the string in buf[].
* When "buf" is not NULL, buf[bufsize] is used instead of typebuf.tb_buf[].
* "buflen" is then the length of the string in buf[] and is updated for
* inserts and deletes.
*/
int
check_termcode(max_offset, buf, buflen)
check_termcode(max_offset, buf, bufsize, buflen)
int max_offset;
char_u *buf;
int buflen;
int bufsize;
int *buflen;
{
char_u *tp;
char_u *p;
@@ -3864,10 +3866,10 @@ check_termcode(max_offset, buf, buflen)
}
else
{
if (offset >= buflen)
if (offset >= *buflen)
break;
tp = buf + offset;
len = buflen - offset;
len = *buflen - offset;
}
/*
@@ -5002,12 +5004,18 @@ check_termcode(max_offset, buf, buflen)
if (extra < 0)
/* remove matched characters */
mch_memmove(buf + offset, buf + offset - extra,
(size_t)(buflen + offset + extra));
(size_t)(*buflen + offset + extra));
else if (extra > 0)
/* insert the extra space we need */
{
/* Insert the extra space we need. If there is insufficient
* space return -1. */
if (*buflen + extra + new_slen >= bufsize)
return -1;
mch_memmove(buf + offset + extra, buf + offset,
(size_t)(buflen - offset));
(size_t)(*buflen - offset));
}
mch_memmove(buf + offset, string, (size_t)new_slen);
*buflen = *buflen + extra + new_slen;
}
return retval == 0 ? (len + extra + offset) : retval;
}

View File

@@ -714,6 +714,22 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
433,
/**/
432,
/**/
431,
/**/
430,
/**/
429,
/**/
428,
/**/
427,
/**/
426,
/**/
425,
/**/

View File

@@ -1,4 +1,5 @@
/*
/* vi:set ts=8 sts=4 sw=4:
*
* Load XPM image.
*
* This function is placed in separate file because Xpm headers conflict with
@@ -30,9 +31,10 @@
#include "xpm.h"
/*
* Tries to load Xpm image from file 'filename'.
* If fails return -1.
* success - 0 and image and mask BITMAPS
* Tries to load an Xpm image from the file "filename".
* Returns -1 on failure.
* Returns 0 on success and stores image and mask BITMAPS in "hImage" and
* "hShape".
*/
int
LoadXpmImage(filename, hImage, hShape)
@@ -40,7 +42,7 @@ LoadXpmImage(filename, hImage, hShape)
HBITMAP *hImage;
HBITMAP *hShape;
{
XImage *img; /* loaded image */
XImage *img; /* loaded image */
XImage *shp; /* shapeimage */
XpmAttributes attr;
int res;
@@ -51,10 +53,13 @@ LoadXpmImage(filename, hImage, hShape)
DeleteDC(hdc);
if (res < 0)
return -1;
else
if (shp == NULL)
{
*hImage = img->bitmap;
*hShape = shp->bitmap;
return 0;
if (img)
XDestroyImage(img);
return -1;
}
*hImage = img->bitmap;
*hShape = shp->bitmap;
return 0;
}