updated for version 7.0168
diff --git a/src/feature.h b/src/feature.h
index 6abc0ed..69a784e 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -972,7 +972,7 @@
* +mouse Any mouse support (any of the above enabled).
*/
/* OS/2 and Amiga console have no mouse support */
-#if (!defined(AMIGA) && !defined(OS2) && !defined(MACOS))
+#if !defined(AMIGA) && !defined(OS2)
# ifdef FEAT_NORMAL
# define FEAT_MOUSE_XTERM
# endif
diff --git a/src/fileio.c b/src/fileio.c
index a573a5b..4c415ab 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -556,7 +556,11 @@
if (!bt_dontwrite(curbuf))
#endif
check_need_swap(newfile);
- filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
+ if (dir_of_file_exists(fname))
+ filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
+ else
+ filemess(curbuf, sfname,
+ (char_u *)_("[New DIRECTORY]"), 0);
#ifdef FEAT_VIMINFO
/* Even though this is a new file, it might have been
* edited before and deleted. Get the old marks. */
diff --git a/src/normal.c b/src/normal.c
index 71eefc4..346cc8b 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -32,6 +32,7 @@
nv_compare __ARGS((const void *s1, const void *s2));
static int find_command __ARGS((int cmdchar));
static void op_colon __ARGS((oparg_T *oap));
+static void op_function __ARGS((oparg_T *oap));
#if defined(FEAT_MOUSE) && defined(FEAT_VISUAL)
static void find_start_of_word __ARGS((pos_T *));
static void find_end_of_word __ARGS((pos_T *));
@@ -1696,6 +1697,7 @@
}
redo_VIsual_busy = FALSE;
+
/*
* Switch Visual off now, so screen updating does
* not show inverted text when the screen is redrawn.
@@ -1718,6 +1720,7 @@
#endif
if ((oap->op_type == OP_YANK
|| oap->op_type == OP_COLON
+ || oap->op_type == OP_FUNCTION
|| oap->op_type == OP_FILTER)
&& oap->motion_force == NUL)
redraw_curbuf_later(INVERTED);
@@ -1940,6 +1943,10 @@
op_format(oap, TRUE); /* use internal function */
break;
+ case OP_FUNCTION:
+ op_function(oap); /* call 'operatorfunc' */
+ break;
+
case OP_INSERT:
case OP_APPEND:
#ifdef FEAT_VISUAL
@@ -2100,6 +2107,40 @@
*/
}
+/*
+ * Handle the "gy" operator: call 'operatorfunc'.
+ */
+ void
+op_function(oap)
+ oparg_T *oap;
+{
+#ifdef FEAT_EVAL
+ char_u *(argv[1]);
+
+ if (*p_opfunc == NUL)
+ EMSG(_("E774: 'operatorfunc' is empty"));
+ else
+ {
+ /* Set '[ and '] marks to text to be operated on. */
+ curbuf->b_op_start = oap->start;
+ curbuf->b_op_end = oap->end;
+ if (oap->motion_type != MLINE && !oap->inclusive)
+ /* Exclude the end position. */
+ decl(&curbuf->b_op_end);
+
+ if (oap->block_mode)
+ argv[0] = (char_u *)"block";
+ else if (oap->motion_type == MLINE)
+ argv[0] = (char_u *)"line";
+ else
+ argv[0] = (char_u *)"char";
+ (void)call_func_retnr(p_opfunc, 1, argv, FALSE);
+ }
+#else
+ EMSG(_("E775: Eval feature not available"));
+#endif
+}
+
#if defined(FEAT_MOUSE) || defined(PROTO)
/*
* Do the appropriate action for the current mouse click in the current mode.
@@ -7660,6 +7701,7 @@
* "gu" Change text to lower case.
* "gU" Change text to upper case.
* "g?" rot13 encoding
+ * "gy" call 'operatorfunc'
*/
case 'q':
case 'w':
@@ -7669,6 +7711,7 @@
case 'u':
case 'U':
case '?':
+ case 'y':
nv_operator(cap);
break;
diff --git a/src/os_unix.c b/src/os_unix.c
index 4535aef..89c420d 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3970,14 +3970,25 @@
{
/*
* Check if keys have been typed, write them to the child
- * if there are any. Don't do this if we are expanding
- * wild cards (would eat typeahead). Don't get extra
- * characters when we already have one.
+ * if there are any.
+ * Don't do this if we are expanding wild cards (would eat
+ * typeahead).
+ * Don't do this when filtering and terminal is in cooked
+ * mode, the shell command will handle the I/O. Avoids
+ * that a typed password is echoed for ssh or gpg command.
+ * Don't get extra characters when we already have one.
* Don't read characters unless we didn't get output for a
* while, avoids that ":r !ls" eats typeahead.
*/
len = 0;
if (!(options & SHELL_EXPAND)
+ && ((options &
+ (SHELL_READ|SHELL_WRITE|SHELL_COOKED))
+ != (SHELL_READ|SHELL_WRITE|SHELL_COOKED)
+#ifdef FEAT_GUI
+ || gui.in_use
+#endif
+ )
&& (ta_len > 0
|| (noread_cnt > 4
&& (len = ui_inchar(ta_buf,
diff --git a/src/spell.c b/src/spell.c
index c3f4698..303ed58 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -7703,7 +7703,6 @@
FILE *fd;
buf_T *buf = NULL;
int new_spf = FALSE;
- struct stat st;
char_u *fname;
char_u fnamebuf[MAXPATHL];
char_u line[MAXWLEN * 2];
@@ -7797,9 +7796,7 @@
/* We just initialized the 'spellfile' option and can't open the file.
* We may need to create the "spell" directory first. We already
* checked the runtime directory is writable in init_spellfile(). */
- STRCPY(NameBuff, fname);
- *gettail_sep(NameBuff) = NUL;
- if (mch_stat((char *)NameBuff, &st) < 0)
+ if (!dir_of_file_exists(fname))
{
/* The directory doesn't exist. Try creating it and opening the
* file again. */
diff --git a/src/vim.h b/src/vim.h
index ec69431..273d10f 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1201,6 +1201,7 @@
#define OP_FOLDDEL 24 /* "zd" delete folds */
#define OP_FOLDDELREC 25 /* "zD" delete folds recursively */
#define OP_FORMAT2 26 /* "gw" format operator, keeps cursor pos */
+#define OP_FUNCTION 27 /* "gy" call 'operatorfunc' */
/*
* Motion types, used for operators and for yank/delete registers.
diff --git a/src/window.c b/src/window.c
index 85bc22a..7d50180 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4765,7 +4765,7 @@
}
/*
- * Get absolute file name into buffer 'buf' of length 'len' bytes.
+ * Get absolute file name into buffer "buf[len]".
*
* return FAIL for failure, OK otherwise
*/
@@ -4773,7 +4773,7 @@
vim_FullName(fname, buf, len, force)
char_u *fname, *buf;
int len;
- int force;
+ int force; /* force expansion even when already absolute */
{
int retval = OK;
int url;