nedit-ng
nedit-ng copied to clipboard
Support a block style cursor
Many people prefer a block style cursor similar to those found in console-based editors, we should support this.
We do have one, but it's used to indicate insert mode. That said, terminals are not text editors, so it's really standard to use a cursor that's between characters, and unambiguous. With a box, you need to guess whether it's left or right biased.
I certainly agree that it's more common in terminals than editors, but many popular editors do have this feature. Especially people who like a tiny font, but don't like a "thick" cursor.
Sadly, NEdit's existing block cursor can't be easily made to deal with being a normal cursor just because of the drawing algorithm used. (I believe we draw the background, the box, then the character). This works fine for an empty box, but a full box that should invert the colors of the character it is on top of makes this a lot harder since the box has already been drawn.
To answer your concerns about left or right based, I believe the common convention is that the block's left edge represents where the character will insert (assuming a left-to-right language).
It almost has to be this way for a couple of reasons.
- Where would the block be when inserting the very first character on a line? Off the screen?
- To be consistent with overtype modes, it makes sense to always view it as inserting on the left edge of the box