Compare commits

...

12 Commits

Author SHA1 Message Date
Bram Moolenaar
78f6f7eb95 updated for version 7.1-026 2007-07-10 12:03:33 +00:00
Bram Moolenaar
7a42fa3cb7 updated for version 7.1-025 2007-07-10 11:28:55 +00:00
Bram Moolenaar
aec1179e5e updated for version 7.1-024 2007-07-10 11:09:36 +00:00
Bram Moolenaar
9a149791fc updated for version 7.1-023 2007-07-10 10:38:02 +00:00
Bram Moolenaar
bf44417987 updated for version 7.1-022 2007-07-07 11:58:28 +00:00
Bram Moolenaar
e2a49d8e5e updated for version 7.1-021 2007-07-06 17:43:08 +00:00
Bram Moolenaar
6a51606966 updated for version 7.1-020 2007-07-05 08:11:42 +00:00
Bram Moolenaar
3ebc1e5112 updated for version 7.1-019 2007-07-05 07:54:17 +00:00
Bram Moolenaar
e649ef0fdd updated for version 7.1-018 2007-06-28 20:18:51 +00:00
Bram Moolenaar
5386a123f5 updated for version 7.1-017 2007-06-28 20:02:32 +00:00
Bram Moolenaar
7f51474324 updated for version 7.1-016 2007-06-28 19:33:43 +00:00
Bram Moolenaar
f15f943e0c updated for version 7.1-015 2007-06-28 11:07:21 +00:00
16 changed files with 124 additions and 35 deletions

4
src/auto/configure vendored
View File

@@ -3843,7 +3843,9 @@ echo "${ECHO_T}\"no\"" >&6
fi
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
if test "x$MACOSX" = "xyes"; then
MZSCHEME_LIBS="-framework PLT_MzScheme"
elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
else
MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"

View File

@@ -423,7 +423,9 @@ if test "$enable_mzschemeinterp" = "yes"; then
fi
if test "X$vi_cv_path_mzscheme_pfx" != "X"; then
if test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
if test "x$MACOSX" = "xyes"; then
MZSCHEME_LIBS="-framework PLT_MzScheme"
elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"; then
MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme.a ${vi_cv_path_mzscheme_pfx}/lib/libmzgc.a"
else
MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc"

View File

@@ -2349,8 +2349,10 @@ keymap_init()
if (*curbuf->b_p_keymap == NUL)
{
/* Stop any active keymap and clear the table. */
/* Stop any active keymap and clear the table. Also remove
* b:keymap_unload, as no keymap is active now. */
keymap_unload();
do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
}
else
{
@@ -2500,7 +2502,6 @@ keymap_unload()
ga_clear(&curbuf->b_kmap_ga);
curbuf->b_kmap_state &= ~KEYMAP_LOADED;
do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
#ifdef FEAT_WINDOWS
status_redraw_curbuf();
#endif

View File

@@ -13925,6 +13925,8 @@ search_cmn(argvars, match_pos, flagsp)
/* If 'n' flag is used: restore cursor position. */
if (flags & SP_NOMOVE)
curwin->w_cursor = save_cursor;
else
curwin->w_set_curswant = TRUE;
theend:
p_ws = save_p_ws;

View File

@@ -2912,22 +2912,35 @@ not_writing()
}
/*
* Check if a buffer is read-only. Ask for overruling in a dialog.
* Return TRUE and give an error message when the buffer is readonly.
* Check if a buffer is read-only (either 'readonly' option is set or file is
* read-only). Ask for overruling in a dialog. Return TRUE and give an error
* message when the buffer is readonly.
*/
static int
check_readonly(forceit, buf)
int *forceit;
buf_T *buf;
{
if (!*forceit && buf->b_p_ro)
struct stat st;
/* Handle a file being readonly when the 'readonly' option is set or when
* the file exists and permissions are read-only.
* We will send 0777 to check_file_readonly(), as the "perm" variable is
* important for device checks but not here. */
if (!*forceit && (buf->b_p_ro
|| (mch_stat((char *)buf->b_ffname, &st) >= 0
&& check_file_readonly(buf->b_ffname, 0777))))
{
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
{
char_u buff[IOSIZE];
dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
if (buf->b_p_ro)
dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
buf->b_fname);
else
dialog_msg(buff, _("File permissions of \"%s\" are read-only.\nIt may still be possible to write it.\nDo you wish to try?"),
buf->b_fname);
if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) == VIM_YES)
@@ -2941,9 +2954,14 @@ check_readonly(forceit, buf)
}
else
#endif
if (buf->b_p_ro)
EMSG(_(e_readonly));
else
EMSG2(_("E505: \"%s\" is read-only (add ! to override)"),
buf->b_fname);
return TRUE;
}
return FALSE;
}

