<Del> and composing characters in Insert mode with 'delcombine' on : Bug or feature ?

7 views
Skip to first unread message

Tony Mechelynck

unread,
Feb 27, 2024, 5:06:21 PM2/27/24
to vim_dev
In Insert mode with 'delcombine' set, when the cursor is in a screen
cell containing not only a spacing character but also one or more
combining characters (or, in gvim, seems to be between that screen
cell and the one before it) <Del> skips the spacing character and
removes a composing character (I haven't checked if it removes the
first one, the last one, or all of them). Now :help 'delcombine'
doesn't mention the <Del> key. It does mention "Normal-mode x"
however, so the fact that the <Del> key acts likewise in Normal mode
can be inferred from the stated fact (under ":h <Del>") that there it
is equivalent to x or dl. But in Insert mode, x as a delete command
doesn't exist (except as Ctrl-O x which brings us temporarily into
Normal mode) and according to ":help i_<Del>" <Del> deletes "the
character under the cursor"; repeated keypresses delete (in the
plain-vanilla case where only spacing characters are present)
successive characters going forward.

The meaning of the word "character" here is ambiguous: are the spacing
character and all its possible combining characters regarded as one
"character" or are they treated severally when 'delcombine' is on? And
in the second case, shouldn't the fact that <Del> actually goes
backward in the buffer (removing the composing character first and the
spacing character afterwards) be documented somewhere (either under
":h i_<Del>" or –maybe preferably– by mentioning <Del> under ":h
'delcombine'", or both)?

Or else (if this is regarded as a bug –or a coding bug– rather than a
feature –or documentation bug–) shouldn't Insert-mode <Del> remove the
spacing character and all its possible composing characters together
regardless of 'delcombine', unlike what x (and, by implication only,
<Del>) is documented to do in Normal mode, but like what <Del> now
does (at patchlevel 9.1.137 and later) in Command-line mode?

This Insert-mode behaviour existed at patchlevel 9.1.136 and remains
so at patchlevel 9.1.140 so patch 9.1.137 had no effect on it.

I tested this in Cyrillic script because my owncoded Russian keymap
can easily produce a "combining acute accent" but I expect gvim (or
Console Vim if the underlying console knows about composing
characters) to behave identically with any composing characters in any
script.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages