aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-02-19 16:46:44 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2018-06-13 10:11:35 +0200
commit050f3975f6b44da6316de189929625e1c382a6c8 (patch)
tree511a6cb5b025f8aa5432554b98773ddbc8627015
parentd8e18c96a904667ce60366be22dbdf248006ff2e (diff)
downloadrneovim-050f3975f6b44da6316de189929625e1c382a6c8.tar.gz
rneovim-050f3975f6b44da6316de189929625e1c382a6c8.tar.bz2
rneovim-050f3975f6b44da6316de189929625e1c382a6c8.zip
options: remove 'maxcombine` option (always use 6)
-rw-r--r--runtime/doc/mbyte.txt3
-rw-r--r--runtime/doc/options.txt14
-rw-r--r--runtime/doc/vim_diff.txt1
-rw-r--r--src/nvim/option.c8
-rw-r--r--src/nvim/options.lua3
-rw-r--r--test/functional/options/num_options_spec.lua15
-rw-r--r--test/functional/ui/fold_spec.lua5
7 files changed, 24 insertions, 25 deletions
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index 2d4a20ed72..d38c4fd019 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -1059,8 +1059,7 @@ widespread as file format.
A composing or combining character is used to change the meaning of the
character before it. The combining characters are drawn on top of the
preceding character.
-Up to two combining characters can be used by default. This can be changed
-with the 'maxcombine' option.
+Up to six combining characters can be displayed.
When editing text a composing character is mostly considered part of the
preceding character. For example "x" will delete a character and its
following composing characters by default.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 7ff1281274..3bc248c795 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -3888,16 +3888,10 @@ A jump table for the options with a short description can be found at |Q_op|.
set a time. This is to be compatible with Nvi.
*'maxcombine'* *'mco'*
-'maxcombine' 'mco' number (default 2)
- global
- {only available when compiled with the |+multi_byte|
- feature}
- The maximum number of combining characters supported for displaying.
- The default is OK for most languages. Hebrew may require 4.
- Maximum value is 6.
- Even when this option is set to 2 you can still edit text with more
- combining characters, you just can't see them. Use |g8| or |ga|.
- See |mbyte-combining|.
+'maxcombine' 'mco' Removed. |vim-differences| {Nvim}
+ Nvim always displays up to 6 combining characters. You can still edit
+ text with more than 6 combining characters, you just can't see them.
+ Use |g8| or |ga|. See |mbyte-combining|.
*'maxfuncdepth'* *'mfd'*
'maxfuncdepth' 'mfd' number (default 100)
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index 1af91f24da..9dd03079fe 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -409,6 +409,7 @@ Options:
*'macatsui'*
'maxmem' Nvim delegates memory-management to the OS.
'maxmemtot' Nvim delegates memory-management to the OS.
+ 'maxcombine' (6 is always used)
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
'shelltype'
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 882289c8b8..a7ee0ef28b 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4102,11 +4102,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
errmsg = e_winwidth;
}
} else if (pp == &p_mco) {
- if (value > MAX_MCO) {
- errmsg = e_invarg;
- } else if (value < 0) {
- errmsg = e_positive;
- }
+ value = MAX_MCO;
} else if (pp == &p_titlelen) {
if (value < 0) {
errmsg = e_positive;
@@ -4268,8 +4264,6 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0) {
parse_cino(curbuf);
}
- } else if (pp == &p_mco) {
- screenclear(); // will re-allocate the screen
} else if (pp == &curbuf->b_p_iminsert) {
showmode();
// Show/unshow value of 'keymap' in status lines.
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index 47c9f5aa78..30ddb977bb 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -1493,9 +1493,8 @@ return {
full_name='maxcombine', abbreviation='mco',
type='number', scope={'global'},
vi_def=true,
- redraw={'curswant'},
varname='p_mco',
- defaults={if_true={vi=2}}
+ defaults={if_true={vi=6}}
},
{
full_name='maxfuncdepth', abbreviation='mfd',
diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua
index ed17ffdd3c..fb0559054d 100644
--- a/test/functional/options/num_options_spec.lua
+++ b/test/functional/options/num_options_spec.lua
@@ -51,7 +51,6 @@ describe(':set validation', function()
should_succeed('winminheight', 0)
should_fail('winwidth', 0, 'E487')
should_fail('helpheight', -1, 'E487')
- should_fail('maxcombine', 7, 'E474')
should_fail('iminsert', 3, 'E474')
should_fail('imsearch', 3, 'E474')
should_fail('titlelen', -1, 'E487')
@@ -94,4 +93,18 @@ describe(':set validation', function()
feed_command('set winminwidth=3')
eq('E592', eval("v:errmsg"):match("E%d*"))
end)
+
+ it('set maxcombine resets to 6', function()
+ local function setto(value)
+ feed_command('setglobal maxcombine=' .. value)
+ feed_command('setlocal maxcombine=' .. value)
+ meths.set_option('maxcombine', value)
+ eq(6, meths.get_option('maxcombine'))
+ eq('', eval("v:errmsg"))
+ end
+ setto(0)
+ setto(1)
+ setto(6)
+ setto(7)
+ end)
end)
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 40089d217d..9c5a59b58d 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -27,9 +27,8 @@ describe("folded lines", function()
end)
it("works with multibyte text", function()
- -- Soon, we will always use the maximum value of 'maxcombine'.
- feed_command("set maxcombine=6")
-
+ -- Currently the only allowed value of 'maxcombine'
+ eq(6, meths.get_option('maxcombine'))
eq(true, meths.get_option('arabicshape'))
insert([[
å 语 x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢͟ العَرَبِيَّة