Compare commits

...

8 Commits

Author SHA1 Message Date
Bram Moolenaar
5fdec47ab0 updated for version 7.1-034 2007-07-24 08:45:13 +00:00
Bram Moolenaar
9cffde9627 updated for version 7.1-033 2007-07-24 07:51:18 +00:00
Bram Moolenaar
5f2c5dbd86 updated for version 7.1-032 2007-07-17 16:15:36 +00:00
Bram Moolenaar
477933cdc3 updated for version 7.1-031 2007-07-17 14:32:23 +00:00
Bram Moolenaar
1315349f0e updated for version 7.1-030 2007-07-17 12:33:46 +00:00
Bram Moolenaar
7bb755519e updated for version 7.1-029 2007-07-16 18:39:49 +00:00
Bram Moolenaar
1256e720f5 updated for version 7.1-028 2007-07-10 15:26:20 +00:00
Bram Moolenaar
fe1c56d6ae updated for version 7.1-027 2007-07-10 15:10:54 +00:00
12 changed files with 122 additions and 37 deletions

View File

@@ -1571,6 +1571,10 @@ found here: |sort()|.
in their original order, right before the sorted
lines.
If {pattern} is empty (e.g. // is specified), the
last search pattern is used. This allows trying out
a pattern first.
Note that using ":sort" with ":global" doesn't sort the matching lines, it's
quite useless.

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.1. Last change: 2007 Jun 09
*eval.txt* For Vim version 7.1. Last change: 2007 Jul 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2020,6 +2020,10 @@ col({expr}) The result is a Number, which is the byte index of the column
number of characters in the cursor line plus one)
'x position of mark x (if the mark is not set, 0 is
returned)
Additionally {expr} can be [lnum, col]: a |List| with the line
and column number. Most useful when the column is "$", to get
the las column of a specific line. When "lnum" or "col" is
out of range then col() returns zero.
To get the line number use |line()|. To get both use
|getpos()|.
For the screen column position use |virtcol()|.
@@ -5024,14 +5028,12 @@ virtcol({expr}) *virtcol()*
position, the returned Number will be the column at the end of
the <Tab>. For example, for a <Tab> in column 1, with 'ts'
set to 8, it returns 8.
For the use of {expr} see |col()|. Additionally you can use
[lnum, col]: a |List| with the line and column number. When
"lnum" or "col" is out of range then virtcol() returns zero.
When 'virtualedit' is used it can be [lnum, col, off], where
For the byte position use |col()|.
For the use of {expr} see |col()|.
When 'virtualedit' is used {expr} can be [lnum, col, off], where
"off" is the offset in screen columns from the start of the
character. E.g., a position within a <Tab> or after the last
character.
For the byte position use |col()|.
When Virtual editing is active in the current mode, a position
beyond the end of the line can be returned. |'virtualedit'|
The accepted positions are:

View File

@@ -672,7 +672,7 @@ static void f_winwidth __ARGS((typval_T *argvars, typval_T *rettv));
static void f_writefile __ARGS((typval_T *argvars, typval_T *rettv));
static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump));
static pos_T *var2fpos __ARGS((typval_T *varp, int lnum, int *fnum));
static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum));
static int get_env_len __ARGS((char_u **arg));
static int get_id_len __ARGS((char_u **arg));
static int get_name_len __ARGS((char_u **arg, char_u **alias, int evaluate, int verbose));
@@ -992,20 +992,20 @@ var_redir_str(value, value_len)
char_u *value;
int value_len;
{
size_t len;
int len;
if (redir_lval == NULL)
return;
if (value_len == -1)
len = STRLEN(value); /* Append the entire string */
len = (int)STRLEN(value); /* Append the entire string */
else
len = value_len; /* Append only "value_len" characters */
len = value_len; /* Append only "value_len" characters */
if (ga_grow(&redir_ga, (int)len) == OK)
if (ga_grow(&redir_ga, len) == OK)
{
mch_memmove((char *)redir_ga.ga_data + redir_ga.ga_len, value, len);
redir_ga.ga_len += (int)len;
redir_ga.ga_len += len;
}
else
var_redir_stop();
@@ -16505,9 +16505,9 @@ f_writefile(argvars, rettv)
* Returns NULL when there is an error.
*/
static pos_T *
var2fpos(varp, lnum, fnum)
var2fpos(varp, dollar_lnum, fnum)
typval_T *varp;
int lnum; /* TRUE when $ is last line */
int dollar_lnum; /* TRUE when $ is last line */
int *fnum; /* set to fnum for '0, 'A, etc. */
{
char_u *name;
@@ -16520,6 +16520,7 @@ var2fpos(varp, lnum, fnum)
list_T *l;
int len;
int error = FALSE;
listitem_T *li;
l = varp->vval.v_list;
if (l == NULL)
@@ -16535,6 +16536,14 @@ var2fpos(varp, lnum, fnum)
if (error)
return NULL;
len = (long)STRLEN(ml_get(pos.lnum));
/* We accept "$" for the column number: last column. */
li = list_find(l, 1L);
if (li != NULL && li->li_tv.v_type == VAR_STRING
&& li->li_tv.vval.v_string != NULL
&& STRCMP(li->li_tv.vval.v_string, "$") == 0)
pos.col = len + 1;
/* Accept a position up to the NUL after the line. */
if (pos.col == 0 || (int)pos.col > len + 1)
return NULL; /* invalid column number */
@@ -16567,7 +16576,7 @@ var2fpos(varp, lnum, fnum)
pos.coladd = 0;
#endif
if (name[0] == 'w' && lnum)
if (name[0] == 'w' && dollar_lnum)
{
pos.col = 0;
if (name[1] == '0') /* "w0": first visible line */
@@ -16585,7 +16594,7 @@ var2fpos(varp, lnum, fnum)
}
else if (name[0] == '$') /* last column or line */
{
if (lnum)
if (dollar_lnum)
{
pos.lnum = curbuf->b_ml.ml_line_count;
pos.col = 0;

View File

@@ -408,7 +408,11 @@ ex_sort(eap)
goto sortend;
}
*s = NUL;
regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
/* Use last search pattern if sort pattern is empty. */
if (s == p + 1 && last_search_pat() != NULL)
regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC);
else
regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC);
if (regmatch.regprog == NULL)
goto sortend;
p = s; /* continue after the regexp */

View File

@@ -133,6 +133,7 @@ static linenr_T get_address __ARGS((char_u **, int skip, int to_other_file));
static void get_flags __ARGS((exarg_T *eap));
#if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \
|| !defined(FEAT_RUBY) || !defined(FEAT_MZSCHEME)
# define HAVE_EX_SCRIPT_NI
static void ex_script_ni __ARGS((exarg_T *eap));
#endif
static char_u *invalid_range __ARGS((exarg_T *eap));
@@ -2119,7 +2120,10 @@ do_one_cmd(cmdlinep, sourcing,
!USER_CMDIDX(ea.cmdidx) &&
#endif
(cmdnames[ea.cmdidx].cmd_func == ex_ni
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni));
#ifdef HAVE_EX_SCRIPT_NI
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni
#endif
));
#ifndef FEAT_EVAL
/*
@@ -3998,8 +4002,7 @@ ex_ni(eap)
eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version");
}
#if !defined(FEAT_PERL) || !defined(FEAT_PYTHON) || !defined(FEAT_TCL) \
|| !defined(FEAT_RUBY) || !defined(FEAT_MZSCHEME)
#ifdef HAVE_EX_SCRIPT_NI
/*
* Function called for script command which is Not Implemented. NI!
* Skips over ":perl <<EOF" constructs.

View File

@@ -484,7 +484,8 @@ getcmdline(firstc, count, indent)
if (xpc.xp_context == EXPAND_MENUNAMES && p_wmnu)
{
/* Hitting <Down> after "emenu Name.": complete submenu */
if (ccline.cmdbuff[ccline.cmdpos - 1] == '.' && c == K_DOWN)
if (c == K_DOWN && ccline.cmdpos > 0
&& ccline.cmdbuff[ccline.cmdpos - 1] == '.')
c = p_wc;
else if (c == K_UP)
{
@@ -533,9 +534,11 @@ getcmdline(firstc, count, indent)
upseg[3] = PATHSEP;
upseg[4] = NUL;
if (ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
&& c == K_DOWN
&& (ccline.cmdbuff[ccline.cmdpos - 2] != '.'
if (c == K_DOWN
&& ccline.cmdpos > 0
&& ccline.cmdbuff[ccline.cmdpos - 1] == PATHSEP
&& (ccline.cmdpos < 3
|| ccline.cmdbuff[ccline.cmdpos - 2] != '.'
|| ccline.cmdbuff[ccline.cmdpos - 3] != '.'))
{
/* go down a directory */
@@ -730,8 +733,8 @@ getcmdline(firstc, count, indent)
/* In Ex mode a backslash escapes a newline. */
if (exmode_active
&& c != ESC
&& ccline.cmdpos > 0
&& ccline.cmdpos == ccline.cmdlen
&& ccline.cmdpos > 0
&& ccline.cmdbuff[ccline.cmdpos - 1] == '\\')
{
if (c == K_KENTER)

View File

@@ -44,6 +44,10 @@
/* Is there any system that doesn't have access()? */
#define USE_MCH_ACCESS
#if defined(sun) && defined(S_ISCHR)
# define OPEN_CHR_FILES
static int is_dev_fd_file(char_u *fname);
#endif
#ifdef FEAT_MBYTE
static char_u *next_fenc __ARGS((char_u **pp));
# ifdef FEAT_EVAL
@@ -405,6 +409,10 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
# endif
# ifdef S_ISSOCK
&& !S_ISSOCK(perm) /* ... or socket */
# endif
# ifdef OPEN_CHR_FILES
&& !(S_ISCHR(perm) && is_dev_fd_file(fname))
/* ... or a character special file named /dev/fd/<n> */
# endif
)
{
@@ -2265,6 +2273,13 @@ failed:
}
# endif
# endif
# ifdef OPEN_CHR_FILES
if (S_ISCHR(perm)) /* or character special */
{
STRCAT(IObuff, _("[character special]"));
c = TRUE;
}
# endif
#endif
if (curbuf->b_p_ro)
{
@@ -2464,6 +2479,25 @@ failed:
return OK;
}
#ifdef OPEN_CHR_FILES
/*
* Returns TRUE if the file name argument is of the form "/dev/fd/\d\+",
* which is the name of files used for process substitution output by
* some shells on some operating systems, e.g., bash on SunOS.
* Do not accept "/dev/fd/[012]", opening these may hang Vim.
*/
static int
is_dev_fd_file(fname)
char_u *fname;
{
return (STRNCMP(fname, "/dev/fd/", 8) == 0
&& VIM_ISDIGIT(fname[8])
&& *skipdigits(fname + 9) == NUL
&& (fname[9] != NUL
|| (fname[8] != '0' && fname[8] != '1' && fname[8] != '2')));
}
#endif
#ifdef FEAT_MBYTE
/*

View File

@@ -10624,6 +10624,9 @@ save_file_ff(buf)
file_ff_differs(buf)
buf_T *buf;
{
/* In a buffer that was never loaded the options are not valid. */
if (buf->b_flags & BF_NEVERLOADED)
return FALSE;
if ((buf->b_flags & BF_NEW)
&& buf->b_ml.ml_line_count == 1
&& *ml_get_buf(buf, (linenr_T)1, FALSE) == NUL)

View File

@@ -508,6 +508,9 @@ int mch_rename __ARGS((const char *src, const char *dest));
#if !defined(S_ISFIFO) && defined(S_IFIFO)
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#endif
#if !defined(S_ISCHR) && defined(S_IFCHR)
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
/* Note: Some systems need both string.h and strings.h (Savage). However,
* some systems can't handle both, only use string.h in that case. */

View File

@@ -7829,7 +7829,7 @@ put_bytes(fd, nr, len)
# if (_MSC_VER <= 1200)
/* This line is required for VC6 without the service pack. Also see the
* matching #pragma below. */
/* # pragma optimize("", off) */
# pragma optimize("", off)
# endif
#endif
@@ -7859,7 +7859,7 @@ put_sugtime(spin, fd)
#ifdef _MSC_VER
# if (_MSC_VER <= 1200)
/* # pragma optimize("", on) */
# pragma optimize("", on)
# endif
#endif

View File

@@ -666,6 +666,22 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
34,
/**/
33,
/**/
32,
/**/
31,
/**/
30,
/**/
29,
/**/
28,
/**/
27,
/**/
26,
/**/

View File

@@ -39,18 +39,22 @@ export TUTORCOPY
# remove the copy of the tutor on exit
trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
# Vim could be called "vim" or "vi". Also check for "vim6", for people who
# have Vim 5.x installed as "vim" and Vim 6.0 as "vim6".
testvim=`which vim6 2>/dev/null`
if test -f "$testvim"; then
VIM=vim6
else
testvim=`which vim`
# Vim could be called "vim" or "vi". Also check for "vimN", for people who
# have Vim installed with its version number.
# We anticipate up to a future Vim 8 version :-).
seq="vim vim8 vim75 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
for i in $seq; do
testvim=`which $i 2>/dev/null`
if test -f "$testvim"; then
VIM=vim
else
VIM=vi
VIM=$i
break
fi
done
# When no Vim version was found fall back to "vim", you'll get an error message
# below.
if test -z "$VIM"; then
VIM=vim
fi
# Use Vim to copy the tutor, it knows the value of $VIMRUNTIME