diff options
author | Josh Leeb-du Toit <josh.leebdutoit@gmail.com> | 2017-09-29 01:12:56 +1000 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-10-22 13:02:31 +0200 |
commit | 9db42d4ce99c5b5747e9d83045b37e93d55c4249 (patch) | |
tree | 2914d827644bef6bd69ad961da686c300953bb2c /src | |
parent | bead15f10dbdd71c0091bbfa18ec0aab9b8b2e82 (diff) | |
download | rneovim-9db42d4ce99c5b5747e9d83045b37e93d55c4249.tar.gz rneovim-9db42d4ce99c5b5747e9d83045b37e93d55c4249.tar.bz2 rneovim-9db42d4ce99c5b5747e9d83045b37e93d55c4249.zip |
:cquit : take an error code argument #7336
closes #2699
ex_cmds.lua: use flags consistent with similar commands such as `cnext`.
upstream discussion:
"[patch] :qcuit can take exit code"
https://groups.google.com/d/msg/vim_dev/_PjyNbUKyRc/oPgr5_ZXc6AJ
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.lua | 2 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index f99954db7a..e57e662039 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -620,7 +620,7 @@ return { }, { command='cquit', - flags=bit.bor(TRLBAR, BANG), + flags=bit.bor(RANGE, NOTADR, COUNT, ZEROR, TRLBAR, BANG), addr_type=ADDR_LINES, func='ex_cquit', }, diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 3130747e08..f64c9fded8 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" @@ -5995,7 +5996,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); } /* |