rcfile: accept also {}} in a string bind, for symmetry with {{}

This commit is contained in:
Benno Schulenberg 2025-07-31 16:12:42 +02:00
parent 121dd596d9
commit 1ee74172c2
2 changed files with 6 additions and 3 deletions

View File

@ -352,11 +352,14 @@ int get_code_from_plantation(void)
if (!closing)
return MISSING_BRACE;
if (plants_pointer[1] == '{' && plants_pointer[2] == '}') {
/* Handle the {{} sequence, and for symmetry accept {}} too. */
if (plants_pointer[1] == '{' || plants_pointer[1] == '}') {
if (plants_pointer[2] != '}')
return MISSING_BRACE;
plants_pointer += 3;
if (*plants_pointer != '\0')
put_back(MORE_PLANTS);
return '{';
return *(plants_pointer - 2);
}
free(commandname);

View File

@ -33,7 +33,7 @@ color crimson "\{(left|right|up|down|home|end|(scroll|page)(up|down)|(top|bottom
color crimson "\{(tab|enter|delete|backspace|verbatim|refresh|suspend|casesens|regexp|backwards|older|newer|(dos|mac)format)\}"
color crimson "\{(append|prepend|backup|flip(goto|replace|execute|pipe|convert|newbuffer)|browser|gotodir|(first|last)(file|line))\}"
color crimson "\{(nohelp|constantshow|softwrap|linenumbers|whitespacedisplay|nosyntax|zero)\}"
color crimson "\{(smarthome|autoindent|cutfromcursor|breaklonglines|tabstospaces|mouse|\{)\}"
color crimson "\{(smarthome|autoindent|cutfromcursor|breaklonglines|tabstospaces|mouse|\{|\})\}"
# Commands
color green "^[[:blank:]]*((un)?(bind|set)|include|syntax|header|magic|comment|formatter|linter|tabgives|extendsyntax)\>"