Compare commits

...

25 Commits

Author SHA1 Message Date
Bram Moolenaar
c67764a705 updated for version 7.0-132 2006-10-12 19:14:26 +00:00
Bram Moolenaar
2cc9318401 updated for version 7.0-131 2006-10-10 19:56:03 +00:00
Bram Moolenaar
043545e0f6 updated for version 7.0-130 2006-10-10 16:44:07 +00:00
Bram Moolenaar
57ac3a2163 updated for version 7.0-129 2006-10-10 16:28:30 +00:00
Bram Moolenaar
da68cf33d8 updated for version 7.0-128 2006-10-10 15:35:57 +00:00
Bram Moolenaar
31e97bf0ee updated for version 7.0-127 2006-10-10 14:20:13 +00:00
Bram Moolenaar
f3442e7274 updated for version 7.0-126 2006-10-10 13:49:10 +00:00
Bram Moolenaar
6179c61827 updated for version 7.0-125 2006-10-10 11:26:53 +00:00
Bram Moolenaar
69a7e43028 updated for version 7.0-124 2006-10-10 10:55:47 +00:00
Bram Moolenaar
a1b5aa52c4 updated for version 7.0-123 2006-10-10 09:41:28 +00:00
Bram Moolenaar
9c69732279 updated for version 7.0-122 2006-10-09 20:11:17 +00:00
Bram Moolenaar
8838aeeea9 updated for version 7.0-121 2006-10-08 11:56:24 +00:00
Bram Moolenaar
21bffa7550 updated for version 7.0-120 2006-10-06 21:33:16 +00:00
Bram Moolenaar
c0a0ab5c54 updated for version 7.0-119 2006-10-06 18:39:58 +00:00
Bram Moolenaar
970cf12a3c updated for version 7.0-118 2006-10-03 15:21:42 +00:00
Bram Moolenaar
7bd2cd8d19 updated for version 7.0-117 2006-10-03 15:04:36 +00:00
Bram Moolenaar
d9b8733023 updated for version 7.0-116 2006-10-03 14:30:41 +00:00
Bram Moolenaar
5948a57702 updated for version 7.0-115 2006-10-03 13:49:29 +00:00
Bram Moolenaar
d9dfd57f4a updated for version 7.0-114 2006-10-03 13:36:13 +00:00
Bram Moolenaar
132283f943 updated for version 7.0-113 2006-10-03 13:22:23 +00:00
Bram Moolenaar
658ada69f4 updated for version 7.0-112 2006-10-03 13:02:36 +00:00
Bram Moolenaar
60a495f02e updated for version 7.0-111 2006-10-03 12:44:42 +00:00
Bram Moolenaar
89f3727bd9 updated for version 7.0-110 2006-09-26 11:48:34 +00:00
Bram Moolenaar
15ff6c1940 updated for version 7.0-109 2006-09-15 18:18:09 +00:00
Bram Moolenaar
e38536441c updated for version 7.0-108 2006-09-14 19:36:57 +00:00
28 changed files with 415 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Jul 19
" Last Change: 2006 Oct 03
" These functions are used by the gzip plugin.
@@ -68,9 +68,9 @@ fun gzip#read(cmd)
let tmp = tempname()
let tmpe = tmp . "." . expand("<afile>:e")
" write the just read lines to a temp file "'[,']w tmp.gz"
execute "silent '[,']w " . tmpe
execute "silent '[,']w " . escape(tmpe, ' ')
" uncompress the temp file: call system("gzip -dn tmp.gz")
call system(a:cmd . " " . tmpe)
call system(a:cmd . " " . s:escape(tmpe))
if !filereadable(tmp)
" uncompress didn't work! Keep the compressed file then.
echoerr "Error: Could not read uncompressed file"
@@ -127,9 +127,9 @@ fun gzip#write(cmd)
let nmt = s:tempname(nm)
if rename(nm, nmt) == 0
if exists("b:gzip_comp_arg")
call system(a:cmd . " " . b:gzip_comp_arg . " '" . nmt . "'")
call system(a:cmd . " " . b:gzip_comp_arg . " " . s:escape(nmt))
else
call system(a:cmd . " '" . nmt . "'")
call system(a:cmd . " " . s:escape(nmt))
endif
call rename(nmt . "." . expand("<afile>:e"), nm)
endif
@@ -154,10 +154,10 @@ fun gzip#appre(cmd)
if rename(nm, nmte) == 0
if &patchmode != "" && getfsize(nm . &patchmode) == -1
" Create patchmode file by creating the decompressed file new
call system(a:cmd . " -c " . nmte . " > " . nmt)
call system(a:cmd . " -c " . s:escape(nmte) . " > " . s:escape(nmt))
call rename(nmte, nm . &patchmode)
else
call system(a:cmd . " " . nmte)
call system(a:cmd . " " . s:escape(nmte))
endif
call rename(nmt, nm)
endif
@@ -175,4 +175,12 @@ fun s:tempname(name)
return fnamemodify(a:name, ":p:h") . "/X~=@l9q5"
endfun
fun s:escape(name)
" shellescape() was added by patch 7.0.111
if v:version > 700 || (v:version == 700 && has('patch111'))
return shellescape(a:name)
endif
return "'" . a:name . "'"
endfun
" vim: set sw=2 :

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0. Last change: 2006 May 06
*eval.txt* For Vim version 7.0. Last change: 2006 Sep 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1709,6 +1709,8 @@ setreg( {n}, {v}[, {opt}]) Number set register to value and type
settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window
{winnr} in tab page {tabnr} to {val}
setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
shellescape( {string}) String escape {string} for use as shell
command argument
simplify( {filename}) String simplify filename as much as possible
sort( {list} [, {func}]) List sort {list}, using {func} to compare
soundfold( {word}) String sound-fold {word}
@@ -4434,6 +4436,21 @@ setwinvar({nr}, {varname}, {val}) *setwinvar()*
:call setwinvar(1, "&list", 0)
:call setwinvar(2, "myvar", "foobar")
shellescape({string}) *shellescape()*
Escape {string} for use as shell command argument.
On MS-Windows and MS-DOS, when 'shellslash' is not set, it
will enclose {string} double quotes and double all double
quotes within {string}.
For other systems, it will enclose {string} in single quotes
and replace all "'" with "'\''".
Example: >
:echo shellescape('c:\program files\vim')
< results in:
"c:\program files\vim" ~
Example usage: >
:call system("chmod +x -- " . shellescape(expand("%")))
simplify({filename}) *simplify()*
Simplify the file name as much as possible without changing
the meaning. Shortcuts (on MS-Windows) or symbolic links (on

View File

@@ -4792,10 +4792,22 @@ A jump table for the options with a short description can be found at |Q_op|.
completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
See |complete-functions| for an explanation of how the function is
invoked and what it should return.
This option is usually set by a filetype plugin.
This option is usually set by a filetype plugin:
|:filetype-plugin-on|
*'opendevice* *'odev* *'noopendevice* *'noodev*
'opendevice' 'odev' boolean (default off)
global
{not in Vi}
{only for MS-DOS, MS-Windows and OS/2}
Enable reading and writing from devices. This may get Vim stuck on a
device that can be opened but doesn't actually do the I/O. Therefore
it is off by default.
Note that on MS-Windows editing "aux.h", "lpt1.txt" and the like also
result in editing a device.
*'operatorfunc'* *'opfunc'*
'operatorfunc' 'opfunc' string (default: empty)
global

6
src/auto/configure vendored
View File

@@ -4256,7 +4256,7 @@ fi
echo $ECHO_N "checking if -pthread should be used... $ECHO_C" >&6
threadsafe_flag=
thread_lib=
if test "x$MACOSX" != "xyes"; then
if test "`(uname) 2>/dev/null`" != Darwin; then
test "$GCC" = yes && threadsafe_flag="-pthread"
if test "`(uname) 2>/dev/null`" = FreeBSD; then
threadsafe_flag="-D_THREAD_SAFE"
@@ -11555,8 +11555,8 @@ rm -f conftest.err conftest.$ac_objext \
else
echo "$as_me:$LINENO: result: empty: automatic terminal library selection" >&5
echo "${ECHO_T}empty: automatic terminal library selection" >&6
case "`uname -s 2>/dev/null`" in
OSF1) tlibs="ncurses curses termlib termcap";;
case "`uname -s 2>/dev/null`" in
OSF1|SCO_SV) tlibs="ncurses curses termlib termcap";;
*) tlibs="ncurses termlib termcap curses";;
esac
for libname in $tlibs; do

View File

@@ -681,7 +681,8 @@ eof
AC_MSG_CHECKING([if -pthread should be used])
threadsafe_flag=
thread_lib=
if test "x$MACOSX" != "xyes"; then
dnl if test "x$MACOSX" != "xyes"; then
if test "`(uname) 2>/dev/null`" != Darwin; then
test "$GCC" = yes && threadsafe_flag="-pthread"
if test "`(uname) 2>/dev/null`" = FreeBSD; then
threadsafe_flag="-D_THREAD_SAFE"
@@ -2151,8 +2152,9 @@ else
dnl Newer versions of ncurses are preferred over anything.
dnl Older versions of ncurses have bugs, get a new one!
dnl Digital Unix (OSF1) should use curses (Ronald Schild).
dnl On SCO Openserver should prefer termlib (Roger Cornelius).
case "`uname -s 2>/dev/null`" in
OSF1) tlibs="ncurses curses termlib termcap";;
OSF1|SCO_SV) tlibs="ncurses curses termlib termcap";;
*) tlibs="ncurses termlib termcap curses";;
esac
for libname in $tlibs; do

View File

@@ -923,6 +923,7 @@ doESCkey:
if (cmdchar != 'r' && cmdchar != 'v')
apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL,
FALSE, curbuf);
did_cursorhold = FALSE;
#endif
return (c == Ctrl_O);
}
@@ -2157,7 +2158,7 @@ ins_compl_add(str, len, icase, fname, cptext, cdir, flags, adup)
do
{
if ( !(match->cp_flags & ORIGINAL_TEXT)
&& ins_compl_equal(match, str, len)
&& STRNCMP(match->cp_str, str, len) == 0
&& match->cp_str[len] == NUL)
return NOTDONE;
match = match->cp_next;
@@ -3206,7 +3207,8 @@ ins_compl_addfrommatch()
for (cp = compl_shown_match->cp_next; cp != NULL
&& cp != compl_first_match; cp = cp->cp_next)
{
if (ins_compl_equal(cp, compl_leader,
if (compl_leader == NULL
|| ins_compl_equal(cp, compl_leader,
(int)STRLEN(compl_leader)))
{
p = cp->cp_str;
@@ -4041,7 +4043,7 @@ ins_compl_get_exp(ini)
if (got_int)
break;
/* Fill the popup menu as soon as possible. */
if (pum_wanted() && type != -1)
if (type != -1)
ins_compl_check_keys(0);
if ((ctrl_x_mode != 0 && ctrl_x_mode != CTRL_X_WHOLE_LINE)
@@ -5331,8 +5333,16 @@ insertchar(c, flags, second_indent)
/* Format with 'formatexpr' when it's set. Use internal formatting
* when 'formatexpr' isn't set or it returns non-zero. */
#if defined(FEAT_EVAL)
if (*curbuf->b_p_fex == NUL
|| fex_format(curwin->w_cursor.lnum, 1L, c) != 0)
int do_internal = TRUE;
if (*curbuf->b_p_fex != NUL)
{
do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0);
/* It may be required to save for undo again, e.g. when setline()
* was called. */
ins_need_undo = TRUE;
}
if (do_internal)
#endif
internal_format(textwidth, second_indent, flags, c == NUL);
}

View File

@@ -622,6 +622,7 @@ static void f_setqflist __ARGS((typval_T *argvars, typval_T *rettv));
static void f_setreg __ARGS((typval_T *argvars, typval_T *rettv));
static void f_settabwinvar __ARGS((typval_T *argvars, typval_T *rettv));
static void f_setwinvar __ARGS((typval_T *argvars, typval_T *rettv));
static void f_shellescape __ARGS((typval_T *argvars, typval_T *rettv));
static void f_simplify __ARGS((typval_T *argvars, typval_T *rettv));
static void f_sort __ARGS((typval_T *argvars, typval_T *rettv));
static void f_soundfold __ARGS((typval_T *argvars, typval_T *rettv));
@@ -7146,6 +7147,7 @@ static struct fst
{"setreg", 2, 3, f_setreg},
{"settabwinvar", 4, 4, f_settabwinvar},
{"setwinvar", 3, 3, f_setwinvar},
{"shellescape", 1, 1, f_shellescape},
{"simplify", 1, 1, f_simplify},
{"sort", 1, 2, f_sort},
{"soundfold", 1, 1, f_soundfold},
@@ -10430,20 +10432,14 @@ getwinvar(argvars, rettv, off)
if (win != NULL && varname != NULL)
{
/* Set curwin to be our win, temporarily. Also set curbuf, so
* that we can get buffer-local options. */
oldcurwin = curwin;
curwin = win;
curbuf = win->w_buffer;
if (*varname == '&') /* window-local-option */
{
/* Set curwin to be our win, temporarily. Also set curbuf, so
* that we can get buffer-local options. */
oldcurwin = curwin;
curwin = win;
curbuf = win->w_buffer;
get_option_tv(&varname, rettv, 1);
/* restore previous notion of curwin */
curwin = oldcurwin;
curbuf = curwin->w_buffer;
}
else
{
if (*varname == NUL)
@@ -10456,6 +10452,10 @@ getwinvar(argvars, rettv, off)
if (v != NULL)
copy_tv(&v->di_tv, rettv);
}
/* restore previous notion of curwin */
curwin = oldcurwin;
curbuf = curwin->w_buffer;
}
--emsg_off;
@@ -14604,6 +14604,18 @@ setwinvar(argvars, rettv, off)
}
}
/*
* "shellescape({string})" function
*/
static void
f_shellescape(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
rettv->vval.v_string = vim_strsave_shellescape(get_tv_string(&argvars[0]));
rettv->v_type = VAR_STRING;
}
/*
* "simplify()" function
*/

View File

@@ -416,6 +416,20 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
msg_scroll = msg_save;
return FAIL;
}
# if defined(MSDOS) || defined(MSWIN) || defined(OS2)
/*
* MS-Windows allows opening a device, but we will probably get stuck
* trying to read it.
*/
if (!p_odev && mch_nodetype(fname) == NODE_WRITABLE)
{
filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option"), 0);
msg_end();
msg_scroll = msg_save;
return FAIL;
}
# endif
}
#endif
@@ -3163,6 +3177,16 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
}
if (c == NODE_WRITABLE)
{
# if defined(MSDOS) || defined(MSWIN) || defined(OS2)
/* MS-Windows allows opening a device, but we will probably get stuck
* trying to write to it. */
if (!p_odev)
{
errnum = (char_u *)"E796: ";
errmsg = (char_u *)_("writing to device disabled with 'opendevice' option");
goto fail;
}
# endif
device = TRUE;
newfile = TRUE;
perm = -1;

View File

@@ -1960,10 +1960,13 @@ vgetorpeek(advance)
c = Ctrl_C;
flush_buffers(TRUE); /* flush all typeahead */
/* Also record this character, it might be needed to
* get out of Insert mode. */
*typebuf.tb_buf = c;
gotchars(typebuf.tb_buf, 1);
if (advance)
{
/* Also record this character, it might be needed to
* get out of Insert mode. */
*typebuf.tb_buf = c;
gotchars(typebuf.tb_buf, 1);
}
cmd_silent = FALSE;
break;

View File

@@ -637,6 +637,7 @@ gui_exit(rc)
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(PROTO)
# define NEED_GUI_UPDATE_SCREEN 1
/*
* Called when the GUI shell is closed by the user. If there are no changed
* files Vim exits, otherwise there will be a dialog to ask the user what to
@@ -665,8 +666,7 @@ gui_shell_closed()
exiting = FALSE;
cmdmod = save_cmdmod;
setcursor(); /* position cursor */
out_flush();
gui_update_screen(); /* redraw, window may show changed buffer */
}
#endif
@@ -2873,6 +2873,9 @@ button_set:
*/
if ((State == NORMAL || State == NORMAL_BUSY || (State & INSERT))
&& Y_2_ROW(y) >= topframe->fr_height
# ifdef FEAT_WINDOWS
+ firstwin->w_winrow
# endif
&& button != MOUSE_DRAG
# ifdef FEAT_MOUSESHAPE
&& !drag_status_line
@@ -4820,6 +4823,7 @@ no_console_input()
#endif
#if defined(FIND_REPLACE_DIALOG) || defined(FEAT_SUN_WORKSHOP) \
|| defined(NEED_GUI_UPDATE_SCREEN) \
|| defined(PROTO)
/*
* Update the current window and the screen.

View File

@@ -1275,18 +1275,13 @@ gui_mch_browse(int saving,
title = CONVERT_TO_UTF8(title);
# endif
/* Concatenate "initdir" and "dflt". */
/* GTK has a bug, it only works with an absolute path. */
if (initdir == NULL || *initdir == NUL)
mch_dirname(dirbuf, MAXPATHL);
else if (STRLEN(initdir) + 2 < MAXPATHL)
STRCPY(dirbuf, initdir);
else
else if (vim_FullName(initdir, dirbuf, MAXPATHL - 2, FALSE) == FAIL)
dirbuf[0] = NUL;
/* Always need a trailing slash for a directory. */
add_pathsep(dirbuf);
if (dflt != NULL && *dflt != NUL
&& STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
STRCAT(dirbuf, dflt);
/* If our pointer is currently hidden, then we should show it. */
gui_mch_mousehide(FALSE);
@@ -1341,6 +1336,11 @@ gui_mch_browse(int saving,
else
gtk_window_set_title(GTK_WINDOW(gui.filedlg), (const gchar *)title);
/* Concatenate "initdir" and "dflt". */
if (dflt != NULL && *dflt != NUL
&& STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL)
STRCAT(dirbuf, dflt);
gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg),
(const gchar *)dirbuf);
# ifndef HAVE_GTK2

View File

@@ -1463,7 +1463,7 @@ BufferDestructor(PyObject *self)
if (this->buf && this->buf != INVALID_BUFFER_VALUE)
this->buf->b_python_ref = NULL;
PyMem_DEL(self);
Py_DECREF(self);
}
static PyObject *
@@ -1674,7 +1674,7 @@ RangeNew(buf_T *buf, int start, int end)
bufr = (BufferObject *)BufferNew(buf);
if (bufr == NULL)
{
PyMem_DEL(self);
Py_DECREF(self);
return NULL;
}
Py_INCREF(bufr);
@@ -1690,7 +1690,7 @@ RangeNew(buf_T *buf, int start, int end)
RangeDestructor(PyObject *self)
{
Py_DECREF(((RangeObject *)(self))->buf);
PyMem_DEL(self);
Py_DECREF(self);
}
static PyObject *
@@ -1944,7 +1944,7 @@ WindowDestructor(PyObject *self)
if (this->win && this->win != INVALID_WINDOW_VALUE)
this->win->w_python_ref = NULL;
PyMem_DEL(self);
Py_DECREF(self);
}
static int

