I have just completed #1768 
<https://github.com/leo-editor/leo-editor/issues/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 
<https://github.com/leo-editor/leo-editor/issues/1767>: (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

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8ed4f1d1-d03c-4677-9ba3-3607ca5d3a99n%40googlegroups.com.

Reply via email to