diff options
54 files changed, 249 insertions, 197 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34c3b2b4bb..44a911b21b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: brew unlink gcc@8 gcc@9 brew update >/dev/null brew upgrade - brew install automake ccache cpanminus ninja + brew install automake ccache perl cpanminus ninja - name: Setup interpreter packages run: | @@ -46,7 +46,7 @@ Install from package Pre-built packages for Windows, macOS, and Linux are found on the [Releases](https://github.com/neovim/neovim/releases/) page. -[Managed packages] are in Homebrew, [Debian], [Ubuntu], [Fedora], [Arch Linux], +[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Gentoo], and more! Install from source @@ -137,5 +137,6 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the [Fedora]: https://apps.fedoraproject.org/packages/neovim [Arch Linux]: https://www.archlinux.org/packages/?q=neovim [Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim +[Homebrew]: https://formulae.brew.sh/formula/neovim <!-- vim: set tw=80: --> diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 17de1d8533..172821ac28 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1543,6 +1543,8 @@ tag command action ~ |:sign| :sig[n] manipulate signs |:silent| :sil[ent] run a command silently |:sleep| :sl[eep] do nothing for a few seconds +|:sleep!| :sl[eep]! do nothing for a few seconds, without the + cursor visible |:slast| :sla[st] split window and go to last file in the argument list |:smagic| :sm[agic] :substitute with 'magic' diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 193593be13..772afdcc1a 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -639,8 +639,9 @@ client() *vim.lsp.client* automatically escalate and force shutdown. • is_stopped() Checks whether a client is stopped. Returns: true if the client is fully stopped. - • on_attach(client, bufnr) Runs the on_attach function from the - client's config if it was defined. Useful for buffer-local setup. + • on_attach(client, bufnr) Runs the on_attach function from + the client's config if it was defined. Useful for + buffer-local setup. • Members • {id} (number): The id allocated to the client. @@ -776,8 +777,9 @@ start_client({config}) *vim.lsp.start_client()* {handlers} Map of language server method names to |lsp-handler| {settings} Map with language server specific - settings. These are returned to the language server if - requested via `workspace/configuration`. Keys are + settings. These are returned to the + language server if requested via + `workspace/configuration` . Keys are case-sensitive. {init_options} Values to pass in the initialization request as `initializationOptions` . @@ -815,7 +817,14 @@ start_client({config}) *vim.lsp.start_client()* `capabilities.offsetEncoding` was sent to it. You can only modify the `client.offset_encoding` here before - any notifications are sent. + any notifications are sent. Most + language servers expect to be sent + client specified settings after + initialization. Neovim does not make + this assumption. A + `workspace/didChangeConfiguration` + notification should be sent to the + server during on_init. {on_exit} Callback (code, signal, client_id) invoked on client exit. • code: exit code of the process @@ -1342,6 +1351,10 @@ set_signs({diagnostics}, {bufnr}, {client_id}, {sign_ns}, {opts}) {sign_ns} number|nil {opts} table Configuration for signs. Keys: • priority: Set the priority of the signs. + • severity_limit (DiagnosticSeverity): + • Limit severity of diagnostics found. + E.g. "Warning" means { "Error", + "Warning" } will be valid. *vim.lsp.diagnostic.set_underline()* set_underline({diagnostics}, {bufnr}, {client_id}, {diagnostic_ns}, {opts}) @@ -1420,7 +1433,16 @@ show_line_diagnostics({opts}, {bufnr}, {line_nr}, {client_id}) {client_id} number|nil the client id Return: ~ - {popup_bufnr, win_id} + table {popup_bufnr, win_id} + + +============================================================================== +Lua module: vim.lsp.handlers *lsp-handlers* + + *vim.lsp.handlers.progress_callback()* +progress_callback({_}, {_}, {params}, {client_id}) + See also: ~ + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand ============================================================================== @@ -1615,6 +1637,9 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()* See also: ~ |softtabstop| +get_progress_messages() *vim.lsp.util.get_progress_messages()* + TODO: Documentation + jump_to_location({location}) *vim.lsp.util.jump_to_location()* Jumps to a location. @@ -1636,6 +1661,19 @@ locations_to_items({locations}) *vim.lsp.util.locations_to_items()* Return: ~ (table) list of items +lookup_section({settings}, {section}) *vim.lsp.util.lookup_section()* + Helper function to return nested values in language server + settings + + Parameters: ~ + {settings} a table of language server settings + {section} a string indicating the field of the settings + table + + Return: ~ + (table or string) The value of settings accessed via + section + *vim.lsp.util.make_floating_popup_options()* make_floating_popup_options({width}, {height}, {opts}) Creates a table with sensible default options for a floating diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a03de10a17..0bbed56662 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -622,6 +622,9 @@ vim.api.{func}({...}) *vim.api* Example: call the "nvim_get_current_line()" API function: > print(tostring(vim.api.nvim_get_current_line())) +vim.version() *vim.version* + Returns the version of the current neovim build. + vim.in_fast_event() *vim.in_fast_event()* Returns true if the code is executing as part of a "fast" event handler, where most of the API is disabled. These are low-level events @@ -1262,14 +1265,12 @@ validate({opt}) *vim.validate()* vim.validate{arg1={{'foo'}, 'table'}, arg2={'foo', 'string'}} => NOP (success) -< -> - vim.validate{arg1={1, 'table'}} - => error('arg1: expected table, got number') -< -> - vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}} - => error('arg1: expected even number, got 3') + + vim.validate{arg1={1, 'table'}} + => error('arg1: expected table, got number') + + vim.validate{arg1={3, function(a) return (a % 2) == 0 end, 'even number'}} + => error('arg1: expected even number, got 3') < Parameters: ~ diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 48b9aad58b..4a99aa47bf 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1316,8 +1316,9 @@ file when reading and include: ============================================================================== Standard Paths *standard-path* -Nvim stores configuration and data in standard locations. Plugins are strongly -encouraged to follow this pattern also. Use |stdpath()| to get the paths. +Nvim stores configuration, data, and logs in standard locations. Plugins are +strongly encouraged to follow this pattern also. Use |stdpath()| to get the +paths. *base-directories* *xdg* The "base" (root) directories conform to the XDG Base Directory Specification. @@ -1342,8 +1343,8 @@ LOG FILE *$NVIM_LOG_FILE* Besides 'debug' and 'verbose', Nvim keeps a general log file for internal debugging, plugins and RPC clients. > :echo $NVIM_LOG_FILE -Usually the file is ~/.cache/nvim/log unless that path is inaccessible -or if $NVIM_LOG_FILE was set before |startup|. +By default, the file is located at stdpath('cache')/log unless that path +is inaccessible or if $NVIM_LOG_FILE was set before |startup|. vim:noet:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index b6885d6e25..5fb7c4ce50 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -489,12 +489,12 @@ gO Show a filetype-specific, navigable "outline" of the Currently works in |help| and |:Man| buffers. [N]gs *gs* *:sl* *:sleep* -:[N]sl[eep] [N] [m] Do nothing for [N] seconds, or [N] milliseconds if [m] +:[N]sl[eep] [N][m] Do nothing for [N] seconds, or [N] milliseconds if [m] was given. "gs" always uses seconds. Default is one second. > :sleep "sleep for one second :5sleep "sleep for five seconds - :sleep 100m "sleep for a hundred milliseconds + :sleep 100m "sleep for 100 milliseconds 10gs "sleep for ten seconds < Can be interrupted with CTRL-C. "gs" stands for "goto sleep". diff --git a/runtime/filetype.vim b/runtime/filetype.vim index ba81a3348e..9104519451 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1620,6 +1620,9 @@ au BufNewFile,BufRead *.mib,*.my setf mib au BufNewFile,BufRead *.hog,snort.conf,vision.conf setf hog au BufNewFile,BufRead *.rules call dist#ft#FTRules() +" SPARQL queries +au BufNewFile,BufRead *.rq,*.sparql setf sparql + " Spec (Linux RPM) au BufNewFile,BufRead *.spec setf spec diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 1a814f5b6c..64d08e9733 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -226,6 +226,7 @@ local function validate_client_config(config) on_error = { config.on_error, "f", true }; on_exit = { config.on_exit, "f", true }; on_init = { config.on_init, "f", true }; + settings = { config.settings, "t", true }; before_init = { config.before_init, "f", true }; offset_encoding = { config.offset_encoding, "s", true }; flags = { config.flags, "t", true }; @@ -399,6 +400,10 @@ end --- --@param handlers Map of language server method names to |lsp-handler| --- +--@param settings Map with language server specific settings. These are +--- returned to the language server if requested via `workspace/configuration`. +--- Keys are case-sensitive. +--- --@param init_options Values to pass in the initialization request --- as `initializationOptions`. See `initialize` in the LSP spec. --- @@ -425,7 +430,10 @@ end --- the server may send. For example, clangd sends --- `initialize_result.offsetEncoding` if `capabilities.offsetEncoding` was --- sent to it. You can only modify the `client.offset_encoding` here before ---- any notifications are sent. +--- any notifications are sent. Most language servers expect to be sent client specified settings after +--- initialization. Neovim does not make this assumption. A +--- `workspace/didChangeConfiguration` notification should be sent +--- to the server during on_init. --- --@param on_exit Callback (code, signal, client_id) invoked on client --- exit. @@ -458,6 +466,7 @@ function lsp.start_client(config) local cmd, cmd_args, offset_encoding = cleaned_config.cmd, cleaned_config.cmd_args, cleaned_config.offset_encoding config.flags = config.flags or {} + config.settings = config.settings or {} local client_id = next_client_id() @@ -582,12 +591,19 @@ function lsp.start_client(config) local valid_traces = { off = 'off'; messages = 'messages'; verbose = 'verbose'; } + local version = vim.version() local initialize_params = { -- The process Id of the parent process that started the server. Is null if -- the process has not been started by another process. If the parent -- process is not alive then the server should exit (see exit notification) -- its process. processId = uv.getpid(); + -- Information about the client + -- since 3.15.0 + clientInfo = { + name = "Neovim", + version = string.format("%s.%s.%s", version.major, version.minor, version.patch) + }; -- The rootPath of the workspace. Is null if no folder is open. -- -- @deprecated in favour of rootUri. diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua index 87f35363b1..7eac3febd9 100644 --- a/runtime/lua/vim/lsp/handlers.lua +++ b/runtime/lua/vim/lsp/handlers.lua @@ -97,6 +97,18 @@ M['window/showMessageRequest'] = function(_, _, params) end end +--@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#client_registerCapability +M['client/registerCapability'] = function(_, _, _, client_id) + local warning_tpl = "The language server %s triggers a registerCapability ".. + "handler despite dynamicRegistration set to false. ".. + "Report upstream, this warning is harmless" + local client = vim.lsp.get_client_by_id(client_id) + local client_name = client and client.name or string.format("id=%d", client_id) + local warning = string.format(warning_tpl, client_name) + log.warn(warning) + return vim.NIL +end + --@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction M['textDocument/codeAction'] = function(_, _, actions) if actions == nil or vim.tbl_isempty(actions) then @@ -150,6 +162,7 @@ M['workspace/configuration'] = function(err, _, params, client_id) local client = vim.lsp.get_client_by_id(client_id) if not client then err_message("LSP[id=", client_id, "] client has shut down after sending the message") + return end if err then error(vim.inspect(err)) end if not params.items then diff --git a/runtime/nvim.appdata.xml b/runtime/nvim.appdata.xml index 025de1b5a9..e99c76a930 100644 --- a/runtime/nvim.appdata.xml +++ b/runtime/nvim.appdata.xml @@ -26,6 +26,7 @@ </screenshots> <releases> + <release date="2020-08-04" version="0.4.4"/> <release date="2019-11-06" version="0.4.3"/> <release date="2019-09-15" version="0.4.2"/> <release date="2019-09-15" version="0.4.1"/> 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 diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index 12a31b592d..eb5e284385 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -233,13 +233,6 @@ describe('startup defaults', function() }}) eq(xdgcachedir..'/log', string.gsub(eval('$NVIM_LOG_FILE'), '\\', '/')) end) - it('defaults to .nvimlog if stdpath("cache") is invalid', function() - clear({env={ - XDG_CACHE_HOME='Xtest-missing-xdg-dir', - NVIM_LOG_FILE='.', -- Any directory is invalid. - }}) - eq('.nvimlog', eval('$NVIM_LOG_FILE')) - end) end) end) diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index e8caa05260..41fdf845df 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -303,6 +303,21 @@ describe('LSP', function() end; } end) + it('workspace/configuration returns NIL per section if client was started without config.settings', function() + fake_lsp_server_setup('workspace/configuration no settings') + eq({ + NIL, + NIL, + }, exec_lua [[ + local params = { + items = { + {section = 'foo'}, + {section = 'bar'}, + } + } + return vim.lsp.handlers['workspace/configuration'](nil, nil, params, TEST_RPC_CLIENT_ID) + ]]) + end) it('should verify capabilities sent', function() local expected_callbacks = { |