nedit-ng icon indicating copy to clipboard operation
nedit-ng copied to clipboard

Support a block style cursor

Open eteran opened this issue 6 years ago • 2 comments

Many people prefer a block style cursor similar to those found in console-based editors, we should support this.

eteran avatar Feb 22 '18 06:02 eteran

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.

sjtringali avatar Dec 26 '20 18:12 sjtringali

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.

  1. Where would the block be when inserting the very first character on a line? Off the screen?
  2. To be consistent with overtype modes, it makes sense to always view it as inserting on the left edge of the box

eteran avatar Dec 27 '20 22:12 eteran