aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/CMakeLists.txt2
-rw-r--r--src/nvim/api/private/helpers.c6
-rw-r--r--src/nvim/buffer.c43
-rw-r--r--src/nvim/edit.c7
-rw-r--r--src/nvim/eval.c36
-rw-r--r--src/nvim/eval.lua2
-rw-r--r--src/nvim/ex_cmds.c8
-rw-r--r--src/nvim/ex_docmd.c10
-rw-r--r--src/nvim/hardcopy.c2
-rw-r--r--src/nvim/main.c8
-rw-r--r--src/nvim/mbyte.c2
-rw-r--r--src/nvim/path.c33
-rw-r--r--src/nvim/po/eo.po15
-rw-r--r--src/nvim/po/fr.po12
-rw-r--r--src/nvim/terminal.c2
-rw-r--r--src/nvim/testdir/test_alot.vim1
-rw-r--r--src/nvim/testdir/test_cmdline.vim44
-rw-r--r--src/nvim/testdir/test_ex_undo.vim19
-rw-r--r--src/nvim/testdir/test_syn_attr.vim8
-rw-r--r--src/nvim/ui.c8
-rw-r--r--src/nvim/version.c14
-rw-r--r--src/nvim/window.c2
22 files changed, 194 insertions, 90 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 59582d0734..cbea6a05c9 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -156,7 +156,7 @@ foreach(sfile ${NEOVIM_SOURCES}
${GENERATED_API_DISPATCH})
get_filename_component(full_d ${sfile} PATH)
file(RELATIVE_PATH d "${PROJECT_SOURCE_DIR}/src/nvim" "${full_d}")
- if(${d} MATCHES "^[.][.]")
+ if(${d} MATCHES "^([.][.]|auto/)")
file(RELATIVE_PATH d "${GENERATED_DIR}" "${full_d}")
endif()
get_filename_component(f ${sfile} NAME)
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index fc114bae16..d80ee7dc67 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -368,11 +368,10 @@ static inline void typval_encode_list_start(EncodedData *const edata,
const size_t len)
FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_NONNULL_ALL
{
- const Object obj = OBJECT_INIT;
kv_push(edata->stack, ARRAY_OBJ(((Array) {
.capacity = len,
.size = 0,
- .items = xmalloc(len * sizeof(*obj.data.array.items)),
+ .items = xmalloc(len * sizeof(*((Object *)NULL)->data.array.items)),
})));
}
@@ -409,11 +408,10 @@ static inline void typval_encode_dict_start(EncodedData *const edata,
const size_t len)
FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_NONNULL_ALL
{
- const Object obj = OBJECT_INIT;
kv_push(edata->stack, DICTIONARY_OBJ(((Dictionary) {
.capacity = len,
.size = 0,
- .items = xmalloc(len * sizeof(*obj.data.dictionary.items)),
+ .items = xmalloc(len * sizeof(*((Object *)NULL)->data.dictionary.items)),
})));
}
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index b42ad1c18a..5fb011885e 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -276,30 +276,25 @@ bool buf_valid(buf_T *buf)
return false;
}
-/*
- * Close the link to a buffer.
- * "action" is used when there is no longer a window for the buffer.
- * It can be:
- * 0 buffer becomes hidden
- * DOBUF_UNLOAD buffer is unloaded
- * DOBUF_DELETE buffer is unloaded and removed from buffer list
- * DOBUF_WIPE buffer is unloaded and really deleted
- * When doing all but the first one on the current buffer, the caller should
- * get a new buffer very soon!
- *
- * The 'bufhidden' option can force freeing and deleting.
- *
- * When "abort_if_last" is TRUE then do not close the buffer if autocommands
- * cause there to be only one window with this buffer. e.g. when ":quit" is
- * supposed to close the window but autocommands close all other windows.
- */
-void
-close_buffer (
- win_T *win, /* if not NULL, set b_last_cursor */
- buf_T *buf,
- int action,
- int abort_if_last
-)
+/// Close the link to a buffer.
+///
+/// @param win If not NULL, set b_last_cursor.
+/// @param buf
+/// @param action Used when there is no longer a window for the buffer.
+/// Possible values:
+/// 0 buffer becomes hidden
+/// DOBUF_UNLOAD buffer is unloaded
+/// DOBUF_DELETE buffer is unloaded and removed from buffer list
+/// DOBUF_WIPE buffer is unloaded and really deleted
+/// When doing all but the first one on the current buffer, the
+/// caller should get a new buffer very soon!
+/// The 'bufhidden' option can force freeing and deleting.
+/// @param abort_if_last
+/// If TRUE, do not close the buffer if autocommands cause
+/// there to be only one window with this buffer. e.g. when
+/// ":quit" is supposed to close the window but autocommands
+/// close all other windows.
+void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last)
{
bool unload_buf = (action != 0);
bool del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 892748ff5c..51c9fb1556 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1286,10 +1286,9 @@ bool edit(int cmdchar, bool startln, long count)
{
if (curbuf->terminal) {
if (ex_normal_busy) {
- // don't enter terminal mode from `ex_normal`, which can result in all
- // kinds of havoc(such as terminal mode recursiveness). Instead, set a
- // flag that allow us to force-set the value of `restart_edit` before
- // `ex_normal` returns
+ // Do not enter terminal mode from ex_normal(), which would cause havoc
+ // (such as terminal-mode recursiveness). Instead set a flag to force-set
+ // the value of `restart_edit` before `ex_normal` returns.
restart_edit = 'i';
force_restart_edit = true;
} else {
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index a8b6a3ac95..cae032f437 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -405,7 +405,7 @@ typedef struct {
LibuvProcess uv;
PtyProcess pty;
} proc;
- Stream in, out, err;
+ Stream in, out, err; // Initialized in common_job_start().
Terminal *term;
bool stopped;
bool exited;
@@ -9668,13 +9668,23 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
char_u *pat;
expand_T xpc;
+ bool filtered = false;
int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH
| WILD_NO_BEEP;
+ if (argvars[2].v_type != VAR_UNKNOWN) {
+ filtered = get_tv_number_chk(&argvars[2], NULL);
+ }
+
if (p_wic) {
options |= WILD_ICASE;
}
+ // For filtered results, 'wildignore' is used
+ if (!filtered) {
+ options |= WILD_KEEP_ALL;
+ }
+
ExpandInit(&xpc);
xpc.xp_pattern = get_tv_string(&argvars[0]);
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
@@ -9693,6 +9703,16 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
}
+ if (xpc.xp_context == EXPAND_CSCOPE) {
+ set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope);
+ xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
+ }
+
+ if (xpc.xp_context == EXPAND_SIGN) {
+ set_context_in_sign_cmd(&xpc, xpc.xp_pattern);
+ xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
+ }
+
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
rettv_list_alloc(rettv);
if (pat != NULL) {
@@ -21763,7 +21783,7 @@ static inline TerminalJobData *common_job_init(char **argv,
if (!pty) {
proc->err = &data->err;
}
- proc->cb = on_process_exit;
+ proc->cb = eval_job_process_exit_cb;
proc->events = data->events;
proc->detach = detach;
proc->cwd = cwd;
@@ -21947,7 +21967,7 @@ static void on_job_output(Stream *stream, TerminalJobData *data, RBuffer *buf,
rbuffer_consumed(buf, count);
}
-static void on_process_exit(Process *proc, int status, void *d)
+static void eval_job_process_exit_cb(Process *proc, int status, void *d)
{
TerminalJobData *data = d;
if (data->term && !data->exited) {
@@ -21971,9 +21991,15 @@ static void on_process_exit(Process *proc, int status, void *d)
static void term_write(char *buf, size_t size, void *d)
{
- TerminalJobData *data = d;
+ TerminalJobData *job = d;
+ if (job->in.closed) {
+ // If the backing stream was closed abruptly, there may be write events
+ // ahead of the terminal close event. Just ignore the writes.
+ ILOG("write failed: stream is closed");
+ return;
+ }
WBuffer *wbuf = wstream_new_buffer(xmemdup(buf, size), size, 1, xfree);
- wstream_write(&data->in, wbuf);
+ wstream_write(&job->in, wbuf);
}
static void term_resize(uint16_t width, uint16_t height, void *d)
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index c4a2a9adfc..eaaee81533 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -115,7 +115,7 @@ return {
getcmdpos={},
getcmdtype={},
getcmdwintype={},
- getcompletion={args=2},
+ getcompletion={args={2, 3}},
getcurpos={},
getcwd={args={0,2}},
getfontname={args={0, 1}},
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 0226499e78..6205daf0cb 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -2116,6 +2116,14 @@ do_ecmd (
}
}
+ // Re-editing a terminal buffer: skip most buffer re-initialization.
+ if (!other_file && curbuf->terminal) {
+ check_arg_idx(curwin); // Needed when called from do_argfile().
+ maketitle(); // Title may show the arg index, e.g. "(2 of 5)".
+ retval = OK;
+ goto theend;
+ }
+
/*
* if the file was changed we may not be allowed to abandon it
* - if we are going to re-edit the same file
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 45407b7f12..9f83688e1e 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6726,11 +6726,6 @@ do_exedit (
old_curwin == NULL ? curwin : NULL);
} else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|| *eap->arg != NUL) {
- // ":edit <blank>" is a no-op in terminal buffers. #2822
- if (curbuf->terminal != NULL && eap->cmdidx == CMD_edit && *eap->arg == NUL) {
- return;
- }
-
/* Can't edit another file when "curbuf_lock" is set. Only ":edit"
* can bring us here, others are stopped earlier. */
if (*eap->arg != NUL && curbuf_locked())
@@ -7921,9 +7916,8 @@ static void ex_normal(exarg_T *eap)
if (force_restart_edit) {
force_restart_edit = false;
} else {
- // some function called was aware of ex_normal and decided to override the
- // value of restart_edit anyway. So far only used in terminal mode(see
- // terminal_enter() in edit.c)
+ // Some function (terminal_enter()) was aware of ex_normal and decided to
+ // override the value of restart_edit anyway.
restart_edit = save_restart_edit;
}
p_im = save_insertmode;
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 7d4bfd0290..6acf7f395a 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -2105,7 +2105,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
props = enc_canon_props(p_encoding);
if (!(props & ENC_8BIT) && ((*p_pmcs != NUL) || !(props & ENC_UNICODE))) {
p_mbenc_first = NULL;
- int effective_cmap;
+ int effective_cmap = 0;
for (cmap = 0; cmap < (int)ARRAY_SIZE(prt_ps_mbfonts); cmap++)
if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap],
&p_mbenc)) {
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 005f4dcc77..793babd4e5 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -320,14 +320,18 @@ int main(int argc, char **argv)
// open terminals when opening files that start with term://
#define PROTO "term://"
+ do_cmdline_cmd("augroup nvim_terminal");
+ do_cmdline_cmd("autocmd!");
do_cmdline_cmd("autocmd BufReadCmd " PROTO "* nested "
- ":call termopen( "
+ ":if !exists('b:term_title')|call termopen( "
// Capture the command string
"matchstr(expand(\"<amatch>\"), "
"'\\c\\m" PROTO "\\%(.\\{-}//\\%(\\d\\+:\\)\\?\\)\\?\\zs.*'), "
// capture the working directory
"{'cwd': get(matchlist(expand(\"<amatch>\"), "
- "'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, '')})");
+ "'\\c\\m" PROTO "\\(.\\{-}\\)//'), 1, '')})"
+ "|endif");
+ do_cmdline_cmd("augroup END");
#undef PROTO
/* Execute --cmd arguments. */
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index c08b9e8fcf..e6312f9c00 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -1724,7 +1724,7 @@ int utf_class(int c)
return 2;
}
-int utf_ambiguous_width(int c)
+bool utf_ambiguous_width(int c)
{
return c >= 0x80 && (intable(ambiguous, ARRAY_SIZE(ambiguous), c)
|| intable(emoji_all, ARRAY_SIZE(emoji_all), c));
diff --git a/src/nvim/path.c b/src/nvim/path.c
index a79b7139f1..6149e1ab99 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -903,17 +903,30 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern)
/* Shorten the filename while maintaining its uniqueness */
path_cutoff = get_path_cutoff(path, &path_ga);
- /* we start at the end of the path */
- pathsep_p = path + len - 1;
-
- while (find_previous_pathsep(path, &pathsep_p))
- if (vim_regexec(&regmatch, pathsep_p + 1, (colnr_T)0)
- && is_unique(pathsep_p + 1, gap, i)
- && path_cutoff != NULL && pathsep_p + 1 >= path_cutoff) {
- sort_again = true;
- memmove(path, pathsep_p + 1, STRLEN(pathsep_p));
- break;
+ // Don't assume all files can be reached without path when search
+ // pattern starts with **/, so only remove path_cutoff
+ // when possible.
+ if (pattern[0] == '*' && pattern[1] == '*'
+ && vim_ispathsep_nocolon(pattern[2])
+ && path_cutoff != NULL
+ && vim_regexec(&regmatch, path_cutoff, (colnr_T)0)
+ && is_unique(path_cutoff, gap, i)) {
+ sort_again = true;
+ memmove(path, path_cutoff, STRLEN(path_cutoff) + 1);
+ } else {
+ // Here all files can be reached without path, so get shortest
+ // unique path. We start at the end of the path. */
+ pathsep_p = path + len - 1;
+ while (find_previous_pathsep(path, &pathsep_p)) {
+ if (vim_regexec(&regmatch, pathsep_p + 1, (colnr_T)0)
+ && is_unique(pathsep_p + 1, gap, i)
+ && path_cutoff != NULL && pathsep_p + 1 >= path_cutoff) {
+ sort_again = true;
+ memmove(path, pathsep_p + 1, STRLEN(pathsep_p));
+ break;
+ }
}
+ }
if (path_is_absolute_path(path)) {
/*
diff --git a/src/nvim/po/eo.po b/src/nvim/po/eo.po
index 153eacc7b8..8a3cd50406 100644
--- a/src/nvim/po/eo.po
+++ b/src/nvim/po/eo.po
@@ -23,8 +23,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Vim(Esperanto)\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-02-13 23:42+0100\n"
-"PO-Revision-Date: 2016-02-13 23:45+0100\n"
+"POT-Creation-Date: 2016-03-29 23:03+0200\n"
+"PO-Revision-Date: 2016-03-29 23:05+0200\n"
"Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
"Language-Team: \n"
"Language: eo\n"
@@ -1346,7 +1346,6 @@ msgstr "E670: Miksaĵo de kodoprezento de helpa dosiero en lingvo: %s"
msgid "E154: Duplicate tag \"%s\" in file %s/%s"
msgstr "E154: Ripetita etikedo \"%s\" en dosiero %s/%s"
-#: ../ex_cmds.c:5687
#, c-format
msgid "E160: Unknown sign command: %s"
msgstr "E160: Nekonata simbola komando: %s"
@@ -1482,8 +1481,8 @@ msgstr "Serĉado de \"%s\""
#: ../ex_cmds2.c:2307
#, c-format
-msgid "not found in 'runtimepath': \"%s\""
-msgstr "ne trovita en 'runtimepath': \"%s\""
+msgid "not found in '%s': \"%s\""
+msgstr "ne trovita en '%s: \"%s\""
#: ../ex_cmds2.c:2472
#, c-format
@@ -6686,6 +6685,12 @@ msgstr "E446: Neniu dosiernomo sub la kursoro"
#~ msgid "E232: Cannot create BalloonEval with both message and callback"
#~ msgstr "E232: Ne eblas krei BalloonEval kun ambaŭ mesaĝo kaj reagfunkcio"
+msgid "Yes"
+msgstr "Jes"
+
+msgid "No"
+msgstr "Ne"
+
# todo '_' is for hotkey, i guess?
#~ msgid "Input _Methods"
#~ msgstr "Enigaj _metodoj"
diff --git a/src/nvim/po/fr.po b/src/nvim/po/fr.po
index a16a939117..cd9f5a7eb2 100644
--- a/src/nvim/po/fr.po
+++ b/src/nvim/po/fr.po
@@ -645,7 +645,7 @@ msgstr "E708: [:] ne peut tre spcifi qu'en dernier"
#: ../eval.c:2439
msgid "E709: [:] requires a List value"
-msgstr "E709: [:] requiert une Liste"
+msgstr "E709: [:] n?cessite une Liste"
#: ../eval.c:2674
msgid "E710: List value has more items than target"
@@ -1639,8 +1639,8 @@ msgstr "Recherche de \"%s\""
#: ../ex_cmds2.c:2307
#, c-format
-msgid "not found in 'runtimepath': \"%s\""
-msgstr "introuvable dans 'runtimepath' : \"%s\""
+msgid "not found in '%s': \"%s\""
+msgstr "introuvable dans '%s' : \"%s\""
#: ../ex_cmds2.c:2472
#, c-format
@@ -6877,6 +6877,12 @@ msgstr "E446: Aucun nom de fichier sous le curseur"
#~ msgid "E232: Cannot create BalloonEval with both message and callback"
#~ msgstr "E232: Impossible de crer un BalloonEval avec message ET callback"
+msgid "Yes"
+msgstr "Oui"
+
+msgid "No"
+msgstr "Non"
+
# todo '_' is for hotkey, i guess?
#~ msgid "Input _Methods"
#~ msgstr "_Mthodes de saisie"
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index 8401343d7a..499716a7a8 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -366,10 +366,10 @@ void terminal_resize(Terminal *term, uint16_t width, uint16_t height)
void terminal_enter(void)
{
buf_T *buf = curbuf;
+ assert(buf->terminal); // Should only be called when curbuf has a terminal.
TerminalState state, *s = &state;
memset(s, 0, sizeof(TerminalState));
s->term = buf->terminal;
- assert(s->term && "should only be called when curbuf has a terminal");
// Ensure the terminal is properly sized.
terminal_resize(s->term, 0, 0);
diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim
index 0a4aa1dc50..7169b6076f 100644
--- a/src/nvim/testdir/test_alot.vim
+++ b/src/nvim/testdir/test_alot.vim
@@ -3,6 +3,7 @@
source test_assign.vim
source test_cursor_func.vim
+source test_ex_undo.vim
source test_feedkeys.vim
source test_cmdline.vim
source test_menu.vim
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 902ec1c05d..21bb057fe1 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -89,6 +89,10 @@ func Test_getcompletion()
call assert_true(index(l, 'runtest.vim') >= 0)
let l = getcompletion('walk', 'file')
call assert_equal([], l)
+ set wildignore=*.vim
+ let l = getcompletion('run', 'file', 1)
+ call assert_true(index(l, 'runtest.vim') < 0)
+ set wildignore&
let l = getcompletion('ha', 'filetype')
call assert_true(index(l, 'hamster') >= 0)
@@ -121,12 +125,35 @@ func Test_getcompletion()
let l = getcompletion('dark', 'highlight')
call assert_equal([], l)
+ if has('cscope')
+ let l = getcompletion('', 'cscope')
+ let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
+ call assert_equal(cmds, l)
+ " using cmdline completion must not change the result
+ call feedkeys(":cscope find \<c-d>\<c-c>", 'xt')
+ let l = getcompletion('', 'cscope')
+ call assert_equal(cmds, l)
+ let keys = ['a', 'c', 'd', 'e', 'f', 'g', 'i', 's', 't']
+ let l = getcompletion('find ', 'cscope')
+ call assert_equal(keys, l)
+ endif
+
+ if has('signs')
+ sign define Testing linehl=Comment
+ let l = getcompletion('', 'sign')
+ let cmds = ['define', 'jump', 'list', 'place', 'undefine', 'unplace']
+ call assert_equal(cmds, l)
+ " using cmdline completion must not change the result
+ call feedkeys(":sign list \<c-d>\<c-c>", 'xt')
+ let l = getcompletion('', 'sign')
+ call assert_equal(cmds, l)
+ let l = getcompletion('list ', 'sign')
+ call assert_equal(['Testing'], l)
+ endif
+
" For others test if the name is recognized.
let names = ['buffer', 'environment', 'file_in_path',
\ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
- if has('cscope')
- call add(names, 'cscope')
- endif
if has('cmdline_hist')
call add(names, 'history')
endif
@@ -136,9 +163,6 @@ func Test_getcompletion()
if has('profile')
call add(names, 'syntime')
endif
- if has('signs')
- call add(names, 'sign')
- endif
set tags=Xtags
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags')
@@ -152,3 +176,11 @@ func Test_getcompletion()
call assert_fails('call getcompletion("", "burp")', 'E475:')
endfunc
+
+func Test_expand_star_star()
+ call mkdir('a/b', 'p')
+ call writefile(['asdfasdf'], 'a/b/fileXname')
+ call feedkeys(":find **/fileXname\<Tab>\<CR>", 'xt')
+ call assert_equal('find a/b/fileXname', getreg(':'))
+ call delete('a', 'rf')
+endfunc
diff --git a/src/nvim/testdir/test_ex_undo.vim b/src/nvim/testdir/test_ex_undo.vim
new file mode 100644
index 0000000000..44feb3680a
--- /dev/null
+++ b/src/nvim/testdir/test_ex_undo.vim
@@ -0,0 +1,19 @@
+" Tests for :undo
+
+func Test_ex_undo()
+ new ex-undo
+ setlocal ul=10
+ exe "normal ione\n\<Esc>"
+ setlocal ul=10
+ exe "normal itwo\n\<Esc>"
+ setlocal ul=10
+ exe "normal ithree\n\<Esc>"
+ call assert_equal(4, line('$'))
+ undo
+ call assert_equal(3, line('$'))
+ undo 1
+ call assert_equal(2, line('$'))
+ undo 0
+ call assert_equal(1, line('$'))
+ quit!
+endfunc
diff --git a/src/nvim/testdir/test_syn_attr.vim b/src/nvim/testdir/test_syn_attr.vim
index 809442eb94..94d6b8735f 100644
--- a/src/nvim/testdir/test_syn_attr.vim
+++ b/src/nvim/testdir/test_syn_attr.vim
@@ -16,9 +16,13 @@ func Test_missing_attr()
call assert_equal('', synIDattr(hlID("Mine"), "undercurl", 'gui'))
if has('gui')
- hi Mine guifg=blue guibg=red font=something
+ let fontname = getfontname()
+ if fontname == ''
+ let fontname = 'something'
+ endif
+ exe 'hi Mine guifg=blue guibg=red font=' . escape(fontname, ' \')
call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui'))
call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui'))
- call assert_equal('something', synIDattr(hlID("Mine"), "font", 'gui'))
+ call assert_equal(fontname, synIDattr(hlID("Mine"), "font", 'gui'))
endif
endfunc
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 648d633e07..eb500414a7 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -397,14 +397,14 @@ static void send_output(uint8_t **ptr)
size_t clen = (size_t)mb_ptr2len(p);
UI_CALL(put, p, (size_t)clen);
col++;
- if (utf_ambiguous_width(*p)) {
- pending_cursor_update = true;
- flush_cursor_update();
- } else if (mb_ptr2cells(p) > 1) {
+ if (mb_ptr2cells(p) > 1) {
// double cell character, blank the next cell
UI_CALL(put, NULL, 0);
col++;
}
+ if (utf_ambiguous_width(utf_ptr2char(p))) {
+ pending_cursor_update = true;
+ }
if (col >= width) {
ui_linefeed();
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index f56942ac43..e6ef600f8c 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -167,7 +167,7 @@ static int included_patches[] = {
// 2277,
// 2276,
// 2275,
- // 2274,
+ 2274,
// 2273,
// 2272,
// 2271 NA
@@ -236,7 +236,7 @@ static int included_patches[] = {
// 2208,
// 2207 NA
// 2206 NA
- // 2205,
+ 2205,
// 2204,
// 2203 NA
// 2202 NA
@@ -279,11 +279,11 @@ static int included_patches[] = {
// 2165,
// 2164,
// 2163,
- // 2162,
+ 2162,
// 2161,
// 2160,
// 2159,
- // 2158,
+ 2158,
// 2157 NA
// 2156 NA
// 2155 NA
@@ -677,7 +677,7 @@ static int included_patches[] = {
// 1768,
// 1767 NA
// 1766 NA
- // 1765,
+ 1765,
// 1764 NA
1763,
// 1762,
@@ -729,7 +729,7 @@ static int included_patches[] = {
// 1717 NA
1716,
// 1715,
- // 1714,
+ 1714,
// 1713 NA
1712,
// 1711,
@@ -894,7 +894,7 @@ static int included_patches[] = {
1552,
1551,
1550,
- // 1549,
+ 1549,
1548,
1547,
1546,
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 66f1049b5e..a259654d52 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -482,7 +482,7 @@ wingotofile:
}
static void cmd_with_count(char *cmd, char_u *bufp, size_t bufsize,
- long Prenum)
+ int64_t Prenum)
{
size_t len = xstrlcpy((char *)bufp, cmd, bufsize);