diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-11-11 19:39:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 19:39:08 +0100 |
commit | 4875db2e56b395f47e3b9634b8c0a0e179fbe353 (patch) | |
tree | 756ad7dc5faa38b1c359bf92d8cf9426d13bf052 /src/nvim/ex_docmd.c | |
parent | 0a95549d66df63c06d775fcc329f7b63cbb46b2f (diff) | |
parent | 7777532cebcfa9abc5ab2c7beae77f386feed3ca (diff) | |
download | rneovim-4875db2e56b395f47e3b9634b8c0a0e179fbe353.tar.gz rneovim-4875db2e56b395f47e3b9634b8c0a0e179fbe353.tar.bz2 rneovim-4875db2e56b395f47e3b9634b8c0a0e179fbe353.zip |
Merge pull request #11996 from georg3tom/remove_restricted
Removed restricted mode - Fix #11972
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 60963f5411..a491a9d377 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1503,10 +1503,6 @@ static char_u * do_one_cmd(char_u **cmdlinep, errormsg = (char_u *)_(e_sandbox); goto doend; } - if (restricted != 0 && (ea.argt & RESTRICT)) { - errormsg = (char_u *)_("E981: Command not allowed in restricted mode"); - goto doend; - } if (!MODIFIABLE(curbuf) && (ea.argt & MODIFY) // allow :put in terminals && (!curbuf->terminal || ea.cmdidx != CMD_put)) { @@ -6624,25 +6620,22 @@ static void ex_hide(exarg_T *eap) /// ":stop" and ":suspend": Suspend Vim. static void ex_stop(exarg_T *eap) { - // Disallow suspending in restricted mode (-Z) - if (!check_restricted()) { - if (!eap->forceit) { - autowrite_all(); - } - apply_autocmds(EVENT_VIMSUSPEND, NULL, NULL, false, NULL); + if (!eap->forceit) { + autowrite_all(); + } + apply_autocmds(EVENT_VIMSUSPEND, NULL, NULL, false, NULL); - // TODO(bfredl): the TUI should do this on suspend - ui_cursor_goto(Rows - 1, 0); - ui_call_grid_scroll(1, 0, Rows, 0, Columns, 1, 0); - ui_flush(); - ui_call_suspend(); // call machine specific function + // TODO(bfredl): the TUI should do this on suspend + ui_cursor_goto(Rows - 1, 0); + ui_call_grid_scroll(1, 0, Rows, 0, Columns, 1, 0); + ui_flush(); + ui_call_suspend(); // call machine specific function - ui_flush(); - maketitle(); - resettitle(); // force updating the title - ui_refresh(); // may have resized window - apply_autocmds(EVENT_VIMRESUME, NULL, NULL, false, NULL); - } + ui_flush(); + maketitle(); + resettitle(); // force updating the title + ui_refresh(); // may have resized window + apply_autocmds(EVENT_VIMRESUME, NULL, NULL, false, NULL); } // ":exit", ":xit" and ":wq": Write file and quite the current window. |