I have just completed
#1768: Change the text cursor in command mode. The code appears in the ekr-vim branch, which is still under development. I plan to complete
#1757: (vim bindings) later today.
Emulating how vim draws the cursor is crucial, because the cursor clearly distinguishes between command and insert modes.
The new code cost me a full day of difficult coding. Googling, googling, and more googling convinces me that it is virtually impossible in Qt to draw the cursor exactly as vim does. Indeed, the Qt draws the cursor in a private class.
Happily, the workaround is plenty good enough. Vim:
- command mode: block cursor.
- insert mode: underline cursor.
Leo:
- command mode: A box surrounds the cursor.
The width of the cursor (and box) is the font's average character width.
- insert mode: Show a thin (vertical) cursor, as always.
As before, @bool qt-cursor-width = 1 determines the width of the vertical cursor.
Summary
Leo now draws a vim-like box cursor in command mode.
This is a surprisingly important milestone in Leo's support for vim.
The new code is in the ekr-vim branch.
Edward