View File

@@ -517,7 +517,7 @@ mf_free(mfp, hp)
mf_ins_free(mfp, hp); /* put *hp in the free list */
}
#if defined(__MORPHOS__)
#if defined(__MORPHOS__) && defined(__libnix__)
/* function is missing in MorphOS libnix version */
extern unsigned long *__stdfiledes;
@@ -677,15 +677,19 @@ mf_sync(mfp, flags)
# else
# if defined(_DCC) || defined(__GNUC__) || defined(__MORPHOS__)
{
# if defined(__GNUC__) && !defined(__MORPHOS__)
# if defined(__GNUC__) && !defined(__MORPHOS__) && defined(__libnix__)
/* Have function (in libnix at least),
* but ain't got no prototype anywhere. */
extern unsigned long fdtofh(int filedescriptor);
# endif
# if !defined(__libnix__)
fflush(NULL);
# else
BPTR fh = (BPTR)fdtofh(mfp->mf_fd);
if (fh != 0)
Flush(fh);
# endif
}
# else /* assume Manx */
Flush(_devtab[mfp->mf_fd].fd);

View File

@@ -1400,8 +1400,9 @@ recover_names(fname, list, nr)
names[0] = vim_strsave((char_u *)"*.sw?");
# endif
#endif
#ifdef UNIX
/* for Unix names starting with a dot are special */
#if defined(UNIX) || defined(WIN3264)
/* For Unix names starting with a dot are special. MS-Windows
* supports this too, on some file systems. */
names[1] = vim_strsave((char_u *)".*.sw?");
names[2] = vim_strsave((char_u *)".sw?");
num_names = 3;
@@ -1430,8 +1431,9 @@ recover_names(fname, list, nr)
names[0] = concat_fnames(dir_name, (char_u *)"*.sw?", TRUE);
# endif
#endif
#ifdef UNIX
/* for Unix names starting with a dot are special */
#if defined(UNIX) || defined(WIN3264)
/* For Unix names starting with a dot are special. MS-Windows
* supports this too, on some file systems. */
names[1] = concat_fnames(dir_name, (char_u *)".*.sw?", TRUE);
names[2] = concat_fnames(dir_name, (char_u *)".sw?", TRUE);
num_names = 3;
@@ -1633,6 +1635,7 @@ swapfile_info(fname)
int fd;
struct block0 b0;
time_t x = (time_t)0;
char *p;
#ifdef UNIX
char_u uname[B0_UNAME_SIZE];
#endif
@@ -1652,8 +1655,11 @@ swapfile_info(fname)
#endif
MSG_PUTS(_(" dated: "));
x = st.st_mtime; /* Manx C can't do &st.st_mtime */
MSG_PUTS(ctime(&x)); /* includes '\n' */
p = ctime(&x); /* includes '\n' */
if (p == NULL)
MSG_PUTS("(invalid)\n");
else
MSG_PUTS(p);
}
/*
@@ -3652,6 +3658,7 @@ attention_message(buf, fname)
{
struct stat st;
time_t x, sx;
char *p;
++no_wait_return;
(void)EMSG(_("E325: ATTENTION"));
@@ -3666,7 +3673,11 @@ attention_message(buf, fname)
{
MSG_PUTS(_(" dated: "));
x = st.st_mtime; /* Manx C can't do &st.st_mtime */
MSG_PUTS(ctime(&x));
p = ctime(&x); /* includes '\n' */
if (p == NULL)
MSG_PUTS("(invalid)\n");
else
MSG_PUTS(p);
if (sx != 0 && x > sx)
MSG_PUTS(_(" NEWER than swap file!\n"));
}

