diff options
Diffstat (limited to 'src')
41 files changed, 135 insertions, 167 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 61e4d634c6..a2487336f1 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3693,6 +3693,7 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, } else { char_u *orig_line = NULL; int len_change = 0; + const bool save_p_lz = p_lz; int save_p_fen = curwin->w_p_fen; curwin->w_p_fen = FALSE; @@ -3701,6 +3702,9 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, int temp = RedrawingDisabled; RedrawingDisabled = 0; + // avoid calling update_screen() in vgetorpeek() + p_lz = false; + if (new_start != NULL) { /* There already was a substitution, we would * like to show this to the user. We cannot @@ -3754,7 +3758,8 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout, /* clear the question */ msg_didout = FALSE; /* don't scroll up */ msg_col = 0; - gotocmdline(TRUE); + gotocmdline(true); + p_lz = save_p_lz; // restore the line if (orig_line != NULL) { diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 069d5d461b..e9046da800 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -2455,7 +2455,7 @@ module.cmds = { }, { command='sleep', - flags=bit.bor(RANGE, COUNT, EXTRA, TRLBAR, CMDWIN), + flags=bit.bor(BANG, RANGE, COUNT, EXTRA, TRLBAR, CMDWIN), addr_type='ADDR_OTHER', func='ex_sleep', }, diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 626b840798..2aa66f6a8c 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -3828,7 +3828,7 @@ static void cmd_cursor_goto(int row, int col) ui_grid_cursor_goto(grid->handle, row, col); } -void gotocmdline(int clr) +void gotocmdline(bool clr) { if (ui_has(kUICmdline)) { return; diff --git a/src/nvim/log.c b/src/nvim/log.c index a90c95c034..324382a0f7 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -69,6 +69,14 @@ static bool log_path_init(void) || log_file_path[0] == '\0' || os_isdir((char_u *)log_file_path) || !log_try_create(log_file_path)) { + // Make kXDGCacheHome if it does not exist. + char *cachehome = get_xdg_home(kXDGCacheHome); + char *failed_dir = NULL; + bool log_dir_failure = false; + if (!os_isdir((char_u *)cachehome)) { + log_dir_failure = (os_mkdir_recurse(cachehome, 0700, &failed_dir) != 0); + } + XFREE_CLEAR(cachehome); // Invalid $NVIM_LOG_FILE or failed to expand; fall back to default. char *defaultpath = stdpaths_user_cache_subpath("log"); size_t len = xstrlcpy(log_file_path, defaultpath, size); @@ -83,6 +91,11 @@ static bool log_path_init(void) return false; } os_setenv(LOG_FILE_ENV, log_file_path, true); + if (log_dir_failure) { + WLOG("Failed to create directory %s for writing logs: %s", + failed_dir, os_strerror(log_dir_failure)); + } + XFREE_CLEAR(failed_dir); } return true; } @@ -323,4 +336,3 @@ static bool v_do_log_to_file(FILE *log_file, int log_level, return true; } - diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 344a2387d6..3219c02068 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -5,6 +5,7 @@ #include <lualib.h> #include <lauxlib.h> +#include "nvim/version.h" #include "nvim/misc1.h" #include "nvim/getchar.h" #include "nvim/garray.h" @@ -78,6 +79,17 @@ static void nlua_error(lua_State *const lstate, const char *const msg) lua_pop(lstate, 1); } +/// Return version of current neovim build +/// +/// @param lstate Lua interpreter state. +static int nlua_nvim_version(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL +{ + Dictionary version = version_dict(); + nlua_push_Dictionary(lstate, version, true); + api_free_dictionary(version); + return 1; +} + /// Compare two strings, ignoring case /// /// Expects two values on the stack: compared strings. Returns one of the @@ -420,6 +432,9 @@ static int nlua_state_init(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL // str_byteindex lua_pushcfunction(lstate, &nlua_str_byteindex); lua_setfield(lstate, -2, "str_byteindex"); + // neovim version + lua_pushcfunction(lstate, &nlua_nvim_version); + lua_setfield(lstate, -2, "version"); // schedule lua_pushcfunction(lstate, &nlua_schedule); lua_setfield(lstate, -2, "schedule"); diff --git a/src/nvim/main.c b/src/nvim/main.c index 8bf745966e..9f71df3a46 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -2044,7 +2044,6 @@ static void usage(void) mch_msg(_(" -u <config> Use this config file\n")); mch_msg(_(" -v, --version Print version information\n")); mch_msg(_(" -V[N][file] Verbose [level][file]\n")); - mch_msg(_(" -Z Restricted mode\n")); mch_msg("\n"); mch_msg(_(" --api-info Write msgpack-encoded API metadata to stdout\n")); mch_msg(_(" --embed Use stdin/stdout as a msgpack-rpc channel\n")); diff --git a/src/nvim/po/af.po b/src/nvim/po/af.po index fa6674469c..db44f50a46 100644 --- a/src/nvim/po/af.po +++ b/src/nvim/po/af.po @@ -3290,10 +3290,6 @@ msgstr "-o[N]\t\tMaak N vensters oop (verstek: een vir elke ler)" #~ msgid " -V[N][file] Verbose [level][file]\n" #~ msgstr "" -#, fuzzy -#~ msgid " -Z Restricted mode\n" -#~ msgstr " vir twee modusse " - #~ msgid " --api-info Write msgpack-encoded API metadata to stdout\n" #~ msgstr "" @@ -7473,9 +7469,6 @@ msgstr "E446: Geen lernaam onder loper" #~ msgid "-b\t\t\tBinary mode" #~ msgstr "-b\t\t\tBinre modus" -#~ msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -#~ msgstr "-Z\t\t\tBeperkte modus (soos \"rvim\")" - #~ msgid "-R\t\t\tReadonly mode (like \"view\")" #~ msgstr "-R\t\t\tLeesalleen modus (soos \"view\")" diff --git a/src/nvim/po/ca.po b/src/nvim/po/ca.po index be4206f36e..6c4d6ddd22 100644 --- a/src/nvim/po/ca.po +++ b/src/nvim/po/ca.po @@ -3469,10 +3469,6 @@ msgstr "-y\t\t\tMode senzill (com \"evim\", sense modes)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tMode noms lectura (com \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tMode restringit (com \"rvim)" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tNo permet modificar (escriure) fitxers" diff --git a/src/nvim/po/cs.cp1250.po b/src/nvim/po/cs.cp1250.po index 5b9f3d3a58..859039eb87 100644 --- a/src/nvim/po/cs.cp1250.po +++ b/src/nvim/po/cs.cp1250.po @@ -3547,10 +3547,6 @@ msgstr "-v\t\t\tSnadn reim (stejn jako \"evim\", dn mdy )" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tReim pouze_pro_ten (jako \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tOmezen reim (stejn jako \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tZmny (ukldn soubor) zakzny" diff --git a/src/nvim/po/cs.po b/src/nvim/po/cs.po index 31a90dc514..4d9ad58836 100644 --- a/src/nvim/po/cs.po +++ b/src/nvim/po/cs.po @@ -3547,10 +3547,6 @@ msgstr "-v\t\t\tSnadn reim (stejn jako \"evim\", dn mdy )" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tReim pouze_pro_ten (jako \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tOmezen reim (stejn jako \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tZmny (ukldn soubor) zakzny" diff --git a/src/nvim/po/da.po b/src/nvim/po/da.po index f35272810b..7a75425019 100644 --- a/src/nvim/po/da.po +++ b/src/nvim/po/da.po @@ -3015,9 +3015,6 @@ msgstr "-y\t\t\tEasy-tilstand (ligesom \"evim\", tilstandsløs)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tSkrivebeskyttet tilstand (ligesom \"view\")" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tRestriktiv tilstand (ligesom \"rvim\")" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tÆndringer (skrivning af filer) ikke tilladt" diff --git a/src/nvim/po/de.po b/src/nvim/po/de.po index a2e04965e5..740e9e5f6a 100644 --- a/src/nvim/po/de.po +++ b/src/nvim/po/de.po @@ -2895,10 +2895,6 @@ msgstr "-y\t\t\tLeichter Modus (wie \"evim\", ohne Modi)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tModus ohne Schreibrechte (wie \"view\")" -#: ../main.c:2186 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tEingeschrnkter Modus (wie \"rvim\")" - #: ../main.c:2187 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tnderungen (beim Schreiben von Dateien) sind nicht erlaubt" diff --git a/src/nvim/po/en_GB.po b/src/nvim/po/en_GB.po index 7919fc8946..66cdba6f92 100644 --- a/src/nvim/po/en_GB.po +++ b/src/nvim/po/en_GB.po @@ -3368,10 +3368,6 @@ msgstr "" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "" diff --git a/src/nvim/po/eo.po b/src/nvim/po/eo.po index 99c46c7275..5480e6a4d8 100644 --- a/src/nvim/po/eo.po +++ b/src/nvim/po/eo.po @@ -2989,9 +2989,6 @@ msgstr "-y\t\t\tFacila reĝimo (kiel \"evim\", senreĝima)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tNurlegebla reĝimo (kiel \"view\")" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tLimigita reĝimo (kiel \"rvim\")" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tŜanĝoj (skribo al dosieroj) nepermeseblaj" diff --git a/src/nvim/po/es.po b/src/nvim/po/es.po index eeea27610d..064484d1a4 100644 --- a/src/nvim/po/es.po +++ b/src/nvim/po/es.po @@ -3524,10 +3524,6 @@ msgstr "-y\t\t\tModo fácil (como \"evim\", sin modo)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tModo de solo lectura (como \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tModo restringido (como \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tModificación de archivos desactivada" diff --git a/src/nvim/po/fi.po b/src/nvim/po/fi.po index 4489139cfb..5986a57488 100644 --- a/src/nvim/po/fi.po +++ b/src/nvim/po/fi.po @@ -3249,10 +3249,6 @@ msgstr "" #~ msgstr " kahta tilaa varten " #, fuzzy -#~ msgid " -Z Restricted mode\n" -#~ msgstr " kahta tilaa varten " - -#, fuzzy #~ msgid " -m Modifications (writing files) not allowed\n" #~ msgstr "-m\t\t\tMuokkaukset (kirjoittaminen tiedostoon) pois käytöstä" @@ -6961,9 +6957,6 @@ msgstr "Lista tai luku tarvitaan" #~ msgid "-b\t\t\tBinary mode" #~ msgstr "-b\t\t\tBinääritila" -#~ msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -#~ msgstr "-Z\t\t\tRajoitettu tila (kuten rvimillä)" - #~ msgid "-R\t\t\tReadonly mode (like \"view\")" #~ msgstr "-R\t\t\tKirjoitussuojattu tila (kuten view'lla)" diff --git a/src/nvim/po/fr.po b/src/nvim/po/fr.po index bb60649c91..5f1ca2fec5 100644 --- a/src/nvim/po/fr.po +++ b/src/nvim/po/fr.po @@ -3231,9 +3231,6 @@ msgstr "-y\t\tMode facile (comme \"evim\", vim sans modes)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\tMode lecture seule (comme \"view\")" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\tMode restreint (comme \"rvim\")" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\tInterdire l'enregistrement des fichiers" diff --git a/src/nvim/po/ga.po b/src/nvim/po/ga.po index 1104b31c32..bad01d592a 100644 --- a/src/nvim/po/ga.po +++ b/src/nvim/po/ga.po @@ -3022,9 +3022,6 @@ msgstr "-y\t\t\tMd asca (mar \"evim\", gan mhid)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tMd inlite amhin (mar \"view\")" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tMd srianta (mar \"rvim\")" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tN cheadatear athruithe (.i. scrobh na gcomhad)" diff --git a/src/nvim/po/it.po b/src/nvim/po/it.po index 511f910b71..dfabc4bee0 100644 --- a/src/nvim/po/it.po +++ b/src/nvim/po/it.po @@ -3510,10 +3510,6 @@ msgstr "-y\t\t\tModalit Facile (come \"evim\", senza modalit)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tModalit Sola Lettura (come \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tModalit Ristretta (come \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tRiscritture del file non permesse" diff --git a/src/nvim/po/ja.euc-jp.po b/src/nvim/po/ja.euc-jp.po index 523e9ca4e3..e2cf68f016 100644 --- a/src/nvim/po/ja.euc-jp.po +++ b/src/nvim/po/ja.euc-jp.po @@ -3024,9 +3024,6 @@ msgstr "-y\t\t\t⡼ (\"evim\" Ʊ⡼̵)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tɹѥ⡼ (\"view\" Ʊ)" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\t¥⡼ (\"rvim\" Ʊ)" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tѹ (ե¸) Ǥʤ褦ˤ" diff --git a/src/nvim/po/ja.po b/src/nvim/po/ja.po index 5a69d0c5bf..85a45cd171 100644 --- a/src/nvim/po/ja.po +++ b/src/nvim/po/ja.po @@ -3024,9 +3024,6 @@ msgstr "-y\t\t\tイージーモード (\"evim\" と同じ、モード無)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\t読込専用モード (\"view\" と同じ)" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\t制限モード (\"rvim\" と同じ)" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\t変更 (ファイル保存時) をできないようにする" diff --git a/src/nvim/po/ko.UTF-8.po b/src/nvim/po/ko.UTF-8.po index 128b238f8b..b99c22caeb 100644 --- a/src/nvim/po/ko.UTF-8.po +++ b/src/nvim/po/ko.UTF-8.po @@ -3438,10 +3438,6 @@ msgstr "-y\t\t\t쉬운 상태 (\"evim\"과 같음, modeless)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\t읽기 전용 상태 (\"view\"와 같음)" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\t제한된 상태 (\"rvim\"과 같음)" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\t수정(파일 쓰기)이 허용되지 않음" diff --git a/src/nvim/po/nb.po b/src/nvim/po/nb.po index 34617ccf18..2285d755cf 100644 --- a/src/nvim/po/nb.po +++ b/src/nvim/po/nb.po @@ -3452,10 +3452,6 @@ msgstr "-y\t\t\tLett modus (som \"evim\", uten modus)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tSkrivebeskyttet modus (som \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tBegrenset modus (som \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tModifisering (lagring av filer) ikke tillatt" diff --git a/src/nvim/po/nl.po b/src/nvim/po/nl.po index 30f34508f5..00d113c83c 100644 --- a/src/nvim/po/nl.po +++ b/src/nvim/po/nl.po @@ -3449,10 +3449,6 @@ msgstr "-y\t\t\tEenvoudige modus (zoals \"evim\", zonder modus)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tAlleen-lezen modus (zoals \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tBeperkte modus (zoals \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tAanpassingen (bestanden opslaan) niet toegestaan" diff --git a/src/nvim/po/no.po b/src/nvim/po/no.po index 34617ccf18..2285d755cf 100644 --- a/src/nvim/po/no.po +++ b/src/nvim/po/no.po @@ -3452,10 +3452,6 @@ msgstr "-y\t\t\tLett modus (som \"evim\", uten modus)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tSkrivebeskyttet modus (som \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tBegrenset modus (som \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tModifisering (lagring av filer) ikke tillatt" diff --git a/src/nvim/po/pl.UTF-8.po b/src/nvim/po/pl.UTF-8.po index f5c452e924..5f1779d1bd 100644 --- a/src/nvim/po/pl.UTF-8.po +++ b/src/nvim/po/pl.UTF-8.po @@ -3417,10 +3417,6 @@ msgstr "-y\t\t\tTryb łatwy (jak \"evim\", bez trybów)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tTryb wyłącznie do odczytu (jak \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tTryb ograniczenia (jak \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tModyfikacje (zapisywanie plików) niedozwolone" diff --git a/src/nvim/po/pt_BR.po b/src/nvim/po/pt_BR.po index 4f39cb5bdb..533d916de1 100644 --- a/src/nvim/po/pt_BR.po +++ b/src/nvim/po/pt_BR.po @@ -6229,10 +6229,6 @@ msgstr "-y\t\t\tModo fácil (como \"evim\", o Vim não modal)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tmodo somente-leitura (como \"view\")" -#: ../main.c:2186 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tmodo restrito (como \"rvim\")" - #: ../main.c:2187 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tNo permitir alteraes (gravao de arquivos)" diff --git a/src/nvim/po/ru.po b/src/nvim/po/ru.po index 62f892d257..3a96ece2fb 100644 --- a/src/nvim/po/ru.po +++ b/src/nvim/po/ru.po @@ -3442,10 +3442,6 @@ msgstr "-y\t\t\tПростой режим (как \"evim\", безрежимны msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tТолько для чтения (как \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tОграниченный режим (как \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tБез возможности сохранения изменений (записи файлов)" diff --git a/src/nvim/po/sk.cp1250.po b/src/nvim/po/sk.cp1250.po index ced343bf6b..ff95c68a12 100644 --- a/src/nvim/po/sk.cp1250.po +++ b/src/nvim/po/sk.cp1250.po @@ -3450,10 +3450,6 @@ msgstr "-y\t\t\tJednoduch md (rovnak ako \"evim\", bezmdov)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tMd iba pre tanie (ako \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tObmedzen md (rovnak ako \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tZmeny (ukladanie sborov) zakzan" diff --git a/src/nvim/po/sk.po b/src/nvim/po/sk.po index 66b3d5abb1..d35622726f 100644 --- a/src/nvim/po/sk.po +++ b/src/nvim/po/sk.po @@ -3450,10 +3450,6 @@ msgstr "-y\t\t\tJednoduch md (rovnak ako \"evim\", bezmdov)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tMd iba pre tanie (ako \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tObmedzen md (rovnak ako \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tZmeny (ukladanie sborov) zakzan" diff --git a/src/nvim/po/sr.po b/src/nvim/po/sr.po index 4c157658e5..a93a2ec584 100644 --- a/src/nvim/po/sr.po +++ b/src/nvim/po/sr.po @@ -3028,9 +3028,6 @@ msgstr "-y\t\t\tEasy режим (као \"evim\", безрежимни)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tReadonly режим (као \"view\")" -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tRestricted режим (као \"rvim\")" - msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tИзмене (уписивање датотека) нису дозвољене" diff --git a/src/nvim/po/sv.po b/src/nvim/po/sv.po index db7bada888..d50c9d695d 100644 --- a/src/nvim/po/sv.po +++ b/src/nvim/po/sv.po @@ -5735,10 +5735,6 @@ msgstr "-y\t\t\tLtt lge (som \"evim\", lgesls)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tSkrivskyddat lge (som \"view\")" -#: ../main.c:2186 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tBegrnsat lge (som \"rvim\")" - #: ../main.c:2187 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tModifieringar (skriva filer) inte tilltet" diff --git a/src/nvim/po/uk.po b/src/nvim/po/uk.po index 604e425bd0..2a5cb54f7b 100644 --- a/src/nvim/po/uk.po +++ b/src/nvim/po/uk.po @@ -3367,9 +3367,6 @@ msgstr " -v, --version Надрукувати інформацію пр msgid " -V[N][file] Verbose [level][file]\n" msgstr " -V[N][файл] Більше повідомлень [рівень][файл]\n" -msgid " -Z Restricted mode\n" -msgstr " -Z Обмежений режим\n" - msgid " --api-info Write msgpack-encoded API metadata to stdout\n" msgstr "" " --api-info Записати метадані API, серіалізовані у msgpack, у " diff --git a/src/nvim/po/vi.po b/src/nvim/po/vi.po index a954ea6e34..c693f910d8 100644 --- a/src/nvim/po/vi.po +++ b/src/nvim/po/vi.po @@ -3479,10 +3479,6 @@ msgstr "-y\t\t\tChế độ đơn giản (giống \"evim\", không có chế đ msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\tChế độ chỉ đọc (giống \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tChế độ hạn chế (giống \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\tKhông có khả năng ghi nhớ thay đổi (ghi nhớ tập tin)" diff --git a/src/nvim/po/zh_CN.UTF-8.po b/src/nvim/po/zh_CN.UTF-8.po index 542157002a..1e329443ce 100644 --- a/src/nvim/po/zh_CN.UTF-8.po +++ b/src/nvim/po/zh_CN.UTF-8.po @@ -3427,10 +3427,6 @@ msgstr "-y\t\t\t容易模式 (同 \"evim\",无模式)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\t只读模式 (同 \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\t限制模式 (同 \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\t不可修改(写入文件)" diff --git a/src/nvim/po/zh_TW.UTF-8.po b/src/nvim/po/zh_TW.UTF-8.po index 6a11b5e669..c97f31ddcf 100644 --- a/src/nvim/po/zh_TW.UTF-8.po +++ b/src/nvim/po/zh_TW.UTF-8.po @@ -3482,10 +3482,6 @@ msgstr "-y\t\t\t簡易模式 (同 \"evim\", modeless)" msgid "-R\t\t\tReadonly mode (like \"view\")" msgstr "-R\t\t\t唯讀模式 (同 \"view\")" -#: ../main.c:2208 -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\t限制模式 (同 \"rvim\")" - #: ../main.c:2209 msgid "-m\t\t\tModifications (writing files) not allowed" msgstr "-m\t\t\t不可修改 (寫入檔案)" diff --git a/src/nvim/search.c b/src/nvim/search.c index 787a464070..2802da6f7f 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -4497,9 +4497,9 @@ find_pattern_in_path( regmatch_T regmatch; regmatch_T incl_regmatch; regmatch_T def_regmatch; - int matched = FALSE; - int did_show = FALSE; - int found = FALSE; + bool matched = false; + bool did_show = false; + bool found = false; int i; char_u *already = NULL; char_u *startp = NULL; @@ -4611,7 +4611,7 @@ find_pattern_in_path( } MSG_PUTS_TITLE(_("in path ---\n")); } - did_show = TRUE; + did_show = true; while (depth_displayed < depth && !got_int) { ++depth_displayed; for (i = 0; i < depth_displayed; i++) @@ -4761,10 +4761,10 @@ search_line: matched = !STRNCMP(startp, ptr, len); if (matched && define_matched && whole && vim_iswordc(startp[len])) - matched = FALSE; + matched = false; } else if (regmatch.regprog != NULL && vim_regexec(®match, line, (colnr_T)(p - line))) { - matched = TRUE; + matched = true; startp = regmatch.startp[0]; // Check if the line is not a comment line (unless we are // looking for a define). A line starting with "# define" @@ -4789,15 +4789,16 @@ search_line: if (matched && p[0] == '/' && (p[1] == '*' || p[1] == '/')) { - matched = FALSE; - /* After "//" all text is comment */ - if (p[1] == '/') + matched = false; + // After "//" all text is comment + if (p[1] == '/') { break; - ++p; + } + p++; } else if (!matched && p[0] == '*' && p[1] == '/') { - /* Can find match after "* /". */ - matched = TRUE; - ++p; + // Can find match after "* /". + matched = true; + p++; } } } @@ -4811,7 +4812,7 @@ search_line: if (depth == -1 && lnum == curwin->w_cursor.lnum) break; - found = TRUE; + found = true; aux = p = startp; if (compl_cont_status & CONT_ADDING) { p += compl_length; @@ -4879,9 +4880,10 @@ search_line: break; } } else if (action == ACTION_SHOW_ALL) { - found = TRUE; - if (!did_show) - gotocmdline(TRUE); /* cursor at status line */ + found = true; + if (!did_show) { + gotocmdline(true); // cursor at status line + } if (curr_fname != prev_fname) { if (did_show) msg_putchar('\n'); /* cursor below last one */ @@ -4890,28 +4892,28 @@ search_line: msg_home_replace_hl(curr_fname); prev_fname = curr_fname; } - did_show = TRUE; - if (!got_int) - show_pat_in_path(line, type, TRUE, action, - (depth == -1) ? NULL : files[depth].fp, - (depth == -1) ? &lnum : &files[depth].lnum, - match_count++); + did_show = true; + if (!got_int) { + show_pat_in_path(line, type, true, action, + (depth == -1) ? NULL : files[depth].fp, + (depth == -1) ? &lnum : &files[depth].lnum, + match_count++); + } /* Set matched flag for this file and all the ones that * include it */ for (i = 0; i <= depth; ++i) files[i].matched = TRUE; } else if (--count <= 0) { - found = TRUE; + found = true; if (depth == -1 && lnum == curwin->w_cursor.lnum - && l_g_do_tagpreview == 0 - ) + && l_g_do_tagpreview == 0) { EMSG(_("E387: Match is on current line")); - else if (action == ACTION_SHOW) { + } else if (action == ACTION_SHOW) { show_pat_in_path(line, type, did_show, action, - (depth == -1) ? NULL : files[depth].fp, - (depth == -1) ? &lnum : &files[depth].lnum, 1L); - did_show = TRUE; + (depth == -1) ? NULL : files[depth].fp, + (depth == -1) ? &lnum : &files[depth].lnum, 1L); + did_show = true; } else { /* ":psearch" uses the preview window */ if (l_g_do_tagpreview != 0) { @@ -4960,15 +4962,16 @@ search_line: break; } exit_matched: - matched = FALSE; - /* look for other matches in the rest of the line if we - * are not at the end of it already */ + matched = false; + // look for other matches in the rest of the line if we + // are not at the end of it already if (def_regmatch.regprog == NULL && action == ACTION_EXPAND && !(compl_cont_status & CONT_SOL) && *startp != NUL - && *(p = startp + utfc_ptr2len(startp)) != NUL) + && *(p = startp + utfc_ptr2len(startp)) != NUL) { goto search_line; + } } line_breakcheck(); if (action == ACTION_EXPAND) @@ -5046,16 +5049,20 @@ fpip_end: vim_regfree(def_regmatch.regprog); } -static void show_pat_in_path(char_u *line, int type, int did_show, int action, FILE *fp, linenr_T *lnum, long count) +static void show_pat_in_path(char_u *line, int type, bool did_show, int action, + FILE *fp, linenr_T *lnum, long count) + FUNC_ATTR_NONNULL_ARG(1, 6) { char_u *p; - if (did_show) - msg_putchar('\n'); /* cursor below last one */ - else if (!msg_silent) - gotocmdline(TRUE); /* cursor at status line */ - if (got_int) /* 'q' typed at "--more--" message */ + if (did_show) { + msg_putchar('\n'); // cursor below last one + } else if (!msg_silent) { + gotocmdline(true); // cursor at status line + } + if (got_int) { // 'q' typed at "--more--" message return; + } for (;; ) { p = line + STRLEN(line) - 1; if (fp != NULL) { diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 641e98ab30..c571e37ac3 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -1110,14 +1110,14 @@ func Test_BufReadCmd() endfunc func SetChangeMarks(start, end) - exe a:start. 'mark [' - exe a:end. 'mark ]' + exe a:start .. 'mark [' + exe a:end .. 'mark ]' endfunc " Verify the effects of autocmds on '[ and '] func Test_change_mark_in_autocmds() edit! Xtest - call feedkeys("ia\<CR>b\<CR>c\<CR>d\<C-g>u", 'xtn') + call feedkeys("ia\<CR>b\<CR>c\<CR>d\<C-g>u\<Esc>", 'xtn') call SetChangeMarks(2, 3) write diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim index aa36f4e518..180170fe9a 100644 --- a/src/nvim/testdir/test_filetype.vim +++ b/src/nvim/testdir/test_filetype.vim @@ -429,6 +429,7 @@ let s:filename_checks = { \ 'smith': ['file.smt', 'file.smith'], \ 'sml': ['file.sml'], \ 'snobol4': ['file.sno', 'file.spt'], + \ 'sparql': ['file.rq', 'file.sparql'], \ 'spec': ['file.spec'], \ 'spice': ['file.sp', 'file.spice'], \ 'spup': ['file.speedup', 'file.spdata', 'file.spd'], @@ -715,7 +716,7 @@ func Test_pp_file() call assert_equal('pascal', &filetype) bwipe! - call delete('Xfile.ts') + call delete('Xfile.pp') filetype off endfunc diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index ccc5e6ffc9..84d99ebb74 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -266,8 +266,14 @@ func Test_set_errors() call assert_fails('set foldmarker=x', 'E536:') call assert_fails('set commentstring=x', 'E537:') call assert_fails('set complete=x', 'E539:') + call assert_fails('set rulerformat=%-', 'E539:') + call assert_fails('set rulerformat=%(', 'E542:') + call assert_fails('set rulerformat=%15(%%', 'E542:') + call assert_fails('set statusline=%$', 'E539:') call assert_fails('set statusline=%{', 'E540:') call assert_fails('set statusline=%(', 'E542:') + call assert_fails('set statusline=%)', 'E542:') + if has('cursorshape') " This invalid value for 'guicursor' used to cause Vim to crash. call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:') @@ -281,6 +287,21 @@ func Test_set_errors() call assert_fails('set winminwidth=10 winwidth=9', 'E592:') call assert_fails("set showbreak=\x01", 'E595:') call assert_fails('set t_foo=', 'E846:') + if has('python') || has('python3') + call assert_fails('set pyxversion=6', 'E474:') + endif + call assert_fails("let &tabstop='ab'", 'E521:') + call assert_fails('set sessionoptions=curdir,sesdir', 'E474:') + call assert_fails('set foldmarker={{{,', 'E474:') + call assert_fails('set sessionoptions=sesdir,curdir', 'E474:') + call assert_fails('set listchars=trail:· ambiwidth=double', 'E834:') + set listchars& + call assert_fails('set fillchars=stl:· ambiwidth=double', 'E835:') + set fillchars& + call assert_fails('set fileencoding=latin1,utf-8', 'E474:') + set nomodifiable + call assert_fails('set fileencoding=latin1', 'E21:') + set modifiable& endfunc " Must be executed before other tests that set 'term'. diff --git a/src/nvim/testdir/test_sleep.vim b/src/nvim/testdir/test_sleep.vim new file mode 100644 index 0000000000..f71855fd4b --- /dev/null +++ b/src/nvim/testdir/test_sleep.vim @@ -0,0 +1,26 @@ +" Test for sleep and sleep! commands + +func! s:get_time_ms() + let timestr = reltimestr(reltime()) + let dotidx = stridx(timestr, '.') + let sec = str2nr(timestr[:dotidx]) + let msec = str2nr(timestr[dotidx + 1:]) + return (sec * 1000) + (msec / 1000) +endfunc + +func! s:assert_takes_longer(cmd, time_ms) + let start = s:get_time_ms() + execute a:cmd + let end = s:get_time_ms() + call assert_true(end - start >=# a:time_ms) +endfun + +func! Test_sleep_bang() + call s:assert_takes_longer('sleep 50m', 50) + call s:assert_takes_longer('sleep! 50m', 50) + call s:assert_takes_longer('sl 50m', 50) + call s:assert_takes_longer('sl! 50m', 50) + call s:assert_takes_longer('1sleep', 1000) +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |