bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] Enhancement/Feature: Delayed Cursor Movement on Field Edge/Bound


From: Leon Winter
Subject: [Patch] Enhancement/Feature: Delayed Cursor Movement on Field Edge/Boundary
Date: Fri, 13 Apr 2018 11:41:04 +0200
User-agent: Mutt/1.9.4 (2018-02-28)

Hi Thomas,

currently when entering data into fields the cursor position (in insert mode) is
advanced by one position after a character is inserted. If we are reaching the
end of the field, scrolling is applied so that the cursor position is always
inside the field boundary. This behavior makes it clear at which position the
next character will be put but is has a certain disadvantage:
At the boundary we lose one character of displayed information (which is
scrolled out). This problem is especially bad when the field is only one
character in width. When inserting we never see the input since the cursor is
immediately advanced. We can manually scroll back to verify the input (which is
cumbersome).
Other non-ncurses terminal application have come up with a different approach.
When inserting before the boundary, the cursor is not immediately advanced but
it stays. This way we can see the input of fields with width=1. Unfortunately
the in this state the user cannot infer the exact state by visual inspection
since the cursor is diplayed on the last character he might assume the next
character will be inserted before the displayed character (in insert mode).
Since the ncurses scrolling and cursor setting is split up I accidentally came
up with a somewhat combined approach:
When inserting up to the boundary position we just delay the scrolling, so the
last inserted character will remain visible but still then still advance the
cursor (in this case then one character outside of the field boundary). This
might seem strange at first but provides both the advantage of seeing the
inserted character in one-character fields as well as knowing what the internal
state is and where the next character will be inserted.
I am aware that probably many people do not care about this cornercase but we
do. I implemented the aforementioned new behavior with a new field_opt. See
patch attached.

Regards,
Leon

Attachment: ncurses-insert-boundary-scroll-cursor.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]