View File

@@ -4124,8 +4124,6 @@ vim_snprintf(str, str_m, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
case 'c':
case 's':
length_modifier = '\0';
zero_padding = 0; /* turn zero padding off for string
conversions */
str_arg_l = 1;
switch (fmt_spec)
{

View File

@@ -8074,9 +8074,20 @@ get_lisp_indent()
}
if (*that == '"' && *(that + 1) != NUL)
{
that++;
while (*that && (*that != '"' || *(that - 1) == '\\'))
++that;
while (*++that && *that != '"')
{
/* skipping escaped characters in the string */
if (*that == '\\')
{
if (*++that == NUL)
break;
if (that[1] == NUL)
{
++that;
break;
}
}
}
}
if (*that == '(' || *that == '[')
++parencount;

View File

@@ -1229,6 +1229,94 @@ vim_strsave_escaped_ext(string, esc_chars, cc, bsl)
return escaped_string;
}
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Escape "string" for use as a shell argument with system().
* This uses single quotes, except when we know we need to use double qoutes
* (MS-DOS and MS-Windows without 'shellslash' set).
* Returns the result in allocated memory, NULL if we have run out.
*/
char_u *
vim_strsave_shellescape(string)
char_u *string;
{
unsigned length;
char_u *p;
char_u *d;
char_u *escaped_string;
/* First count the number of extra bytes required. */
length = STRLEN(string) + 3; /* two quotes and the trailing NUL */
for (p = string; *p != NUL; mb_ptr_adv(p))
{
# if defined(WIN32) || defined(WIN16) || defined(DOS)
if (!p_ssl)
{
if (*p == '"')
++length; /* " -> "" */
}
else
# endif
if (*p == '\'')
length += 3; /* ' => '\'' */
}
/* Allocate memory for the result and fill it. */
escaped_string = alloc(length);
if (escaped_string != NULL)
{
d = escaped_string;
/* add opening quote */
# if defined(WIN32) || defined(WIN16) || defined(DOS)
if (!p_ssl)
*d++ = '"';
else
# endif
*d++ = '\'';
for (p = string; *p != NUL; )
{
# if defined(WIN32) || defined(WIN16) || defined(DOS)
if (!p_ssl)
{
if (*p == '"')
{
*d++ = '"';
*d++ = '"';
++p;
continue;
}
}
else
# endif
if (*p == '\'')
{
*d++='\'';
*d++='\\';
*d++='\'';
*d++='\'';
++p;
continue;
}
MB_COPY_CHAR(p, d);
}
/* add terminating quote and finish with a NUL */
# if defined(WIN32) || defined(WIN16) || defined(DOS)
if (!p_ssl)
*d++ = '"';
else
# endif
*d++ = '\'';
*d = NUL;
}
return escaped_string;
}
#endif
/*
* Like vim_strsave(), but make all characters uppercase.
* This uses ASCII lower-to-upper case translation, language independent.

View File

@@ -1477,14 +1477,17 @@ do_pending_operator(cap, old_col, gui_yank)
}
else if (VIsual_active)
{
/* Save the current VIsual area for '< and '> marks, and "gv" */
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_mode = VIsual_mode;
curbuf->b_visual.vi_curswant = curwin->w_curswant;
if (!gui_yank)
{
/* Save the current VIsual area for '< and '> marks, and "gv" */
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_mode = VIsual_mode;
curbuf->b_visual.vi_curswant = curwin->w_curswant;
# ifdef FEAT_EVAL
curbuf->b_visual_mode_eval = VIsual_mode;
curbuf->b_visual_mode_eval = VIsual_mode;
# endif
}
/* In Select mode, a linewise selection is operated upon like a
* characterwise selection. */

