diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/nvim/api/ui.c | 2 | ||||
-rw-r--r-- | src/nvim/edit.c | 1 | ||||
-rw-r--r-- | src/nvim/eval.c | 33 | ||||
-rw-r--r-- | src/nvim/eval.h | 7 | ||||
-rw-r--r-- | src/nvim/ex_cmds2.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 3 | ||||
-rw-r--r-- | src/nvim/globals.h | 24 | ||||
-rw-r--r-- | src/nvim/mbyte.c | 18 | ||||
-rw-r--r-- | src/nvim/message.c | 19 | ||||
-rw-r--r-- | src/nvim/msgpack_rpc/helpers.c | 6 | ||||
-rw-r--r-- | src/nvim/os/shell.c | 4 | ||||
-rw-r--r-- | src/nvim/rbuffer.c | 4 | ||||
-rw-r--r-- | src/nvim/screen.c | 8 | ||||
-rw-r--r-- | src/nvim/shada.c | 4 | ||||
-rw-r--r-- | src/nvim/syntax.c | 4 | ||||
-rw-r--r-- | src/nvim/testdir/Makefile | 1 | ||||
-rw-r--r-- | src/nvim/testdir/runtest.vim | 14 | ||||
-rw-r--r-- | src/nvim/testdir/test_alot.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_expr.vim | 15 | ||||
-rw-r--r-- | src/nvim/testdir/test_expr_utf8.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_regexp_utf8.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_viml.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_visual.vim | 1 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 4 | ||||
-rw-r--r-- | src/nvim/ui.c | 15 | ||||
-rw-r--r-- | src/nvim/version.c | 26 | ||||
-rw-r--r-- | src/nvim/vim.h | 8 |
28 files changed, 171 insertions, 64 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 49edfda838..f2b75dca2a 100644 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -326,6 +326,7 @@ elseif(CLANG_TSAN) message(STATUS "Enabling Clang thread sanitizer for nvim.") set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ") set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fsanitize=thread ") + set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fPIE ") set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=thread ") endif() diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 56b41f1eea..9178538110 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -271,6 +271,8 @@ static void remote_ui_mode_change(UI *ui, int mode) ADD(args, STRING_OBJ(cstr_to_string("insert"))); } else if (mode == REPLACE) { ADD(args, STRING_OBJ(cstr_to_string("replace"))); + } else if (mode == CMDLINE) { + ADD(args, STRING_OBJ(cstr_to_string("cmdline"))); } else { assert(mode == NORMAL); ADD(args, STRING_OBJ(cstr_to_string("normal"))); diff --git a/src/nvim/edit.c b/src/nvim/edit.c index dcb772e23c..9d07878f24 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2322,7 +2322,6 @@ static int ins_compl_make_cyclic(void) return count; } - // Set variables that store noselect and noinsert behavior from the // 'completeopt' value. void completeopt_was_set(void) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d7188290f2..3e4f63884d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -387,6 +387,13 @@ static struct vimvar { VV(VV__NULL_LIST, "_null_list", VAR_LIST, VV_RO), VV(VV__NULL_DICT, "_null_dict", VAR_DICT, VV_RO), VV(VV_VIM_DID_ENTER, "vim_did_enter", VAR_NUMBER, VV_RO), + VV(VV_TYPE_NUMBER, "t_number", VAR_NUMBER, VV_RO), + VV(VV_TYPE_STRING, "t_string", VAR_NUMBER, VV_RO), + VV(VV_TYPE_FUNC, "t_func", VAR_NUMBER, VV_RO), + VV(VV_TYPE_LIST, "t_list", VAR_NUMBER, VV_RO), + VV(VV_TYPE_DICT, "t_dict", VAR_NUMBER, VV_RO), + VV(VV_TYPE_FLOAT, "t_float", VAR_NUMBER, VV_RO), + VV(VV_TYPE_BOOL, "t_bool", VAR_NUMBER, VV_RO), }; #undef VV @@ -400,7 +407,7 @@ static struct vimvar { #define vv_dict vv_di.di_tv.vval.v_dict #define vv_tv vv_di.di_tv -static dictitem_T vimvars_var; /* variable used for v: */ +static dictitem_T vimvars_var; // variable used for v: #define vimvarht vimvardict.dv_hashtab typedef struct { @@ -562,6 +569,14 @@ void eval_init(void) set_vim_var_list(VV_ERRORS, list_alloc()); set_vim_var_nr(VV_SEARCHFORWARD, 1L); set_vim_var_nr(VV_HLSEARCH, 1L); + set_vim_var_nr(VV_COUNT1, 1); + set_vim_var_nr(VV_TYPE_NUMBER, VAR_TYPE_NUMBER); + set_vim_var_nr(VV_TYPE_STRING, VAR_TYPE_STRING); + set_vim_var_nr(VV_TYPE_FUNC, VAR_TYPE_FUNC); + set_vim_var_nr(VV_TYPE_LIST, VAR_TYPE_LIST); + set_vim_var_nr(VV_TYPE_DICT, VAR_TYPE_DICT); + set_vim_var_nr(VV_TYPE_FLOAT, VAR_TYPE_FLOAT); + set_vim_var_nr(VV_TYPE_BOOL, VAR_TYPE_BOOL); set_vim_var_special(VV_FALSE, kSpecialVarFalse); set_vim_var_special(VV_TRUE, kSpecialVarTrue); @@ -10652,7 +10667,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (!n) { if (STRNICMP(name, "patch", 5) == 0) { if (name[5] == '-' - && strlen(name) > 11 + && strlen(name) >= 11 && ascii_isdigit(name[6]) && ascii_isdigit(name[8]) && ascii_isdigit(name[10])) { @@ -16794,17 +16809,17 @@ static void f_type(typval_T *argvars, typval_T *rettv, FunPtr fptr) int n = -1; switch (argvars[0].v_type) { - case VAR_NUMBER: n = 0; break; - case VAR_STRING: n = 1; break; - case VAR_FUNC: n = 2; break; - case VAR_LIST: n = 3; break; - case VAR_DICT: n = 4; break; - case VAR_FLOAT: n = 5; break; + case VAR_NUMBER: n = VAR_TYPE_NUMBER; break; + case VAR_STRING: n = VAR_TYPE_STRING; break; + case VAR_FUNC: n = VAR_TYPE_FUNC; break; + case VAR_LIST: n = VAR_TYPE_LIST; break; + case VAR_DICT: n = VAR_TYPE_DICT; break; + case VAR_FLOAT: n = VAR_TYPE_FLOAT; break; case VAR_SPECIAL: { switch (argvars[0].vval.v_special) { case kSpecialVarTrue: case kSpecialVarFalse: { - n = 6; + n = VAR_TYPE_BOOL; break; } case kSpecialVarNull: { diff --git a/src/nvim/eval.h b/src/nvim/eval.h index 1061840816..cc7827b801 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -127,6 +127,13 @@ typedef enum { VV__NULL_LIST, // List with NULL value. For test purposes only. VV__NULL_DICT, // Dictionary with NULL value. For test purposes only. VV_VIM_DID_ENTER, + VV_TYPE_NUMBER, + VV_TYPE_STRING, + VV_TYPE_FUNC, + VV_TYPE_LIST, + VV_TYPE_DICT, + VV_TYPE_FLOAT, + VV_TYPE_BOOL, } VimVarIndex; /// All recognized msgpack types diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index f68663c60c..3b92b3734a 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2552,7 +2552,7 @@ static void add_pack_plugin(char_u *fname, void *cookie) } if (cookie != &APP_ADD_DIR) { - static const char *plugpat = "%s/plugin/*.vim"; // NOLINT + static const char *plugpat = "%s/plugin/**/*.vim"; // NOLINT static const char *ftpat = "%s/ftdetect/*.vim"; // NOLINT size_t len = STRLEN(ffname) + STRLEN(ftpat); diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 76dddf874d..23b1a50fc8 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7970,7 +7970,8 @@ static void ex_startinsert(exarg_T *eap) static void ex_stopinsert(exarg_T *eap) { restart_edit = 0; - stop_insert_mode = TRUE; + stop_insert_mode = true; + clearmode(); } /* diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 301a2c1663..f81fb43eaf 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -788,8 +788,28 @@ EXTERN int vr_lines_changed INIT(= 0); /* #Lines changed by "gR" so far */ /// Encoding used when 'fencs' is set to "default" EXTERN char_u *fenc_default INIT(= NULL); -// To speed up BYTELEN() we keep a table with the byte lengths for utf-8 -EXTERN char utf8len_tab[256]; +// To speed up BYTELEN(); keep a lookup table to quickly get the length in +// bytes of a UTF-8 character from the first byte of a UTF-8 string. Bytes +// which are illegal when used as the first byte have a 1. The NUL byte has +// length 1. +EXTERN char utf8len_tab[256] INIT(= { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1, +}); # if defined(USE_ICONV) && defined(DYNAMIC_ICONV) /* Pointers to functions and variables to be loaded at runtime */ diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 7be0be7106..2ecd86974e 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -69,24 +69,6 @@ struct interval { #endif /* - * Lookup table to quickly get the length in bytes of a UTF-8 character from - * the first byte of a UTF-8 string. - * Bytes which are illegal when used as the first byte have a 1. - * The NUL byte has length 1. - */ -char utf8len_tab[256] = -{ - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1, -}; - -/* * Like utf8len_tab above, but using a zero for illegal lead bytes. */ static uint8_t utf8len_tab_zero[256] = diff --git a/src/nvim/message.c b/src/nvim/message.c index 1de2347b12..f9cfc49197 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -19,6 +19,7 @@ #include "nvim/fileio.h" #include "nvim/func_attr.h" #include "nvim/getchar.h" +#include "nvim/main.h" #include "nvim/mbyte.h" #include "nvim/memory.h" #include "nvim/misc1.h" @@ -581,6 +582,24 @@ bool emsgf(const char *const fmt, ...) return emsg(IObuff); } +static void msg_emsgf_event(void **argv) +{ + char *s = argv[0]; + (void)emsg((char_u *)s); + xfree(s); +} + +void msg_schedule_emsgf(const char *const fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vim_vsnprintf((char *)IObuff, IOSIZE, fmt, ap, NULL); + va_end(ap); + + char *s = xstrdup((char *)IObuff); + loop_schedule(&main_loop, event_create(1, msg_emsgf_event, 1, s)); +} + /* * Like msg(), but truncate to a single line if p_shm contains 't', or when * "force" is TRUE. This truncates in another way as for normal messages. diff --git a/src/nvim/msgpack_rpc/helpers.c b/src/nvim/msgpack_rpc/helpers.c index c3a909692f..5137b375f0 100644 --- a/src/nvim/msgpack_rpc/helpers.c +++ b/src/nvim/msgpack_rpc/helpers.c @@ -125,7 +125,7 @@ bool msgpack_rpc_to_object(const msgpack_object *const obj, Object *const arg) dest = conv(((String) { \ .size = obj->via.attr.size, \ .data = (obj->via.attr.ptr == NULL || obj->via.attr.size == 0 \ - ? NULL \ + ? xmemdupz("", 0) \ : xmemdupz(obj->via.attr.ptr, obj->via.attr.size)), \ })); \ break; \ @@ -326,7 +326,9 @@ void msgpack_rpc_from_string(String result, msgpack_packer *res) FUNC_ATTR_NONNULL_ARG(2) { msgpack_pack_str(res, result.size); - msgpack_pack_str_body(res, result.data, result.size); + if (result.size > 0) { + msgpack_pack_str_body(res, result.data, result.size); + } } typedef struct { diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c index 18ee008d66..9e6effd21b 100644 --- a/src/nvim/os/shell.c +++ b/src/nvim/os/shell.c @@ -548,8 +548,8 @@ static void shell_write_cb(Stream *stream, void *data, int status) if (status) { // Can happen if system() tries to send input to a shell command that was // backgrounded (:call system("cat - &", "foo")). #3529 #5241 - EMSG2(_("E5677: Error writing input to shell-command: %s"), - uv_err_name(status)); + msg_schedule_emsgf(_("E5677: Error writing input to shell-command: %s"), + uv_err_name(status)); } if (stream->closed) { // Process may have exited before this write. ELOG("stream was already closed"); diff --git a/src/nvim/rbuffer.c b/src/nvim/rbuffer.c index a2cc432eca..111af0d0fb 100644 --- a/src/nvim/rbuffer.c +++ b/src/nvim/rbuffer.c @@ -18,7 +18,7 @@ RBuffer *rbuffer_new(size_t capacity) capacity = 0x10000; } - RBuffer *rv = xmalloc(sizeof(RBuffer) + capacity); + RBuffer *rv = xcalloc(1, sizeof(RBuffer) + capacity); rv->full_cb = rv->nonfull_cb = NULL; rv->data = NULL; rv->size = 0; @@ -78,7 +78,7 @@ void rbuffer_reset(RBuffer *buf) FUNC_ATTR_NONNULL_ALL size_t temp_size; if ((temp_size = rbuffer_size(buf))) { if (buf->temp == NULL) { - buf->temp = xmalloc(rbuffer_capacity(buf)); + buf->temp = xcalloc(1, rbuffer_capacity(buf)); } rbuffer_read(buf, buf->temp, buf->size); } diff --git a/src/nvim/screen.c b/src/nvim/screen.c index cee3c62f43..5bf743c4df 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -6827,12 +6827,18 @@ void unshowmode(bool force) if (!redrawing() || (!force && char_avail() && !KeyTyped)) { redraw_cmdline = true; // delete mode later } else { + clearmode(); + } +} + +// Clear the mode message. +void clearmode(void) +{ msg_pos_mode(); if (Recording) { recording_mode(hl_attr(HLF_CM)); } msg_clr_eos(); - } } static void recording_mode(int attr) diff --git a/src/nvim/shada.c b/src/nvim/shada.c index 01c0807d82..d902079739 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -1575,7 +1575,9 @@ static char *shada_filename(const char *file) do { \ const String s_ = (s); \ msgpack_pack_bin(spacker, s_.size); \ - msgpack_pack_bin_body(spacker, s_.data, s_.size); \ + if (s_.size > 0) { \ + msgpack_pack_bin_body(spacker, s_.data, s_.size); \ + } \ } while (0) /// Write single ShaDa entry diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index e57965ac2c..cd37bde3cb 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -392,7 +392,9 @@ void syntax_start(win_T *wp, linenr_T lnum) * Also do this when a change was made, the current state may be invalid * then. */ - if (syn_block != wp->w_s || changedtick != syn_buf->b_changedtick) { + if (syn_block != wp->w_s + || syn_buf != wp->w_buffer + || changedtick != syn_buf->b_changedtick) { invalidate_current_state(); syn_buf = wp->w_buffer; syn_block = wp->w_s; diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 67e7c97905..c6e9c26c57 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -32,6 +32,7 @@ SCRIPTS := \ # Keep test_alot*.res as the last one, sort the others. NEW_TESTS = \ test_cscope.res \ + test_cmdline.res \ test_hardcopy.res \ test_help_tagjump.res \ test_history.res \ diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index e2d1e67a22..d1857565a4 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -42,6 +42,14 @@ endif " This also enables use of line continuation. set viminfo+=nviminfo +" Use utf-8 or latin1 be default, instead of whatever the system default +" happens to be. Individual tests can overrule this at the top of the file. +if has('multi_byte') + set encoding=utf-8 +else + set encoding=latin1 +endif + " Avoid stopping at the "hit enter" prompt set nomore @@ -51,6 +59,9 @@ lang mess C " Always use forward slashes. set shellslash +" Make sure $HOME does not get read or written. +let $HOME = '/does/not/exist' + function RunTheTest(test) echo 'Executing ' . a:test if exists("*SetUp") @@ -123,6 +134,9 @@ for s:test in sort(s:tests) endfor +" Don't write viminfo on exit. +set viminfo= + if s:fail == 0 " Success, create the .res file so that make knows it's done. exe 'split ' . fnamemodify(g:testname, ':r') . '.res' diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 156604051d..4e8cd54ce3 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -8,7 +8,6 @@ source test_ex_undo.vim source test_expr.vim source test_expr_utf8.vim source test_feedkeys.vim -source test_cmdline.vim source test_menu.vim source test_options.vim source test_popup.vim diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 51d6a0931c..66a10b05e1 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -1,5 +1,20 @@ " Tests for expressions. +func Test_version() + call assert_true(has('patch-7.4.001')) + call assert_true(has('patch-7.4.01')) + call assert_true(has('patch-7.4.1')) + call assert_true(has('patch-6.9.999')) + call assert_true(has('patch-7.1.999')) + call assert_true(has('patch-7.4.123')) + + call assert_false(has('patch-7')) + call assert_false(has('patch-7.4')) + call assert_false(has('patch-7.4.')) + call assert_false(has('patch-9.1.0')) + call assert_false(has('patch-9.9.1')) +endfunc + func Test_strgetchar() call assert_equal(char2nr('a'), strgetchar('axb', 0)) call assert_equal(char2nr('x'), strgetchar('axb', 1)) diff --git a/src/nvim/testdir/test_expr_utf8.vim b/src/nvim/testdir/test_expr_utf8.vim index 7bdcb4f65f..9ea6d8872b 100644 --- a/src/nvim/testdir/test_expr_utf8.vim +++ b/src/nvim/testdir/test_expr_utf8.vim @@ -2,7 +2,6 @@ if !has('multi_byte') finish endif -scriptencoding utf-8 func Test_strgetchar_utf8() call assert_equal(char2nr('á'), strgetchar('áxb', 0)) diff --git a/src/nvim/testdir/test_regexp_utf8.vim b/src/nvim/testdir/test_regexp_utf8.vim index 38f9ed41d5..ecb03a0f8c 100644 --- a/src/nvim/testdir/test_regexp_utf8.vim +++ b/src/nvim/testdir/test_regexp_utf8.vim @@ -1,5 +1,4 @@ " Tests for regexp in utf8 encoding -scriptencoding utf-8 func s:equivalence_test() let str = "AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ" diff --git a/src/nvim/testdir/test_viml.vim b/src/nvim/testdir/test_viml.vim index c39c5e6b28..a11d62f5cf 100644 --- a/src/nvim/testdir/test_viml.vim +++ b/src/nvim/testdir/test_viml.vim @@ -949,6 +949,14 @@ func Test_type() call assert_equal(6, type(v:false)) call assert_equal(6, type(v:true)) call assert_equal(7, type(v:null)) + call assert_equal(v:t_number, type(0)) + call assert_equal(v:t_string, type("")) + call assert_equal(v:t_func, type(function("tr"))) + call assert_equal(v:t_list, type([])) + call assert_equal(v:t_dict, type({})) + call assert_equal(v:t_float, type(0.0)) + call assert_equal(v:t_bool, type(v:false)) + call assert_equal(v:t_bool, type(v:true)) endfunc "------------------------------------------------------------------------------- diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim index 83bae967e2..cf0e535937 100644 --- a/src/nvim/testdir/test_visual.vim +++ b/src/nvim/testdir/test_visual.vim @@ -2,7 +2,6 @@ if !has('multi_byte') finish endif -scriptencoding utf-8 if !has('visual') finish diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 5e30517c5a..2171e580ba 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -461,6 +461,10 @@ static void tui_mode_change(UI *ui, int mode) if (data->showing_mode != INSERT) { unibi_out(ui, data->unibi_ext.set_cursor_shape_bar); } + } else if (mode == CMDLINE) { + if (data->showing_mode != CMDLINE) { + unibi_out(ui, data->unibi_ext.set_cursor_shape_bar); + } } else if (mode == REPLACE) { if (data->showing_mode != REPLACE) { unibi_out(ui, data->unibi_ext.set_cursor_shape_ul); diff --git a/src/nvim/ui.c b/src/nvim/ui.c index eb500414a7..ea0bccb1cd 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -177,14 +177,14 @@ void ui_refresh(void) pum_set_external(pum_external); } -static void ui_refresh_handler(void **argv) +static void ui_refresh_event(void **argv) { ui_refresh(); } void ui_schedule_refresh(void) { - loop_schedule(&main_loop, event_create(1, ui_refresh_handler, 0)); + loop_schedule(&main_loop, event_create(1, ui_refresh_event, 0)); } void ui_resize(int new_width, int new_height) @@ -532,13 +532,16 @@ static void ui_mode_change(void) if (!full_screen) { return; } - /* Get a simple UI mode out of State. */ - if ((State & REPLACE) == REPLACE) + // Get a simple UI mode out of State. + if ((State & REPLACE) == REPLACE) { mode = REPLACE; - else if (State & INSERT) + } else if (State & INSERT) { mode = INSERT; - else + } else if (State & CMDLINE) { + mode = CMDLINE; + } else { mode = NORMAL; + } UI_CALL(mode_change, mode); conceal_check_cursur_line(); } diff --git a/src/nvim/version.c b/src/nvim/version.c index e7ab593285..65bd4cfcf7 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -131,7 +131,7 @@ static int included_patches[] = { // 2314, // 2313, 2312, - // 2311, + // 2311 NA // 2310 NA 2309, // 2308 NA @@ -356,7 +356,7 @@ static int included_patches[] = { // 2089 NA // 2088, // 2087, - // 2086, + 2086, // 2085, // 2084, // 2083, @@ -371,7 +371,7 @@ static int included_patches[] = { // 2074, // 2073, // 2072, - // 2071, + 2071, // 2070 NA // 2069, // 2068, @@ -435,7 +435,7 @@ static int included_patches[] = { // 2010, // 2009, // 2008, - // 2007, + 2007, // 2006, // 2005, // 2004 NA @@ -514,12 +514,12 @@ static int included_patches[] = { // 1931 NA // 1930 NA // 1929 NA - // 1928, + 1928, // 1927 NA // 1926 NA // 1925 NA // 1924 NA - // 1923, + 1923, // 1922 NA // 1921 NA // 1920 NA @@ -734,7 +734,7 @@ static int included_patches[] = { // 1713 NA 1712, // 1711, - // 1710, + // 1710 NA // 1709 NA // 1708, 1707, @@ -743,22 +743,22 @@ static int included_patches[] = { 1704, 1703, // 1702, - // 1701, + 1701, 1700, - // 1699, + 1699, // 1698 NA 1697, - // 1696, + 1696, 1695, // 1694 NA // 1693 NA // 1692, - // 1691, + 1691, // 1690 NA // 1689 NA // 1688 NA // 1687 NA - // 1686, + 1686, // 1685, // 1684 NA // 1683 NA @@ -784,7 +784,7 @@ static int included_patches[] = { 1663, // 1662 NA // 1661 NA - // 1660, + 1660, // 1659 NA 1658, // 1657 NA diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 32eba55c18..8271abda8d 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -123,6 +123,14 @@ Error: configure did not run properly.Check auto/config.log. #define FAIL 0 #define NOTDONE 2 /* not OK or FAIL but skipped */ +// Type values for type(). +#define VAR_TYPE_NUMBER 0 +#define VAR_TYPE_STRING 1 +#define VAR_TYPE_FUNC 2 +#define VAR_TYPE_LIST 3 +#define VAR_TYPE_DICT 4 +#define VAR_TYPE_FLOAT 5 +#define VAR_TYPE_BOOL 6 /* * values for xp_context when doing command line completion |