options: remove 'maxcombine` option (always use 6)

This commit is contained in:
Björn Linse 2018-02-19 16:46:44 +01:00
parent d8e18c96a9
commit 050f3975f6
7 changed files with 24 additions and 25 deletions

View File

@ -1059,8 +1059,7 @@ widespread as file format.
A composing or combining character is used to change the meaning of the 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 character before it. The combining characters are drawn on top of the
preceding character. preceding character.
Up to two combining characters can be used by default. This can be changed Up to six combining characters can be displayed.
with the 'maxcombine' option.
When editing text a composing character is mostly considered part of the When editing text a composing character is mostly considered part of the
preceding character. For example "x" will delete a character and its preceding character. For example "x" will delete a character and its
following composing characters by default. following composing characters by default.

View File

@ -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. set a time. This is to be compatible with Nvi.
*'maxcombine'* *'mco'* *'maxcombine'* *'mco'*
'maxcombine' 'mco' number (default 2) 'maxcombine' 'mco' Removed. |vim-differences| {Nvim}
global Nvim always displays up to 6 combining characters. You can still edit
{only available when compiled with the |+multi_byte| text with more than 6 combining characters, you just can't see them.
feature} Use |g8| or |ga|. See |mbyte-combining|.
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|.
*'maxfuncdepth'* *'mfd'* *'maxfuncdepth'* *'mfd'*
'maxfuncdepth' 'mfd' number (default 100) 'maxfuncdepth' 'mfd' number (default 100)

View File

@ -409,6 +409,7 @@ Options:
*'macatsui'* *'macatsui'*
'maxmem' Nvim delegates memory-management to the OS. 'maxmem' Nvim delegates memory-management to the OS.
'maxmemtot' Nvim delegates memory-management to the OS. 'maxmemtot' Nvim delegates memory-management to the OS.
'maxcombine' (6 is always used)
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'* *'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
'shelltype' 'shelltype'
*'shortname'* *'sn'* *'noshortname'* *'nosn'* *'shortname'* *'sn'* *'noshortname'* *'nosn'*

View File

@ -4102,11 +4102,7 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
errmsg = e_winwidth; errmsg = e_winwidth;
} }
} else if (pp == &p_mco) { } else if (pp == &p_mco) {
if (value > MAX_MCO) { value = MAX_MCO;
errmsg = e_invarg;
} else if (value < 0) {
errmsg = e_positive;
}
} else if (pp == &p_titlelen) { } else if (pp == &p_titlelen) {
if (value < 0) { if (value < 0) {
errmsg = e_positive; 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) { if (pp == &curbuf->b_p_sw || curbuf->b_p_sw == 0) {
parse_cino(curbuf); parse_cino(curbuf);
} }
} else if (pp == &p_mco) {
screenclear(); // will re-allocate the screen
} else if (pp == &curbuf->b_p_iminsert) { } else if (pp == &curbuf->b_p_iminsert) {
showmode(); showmode();
// Show/unshow value of 'keymap' in status lines. // Show/unshow value of 'keymap' in status lines.

View File

@ -1493,9 +1493,8 @@ return {
full_name='maxcombine', abbreviation='mco', full_name='maxcombine', abbreviation='mco',
type='number', scope={'global'}, type='number', scope={'global'},
vi_def=true, vi_def=true,
redraw={'curswant'},
varname='p_mco', varname='p_mco',
defaults={if_true={vi=2}} defaults={if_true={vi=6}}
}, },
{ {
full_name='maxfuncdepth', abbreviation='mfd', full_name='maxfuncdepth', abbreviation='mfd',

View File

@ -51,7 +51,6 @@ describe(':set validation', function()
should_succeed('winminheight', 0) should_succeed('winminheight', 0)
should_fail('winwidth', 0, 'E487') should_fail('winwidth', 0, 'E487')
should_fail('helpheight', -1, 'E487') should_fail('helpheight', -1, 'E487')
should_fail('maxcombine', 7, 'E474')
should_fail('iminsert', 3, 'E474') should_fail('iminsert', 3, 'E474')
should_fail('imsearch', 3, 'E474') should_fail('imsearch', 3, 'E474')
should_fail('titlelen', -1, 'E487') should_fail('titlelen', -1, 'E487')
@ -94,4 +93,18 @@ describe(':set validation', function()
feed_command('set winminwidth=3') feed_command('set winminwidth=3')
eq('E592', eval("v:errmsg"):match("E%d*")) eq('E592', eval("v:errmsg"):match("E%d*"))
end) 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) end)

View File

@ -27,9 +27,8 @@ describe("folded lines", function()
end) end)
it("works with multibyte text", function() it("works with multibyte text", function()
-- Soon, we will always use the maximum value of 'maxcombine'. -- Currently the only allowed value of 'maxcombine'
feed_command("set maxcombine=6") eq(6, meths.get_option('maxcombine'))
eq(true, meths.get_option('arabicshape')) eq(true, meths.get_option('arabicshape'))
insert([[ insert([[
å x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢͟ العَرَبِيَّة å x̨̣̘̫̲͚͎̎͂̀̂͛͛̾͢͟ العَرَبِيَّة