View File

@@ -2118,7 +2118,8 @@ do_one_cmd(cmdlinep, sourcing,
#ifdef FEAT_USR_CMDS
!USER_CMDIDX(ea.cmdidx) &&
#endif
cmdnames[ea.cmdidx].cmd_func == ex_ni);
(cmdnames[ea.cmdidx].cmd_func == ex_ni
|| cmdnames[ea.cmdidx].cmd_func == ex_script_ni));
#ifndef FEAT_EVAL
/*

View File

@@ -424,7 +424,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
*/
if (!p_odev && mch_nodetype(fname) == NODE_WRITABLE)
{
filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option"), 0);
filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option)"), 0);
msg_end();
msg_scroll = msg_save;
return FAIL;
@@ -2733,6 +2733,32 @@ set_file_time(fname, atime, mtime)
# define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
/*
* Return TRUE if a file appears to be read-only from the file permissions.
*/
int
check_file_readonly(fname, perm)
char_u *fname; /* full path to file */
int perm; /* known permissions on file */
{
#ifndef USE_MCH_ACCESS
int fd = 0;
#endif
return (
#ifdef USE_MCH_ACCESS
# ifdef UNIX
(perm & 0222) == 0 ||
# endif
mch_access((char *)fname, W_OK)
#else
(fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0
? TRUE : (close(fd), FALSE)
#endif
);
}
/*
* buf_write() - write to file "fname" lines "start" through "end"
*
@@ -3219,17 +3245,8 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
* Check if the file is really writable (when renaming the file to
* make a backup we won't discover it later).
*/
file_readonly = (
# ifdef USE_MCH_ACCESS
# ifdef UNIX
(perm & 0222) == 0 ||
# endif
mch_access((char *)fname, W_OK)
# else
(fd = mch_open((char *)fname, O_RDWR | O_EXTRA, 0)) < 0
? TRUE : (close(fd), FALSE)
# endif
);
file_readonly = check_file_readonly(fname, (int)perm);
if (!forceit && file_readonly)
{
if (vim_strchr(p_cpo, CPO_FWRITE) != NULL)

View File

@@ -308,6 +308,8 @@ static void (*dll_scheme_set_param)(Scheme_Config *c, int pos,
static Scheme_Config *(*dll_scheme_current_config)(void);
static Scheme_Object *(*dll_scheme_char_string_to_byte_string)
(Scheme_Object *s);
static Scheme_Object *(*dll_scheme_char_string_to_path)
(Scheme_Object *s);
# endif
/* arrays are imported directly */
@@ -398,6 +400,8 @@ static Scheme_Object *(*dll_scheme_char_string_to_byte_string)
# define scheme_current_config dll_scheme_current_config
# define scheme_char_string_to_byte_string \
dll_scheme_char_string_to_byte_string
# define scheme_char_string_to_path \
dll_scheme_char_string_to_path
# endif
typedef struct
@@ -498,6 +502,8 @@ static Thunk_Info mzsch_imports[] = {
{"scheme_current_config", (void **)&dll_scheme_current_config},
{"scheme_char_string_to_byte_string",
(void **)&dll_scheme_char_string_to_byte_string},
{"scheme_char_string_to_path",
(void **)&dll_scheme_char_string_to_path},
# endif
{NULL, NULL}};
@@ -773,7 +779,14 @@ startup_mzscheme(void)
#ifdef MZSCHEME_COLLECTS
/* setup 'current-library-collection-paths' parameter */
scheme_set_param(scheme_config, MZCONFIG_COLLECTION_PATHS,
scheme_make_pair(scheme_make_string(MZSCHEME_COLLECTS),
scheme_make_pair(
# if MZSCHEME_VERSION_MAJOR >= 299
scheme_char_string_to_path(
scheme_byte_string_to_char_string(
scheme_make_byte_string(MZSCHEME_COLLECTS))),
# else
scheme_make_string(MZSCHEME_COLLECTS),
# endif
scheme_null));
#endif
#ifdef HAVE_SANDBOX

View File

@@ -3456,11 +3456,11 @@ msg_show_console_dialog(message, buttons, dfltbutton)
/* advance to next hotkey and set default hotkey */
#ifdef FEAT_MBYTE
if (has_mbyte)
hotkp += (*mb_ptr2len)(hotkp);
hotkp += STRLEN(hotkp);
else
#endif
++hotkp;
(void)copy_char(r + 1, hotkp, TRUE);
hotkp[copy_char(r + 1, hotkp, TRUE)] = NUL;
if (dfltbutton)
--dfltbutton;
@@ -3493,7 +3493,7 @@ msg_show_console_dialog(message, buttons, dfltbutton)
*msgp++ = (dfltbutton == 1) ? ']' : ')';
/* redefine hotkey */
(void)copy_char(r, hotkp, TRUE);
hotkp[copy_char(r, hotkp, TRUE)] = NUL;
}
}
else
@@ -3519,8 +3519,6 @@ msg_show_console_dialog(message, buttons, dfltbutton)
*msgp++ = ':';
*msgp++ = ' ';
*msgp = NUL;
mb_ptr_adv(hotkp);
*hotkp = NUL;
}
else
{
@@ -3555,8 +3553,9 @@ msg_show_console_dialog(message, buttons, dfltbutton)
msgp = confirm_msg + 1 + STRLEN(message);
hotkp = hotk;
/* define first default hotkey */
(void)copy_char(buttons, hotkp, TRUE);
/* Define first default hotkey. Keep the hotkey string NUL
* terminated to avoid reading past the end. */
hotkp[copy_char(buttons, hotkp, TRUE)] = NUL;
/* Remember where the choices start, displaying starts here when
* "hotkp" typed at the more prompt. */

View File

@@ -6379,7 +6379,7 @@ nv_brackets(cap)
*/
else if (cap->nchar == 'p' || cap->nchar == 'P')
{
if (!checkclearopq(cap->oap))
if (!checkclearop(cap->oap))
{
prep_redo_cmd(cap);
do_put(cap->oap->regname,

View File

@@ -3404,7 +3404,9 @@ do_put(regname, dir, count, flags)
#ifdef FEAT_VIRTUALEDIT
col += curwin->w_cursor.coladd;
if (ve_flags == VE_ALL && curwin->w_cursor.coladd > 0)
if (ve_flags == VE_ALL
&& (curwin->w_cursor.coladd > 0
|| endcol2 == curwin->w_cursor.col))
{
if (dir == FORWARD && c == NUL)
++col;

View File

@@ -466,7 +466,7 @@ pum_set_selected(n, repeat)
set_option_value((char_u *)"bh", 0L,
(char_u *)"wipe", OPT_LOCAL);
set_option_value((char_u *)"diff", 0L,
(char_u *)"", OPT_LOCAL);
NULL, OPT_LOCAL);
}
}
if (res == OK)

View File

@@ -2,6 +2,7 @@
void filemess __ARGS((buf_T *buf, char_u *name, char_u *s, int attr));
int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T *eap, int flags));
int prep_exarg __ARGS((exarg_T *eap, buf_T *buf));
int check_file_readonly __ARGS((char_u *fname, int perm));
int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering));
void msg_add_fname __ARGS((buf_T *buf, char_u *fname));
void msg_add_lines __ARGS((int insert_space, long lnum, long nchars));

