1
0
forked from aniani/vim

updated for version 7.0082

This commit is contained in:
Bram Moolenaar
2005-06-07 21:12:49 +00:00
parent 82cf9b6851
commit 0e4d877ed8
7 changed files with 194 additions and 54 deletions

View File

@@ -7931,7 +7931,7 @@ f_filereadable(argvars, rettv)
}
/*
* return 0 for not writable, 1 for writable file, 2 for a dir which we have
* Return 0 for not writable, 1 for writable file, 2 for a dir which we have
* rights to write into.
*/
static void
@@ -7939,34 +7939,7 @@ f_filewritable(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
char_u *p;
int retval = 0;
#if defined(UNIX) || defined(VMS)
int perm = 0;
#endif
p = get_tv_string(&argvars[0]);
#if defined(UNIX) || defined(VMS)
perm = mch_getperm(p);
#endif
#ifndef MACOS_CLASSIC /* TODO: get either mch_writable or mch_access */
if (
# ifdef WIN3264
mch_writable(p) &&
# else
# if defined(UNIX) || defined(VMS)
(perm & 0222) &&
# endif
# endif
mch_access((char *)p, W_OK) == 0
)
#endif
{
++retval;
if (mch_isdir(p))
++retval;
}
rettv->vval.v_number = retval;
rettv->vval.v_number = filewritable(get_tv_string(&argvars[0]));
}
static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int dir));
@@ -9491,6 +9464,9 @@ f_has(argvars, rettv)
#ifdef FEAT_NETBEANS_INTG
"netbeans_intg",
#endif
#ifdef FEAT_SYN_HL
"spell",
#endif
#ifdef FEAT_SYN_HL
"syntax",
#endif

View File

@@ -2433,7 +2433,7 @@ do_write(eap)
{
/* Overwriting a file that is loaded in another buffer is not a
* good idea. */
EMSG(_("E139: File is loaded in another buffer"));
EMSG(_(e_bufloaded));
goto theend;
}
}
@@ -2591,7 +2591,7 @@ check_overwrite(eap, buf, fname, ffname, other)
{
char_u buff[IOSIZE];
dialog_msg(buff, _("Overwrite existing file \"%.*s\"?"), fname);
dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
return FAIL;
eap->forceit = TRUE;
@@ -2721,7 +2721,7 @@ check_readonly(forceit, buf)
{
char_u buff[IOSIZE];
dialog_msg(buff, _("'readonly' option is set for \"%.*s\".\nDo you wish to write anyway?"),
dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
buf->b_fname);
if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) == VIM_YES)

View File

@@ -757,6 +757,10 @@ EX(CMD_sort, "sort", ex_sort,
RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY),
EX(CMD_split, "split", ex_splitview,
BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_spellgood, "spellgood", ex_spell,
NEEDARG|EXTRA|TRLBAR),
EX(CMD_spellwrong, "spellwrong", ex_spell,
NEEDARG|EXTRA|TRLBAR),
EX(CMD_sprevious, "sprevious", ex_previous,
EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
EX(CMD_srewind, "srewind", ex_rewind,

View File

@@ -92,4 +92,5 @@ int get_user_name __ARGS((char_u *buf, int len));
void sort_strings __ARGS((char_u **files, int count));
int pathcmp __ARGS((const char *p, const char *q, int maxlen));
char_u *parse_list_options __ARGS((char_u *option_str, option_table_T *table, int table_size));
int filewritable __ARGS((char_u *fname));
/* vim: set ft=c : */