diff options
author | ZyX <kp-pav@yandex.ru> | 2017-10-30 00:49:12 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-10-30 00:49:12 +0300 |
commit | b29a776550dadefefb891d01054ea21eb942bad1 (patch) | |
tree | 799bb2c0e926a20ac5b1af262f0849208eae699a /src/nvim/ex_docmd.c | |
parent | 538af1c90a4ac9928f60e97338869e516def4956 (diff) | |
parent | 45296b331fa462eeabb141037ad10a3ad24ab8a6 (diff) | |
download | rneovim-b29a776550dadefefb891d01054ea21eb942bad1.tar.gz rneovim-b29a776550dadefefb891d01054ea21eb942bad1.tar.bz2 rneovim-b29a776550dadefefb891d01054ea21eb942bad1.zip |
Merge branch 'master' into expression-parser
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 664ab69792..3bcea4b666 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -9,6 +9,7 @@ #include <string.h> #include <stdbool.h> #include <stdint.h> +#include <stdlib.h> #include <inttypes.h> #include "nvim/vim.h" @@ -5996,7 +5997,7 @@ static void ex_quit(exarg_T *eap) */ static void ex_cquit(exarg_T *eap) { - getout(1); + getout(eap->addr_count > 0 ? (int)eap->line2 : EXIT_FAILURE); } /* @@ -9883,7 +9884,7 @@ static void ex_terminal(exarg_T *eap) /// Checks if `cmd` is "previewable" (i.e. supported by 'inccommand'). /// -/// @param[in] cmd Commandline to check. May start with a range. +/// @param[in] cmd Commandline to check. May start with a range or modifier. /// /// @return true if `cmd` is previewable bool cmd_can_preview(char_u *cmd) @@ -9892,6 +9893,12 @@ bool cmd_can_preview(char_u *cmd) return false; } + // Ignore any leading modifiers (:keeppatterns, :verbose, etc.) + for (int len = modifier_len(cmd); len != 0; len = modifier_len(cmd)) { + cmd += len; + cmd = skipwhite(cmd); + } + exarg_T ea; // parse the command line ea.cmd = skip_range(cmd, NULL); |