View File

@@ -2331,7 +2331,7 @@ ex_copen(eap)
set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
OPT_LOCAL);
set_option_value((char_u *)"bh", 0L, (char_u *)"wipe", OPT_LOCAL);
set_option_value((char_u *)"diff", 0L, (char_u *)"", OPT_LOCAL);
set_option_value((char_u *)"diff", 0L, NULL, OPT_LOCAL);
}
/* Only set the height when still in the same tab page and there is no

View File

@@ -573,8 +573,12 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum)
/*
* Start searching in current line, unless searching backwards and
* we're in column 0.
* If we are searching backwards, in column 0, and not including the
* current position, gain some efficiency by skipping back a line.
* Otherwise begin the search in the current line.
*/
if (dir == BACKWARD && start_pos.col == 0)
if (dir == BACKWARD && start_pos.col == 0
&& (options & SEARCH_START) == 0)
{
lnum = pos->lnum - 1;
at_first_line = FALSE;
@@ -2124,6 +2128,9 @@ findmatchlimit(oap, initc, flags, maxtravel)
else if (!backwards)
inquote = TRUE;
}
/* ml_get() only keeps one line, need to get linep again */
linep = ml_get(pos.lnum);
}
}
}
@@ -2795,7 +2802,7 @@ fwd_word(count, bigword, eol)
i = inc_cursor();
if (i == -1 || (i >= 1 && last_line)) /* started at last char in file */
return FAIL;
if (i == 1 && eol && count == 0) /* started at last char in line */
if (i >= 1 && eol && count == 0) /* started at last char in line */
return OK;
/*

View File

@@ -666,6 +666,30 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
26,
/**/
25,
/**/
24,
/**/
23,
/**/
22,
/**/
21,
/**/
20,
/**/
19,
/**/
18,
/**/
17,
/**/
16,
/**/
15,
/**/
14,
/**/