View File

@@ -770,6 +770,7 @@ get_expr_line()
{
char_u *expr_copy;
char_u *rv;
static int nested = 0;
if (expr_line == NULL)
return NULL;
@@ -780,7 +781,14 @@ get_expr_line()
if (expr_copy == NULL)
return NULL;
/* When we are invoked recursively limit the evaluation to 10 levels.
* Then return the string as-is. */
if (nested >= 10)
return expr_copy;
++nested;
rv = eval_to_string(expr_copy, NULL, TRUE);
--nested;
vim_free(expr_copy);
return rv;
}

View File

@@ -1810,6 +1810,14 @@ static struct vimoption
{"open", NULL, P_BOOL|P_VI_DEF,
(char_u *)NULL, PV_NONE,
{(char_u *)FALSE, (char_u *)0L}},
{"opendevice", "odev", P_BOOL|P_VI_DEF,
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
(char_u *)&p_odev, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)FALSE, (char_u *)FALSE}
},
{"operatorfunc", "opfunc", P_STRING|P_VI_DEF|P_SECURE,
(char_u *)&p_opfunc, PV_NONE,
{(char_u *)"", (char_u *)0L} },

View File

@@ -618,6 +618,9 @@ EXTERN int p_more; /* 'more' */
#ifdef FEAT_MZSCHEME
EXTERN long p_mzq; /* 'mzquantum */
#endif
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
EXTERN int p_odev; /* 'opendevice' */
#endif
EXTERN char_u *p_opfunc; /* 'operatorfunc' */
EXTERN char_u *p_para; /* 'paragraphs' */
EXTERN int p_paste; /* 'paste' */

