aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Reed <m.reed@mykolab.com>2015-01-29 18:17:30 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-02-16 21:00:30 -0500
commitaf46564dd6e7e709f269f041f749dc312d9c3773 (patch)
tree6d39068330a2afd6cfad76aea8dc57bd9f10787b /src
parent3bb77befe502d3c526dd834f8df4f6c30e595bcf (diff)
downloadrneovim-af46564dd6e7e709f269f041f749dc312d9c3773.tar.gz
rneovim-af46564dd6e7e709f269f041f749dc312d9c3773.tar.bz2
rneovim-af46564dd6e7e709f269f041f749dc312d9c3773.zip
Remove 'edcompatible' #1911
Closes #1902
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.c21
-rw-r--r--src/nvim/option.c7
2 files changed, 14 insertions, 14 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 3143363af6..b03c25a098 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -3615,16 +3615,13 @@ void do_sub(exarg_T *eap)
/*
* Find trailing options. When '&' is used, keep old options.
*/
- if (*cmd == '&')
+ if (*cmd == '&') {
++cmd;
- else {
- if (!p_ed) {
- if (p_gd) /* default is global on */
- do_all = TRUE;
- else
- do_all = FALSE;
- do_ask = FALSE;
- }
+ } else {
+ // default is global on
+ do_all = p_gd ? TRUE : FALSE;
+
+ do_ask = FALSE;
do_error = TRUE;
do_print = FALSE;
do_count = false;
@@ -3632,10 +3629,8 @@ void do_sub(exarg_T *eap)
do_ic = 0;
}
while (*cmd) {
- /*
- * Note that 'g' and 'c' are always inverted, also when p_ed is off.
- * 'r' is never inverted.
- */
+ // Note that 'g' and 'c' are always inverted.
+ // 'r' is never inverted.
if (*cmd == 'g')
do_all = !do_all;
else if (*cmd == 'c')
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 182834c4f3..71d19e24f1 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4945,11 +4945,16 @@ set_bool_option (
if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
*(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = value;
+ // Ensure that compatible can not be enabled
if ((int *)varp == &p_cp && p_cp == TRUE) {
- /* Ensure that compatible can not be enabled */
p_cp = FALSE;
return e_unsupportedoption;
}
+ // Ensure that edcompatible can not be enabled
+ else if ((int *)varp == &p_ed && p_ed == TRUE) {
+ p_ed = FALSE;
+ return e_unsupportedoption;
+ }
/* 'undofile' */
else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf) {
/* Only take action when the option was set. When reset we do not