View File

@@ -799,7 +799,7 @@ mch_isdir(name)
/*
* Create directory "name".
*/
void
int
mch_mkdir(name)
char_u *name;
{
@@ -807,7 +807,11 @@ mch_mkdir(name)
lock = CreateDir(name);
if (lock != NULL)
{
UnLock(lock);
return 0;
}
return -1;
}
/*

View File

@@ -2702,6 +2702,12 @@ mch_nodetype(char_u *name)
HANDLE hFile;
int type;
/* We can't open a file with a name "\\.\con" or "\\.\prn" and trying to
* read from it later will cause Vim to hang. Thus return NODE_WRITABLE
* here. */
if (STRNCMP(name, "\\\\.\\", 4) == 0)
return NODE_WRITABLE;
hFile = CreateFile(name, /* file name */
GENERIC_WRITE, /* access mode */
0, /* share mode */

View File

@@ -29,6 +29,7 @@ extern char_u *vim_strsave __ARGS((char_u *string));
extern char_u *vim_strnsave __ARGS((char_u *string, int len));
extern char_u *vim_strsave_escaped __ARGS((char_u *string, char_u *esc_chars));
extern char_u *vim_strsave_escaped_ext __ARGS((char_u *string, char_u *esc_chars, int cc, int bsl));
extern char_u *vim_strsave_shellescape __ARGS((char_u *string));
extern char_u *vim_strsave_up __ARGS((char_u *string));
extern char_u *vim_strnsave_up __ARGS((char_u *string, int len));
extern void vim_strup __ARGS((char_u *p));

View File

@@ -25,7 +25,7 @@ extern long mch_getperm __ARGS((char_u *name));
extern int mch_setperm __ARGS((char_u *name, long perm));
extern void mch_hide __ARGS((char_u *name));
extern int mch_isdir __ARGS((char_u *name));
extern void mch_mkdir __ARGS((char_u *name));
extern int mch_mkdir __ARGS((char_u *name));
extern int mch_can_exe __ARGS((char_u *name));
extern int mch_nodetype __ARGS((char_u *name));
extern void mch_early_init __ARGS((void));

View File

@@ -5079,15 +5079,38 @@ screen_line(row, coloff, endcol, clear_width
* character too. If we didn't skip any blanks above, then we
* only redraw if the character wasn't already redrawn anyway.
*/
if (gui.in_use && (col > startCol || !redraw_this)
# ifdef FEAT_MBYTE
&& enc_dbcs == 0
# endif
)
if (gui.in_use && (col > startCol || !redraw_this))
{
hl = ScreenAttrs[off_to];
if (hl > HL_ALL || (hl & HL_BOLD))
screen_char(off_to - 1, row, col + coloff - 1);
{
int prev_cells = 1;
# ifdef FEAT_MBYTE
if (enc_utf8)
/* for utf-8, ScreenLines[char_offset + 1] == 0 means
* that its width is 2. */
prev_cells = ScreenLines[off_to - 1] == 0 ? 2 : 1;
else if (enc_dbcs != 0)
{
/* find previous character by counting from first
* column and get its width. */
unsigned off = LineOffset[row];
while (off < off_to)
{
prev_cells = (*mb_off2cells)(off);
off += prev_cells;
}
}
if (enc_dbcs != 0 && prev_cells > 1)
screen_char_2(off_to - prev_cells, row,
col + coloff - prev_cells);
else
# endif
screen_char(off_to - prev_cells, row,
col + coloff - prev_cells);
}
}
#endif
screen_fill(row, row + 1, col + coloff, clear_width + coloff,

View File

@@ -977,6 +977,7 @@ syn_update_ends(startofline)
{
stateitem_T *cur_si;
int i;
int seen_keepend;
if (startofline)
{
@@ -1002,7 +1003,10 @@ syn_update_ends(startofline)
/*
* Need to update the end of a start/skip/end that continues from the
* previous line. And regions that have "keepend", because they may
* influence contained items.
* influence contained items. If we've just removed "extend"
* (startofline == 0) then we should update ends of normal regions
* contained inside "keepend" because "extend" could have extended
* these "keepend" regions as well as contained normal regions.
* Then check for items ending in column 0.
*/
i = current_state.ga_len - 1;
@@ -1010,10 +1014,13 @@ syn_update_ends(startofline)
for ( ; i > keepend_level; --i)
if (CUR_STATE(i).si_flags & HL_EXTEND)
break;
seen_keepend = FALSE;
for ( ; i < current_state.ga_len; ++i)
{
cur_si = &CUR_STATE(i);
if ((cur_si->si_flags & HL_KEEPEND)
|| (seen_keepend && !startofline)
|| (i == current_state.ga_len - 1 && startofline))
{
cur_si->si_h_startpos.col = 0; /* start highl. in col 0 */
@@ -1021,6 +1028,9 @@ syn_update_ends(startofline)
if (!(cur_si->si_flags & HL_MATCHCONT))
update_si_end(cur_si, (int)current_col, !startofline);
if (!startofline && (cur_si->si_flags & HL_KEEPEND))
seen_keepend = TRUE;
}
}
check_keepend();
@@ -2564,6 +2574,7 @@ check_keepend()
{
int i;
lpos_T maxpos;
lpos_T maxpos_h;
stateitem_T *sip;
/*
@@ -2583,23 +2594,30 @@ check_keepend()
break;
maxpos.lnum = 0;
maxpos_h.lnum = 0;
for ( ; i < current_state.ga_len; ++i)
{
sip = &CUR_STATE(i);
if (maxpos.lnum != 0)
{
limit_pos_zero(&sip->si_m_endpos, &maxpos);
limit_pos_zero(&sip->si_h_endpos, &maxpos);
limit_pos_zero(&sip->si_h_endpos, &maxpos_h);
limit_pos_zero(&sip->si_eoe_pos, &maxpos);
sip->si_ends = TRUE;
}
if (sip->si_ends
&& (sip->si_flags & HL_KEEPEND)
&& (maxpos.lnum == 0
if (sip->si_ends && (sip->si_flags & HL_KEEPEND))
{
if (maxpos.lnum == 0
|| maxpos.lnum > sip->si_m_endpos.lnum
|| (maxpos.lnum == sip->si_m_endpos.lnum
&& maxpos.col > sip->si_m_endpos.col)))
maxpos = sip->si_m_endpos;
&& maxpos.col > sip->si_m_endpos.col))
maxpos = sip->si_m_endpos;
if (maxpos_h.lnum == 0
|| maxpos_h.lnum > sip->si_h_endpos.lnum
|| (maxpos_h.lnum == sip->si_h_endpos.lnum
&& maxpos_h.col > sip->si_h_endpos.col))
maxpos_h = sip->si_h_endpos;
}
}
}

View File

@@ -666,6 +666,56 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
132,
/**/
131,
/**/
130,
/**/
129,
/**/
128,
/**/
127,
/**/
126,
/**/
125,
/**/
124,
/**/
123,
/**/
122,
/**/
121,
/**/
120,
/**/
119,
/**/
118,
/**/
117,
/**/
116,
/**/
115,
/**/
114,
/**/
113,
/**/
112,
/**/
111,
/**/
110,
/**/
109,
/**/
108,
/**/
107,
/**/
@@ -945,7 +995,11 @@ list_version()
/* Only MS VC 4.1 and earlier can do Win32s */
MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
# else
# ifdef _WIN64
MSG_PUTS(_("\nMS-Windows 64 bit GUI version"));
# else
MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
# endif
# endif
if (gui_is_win32s())
MSG_PUTS(_(" in Win32s mode"));