Monday, March 4, 2013

New Line Change Detection – Backspace

A check for the backspace key was originally added to catch the situation where a backspace at the beginning of a line combines the line with the previous line, causing the current line to be deleted.  There were a number of conditions that needed to handled that eventually the functionality was put into a separate function (for details, see posts on January 30, February 3, February 6, February 7, and February 9).

The document changed slot function now handles this backspace operation, so the backspace key no longer needs to be checked for and the backspace function was removed.  However, there is a situation with the backspace that is not yet being handled correctly (that was by the backspace function), specifically if a backspace at the beginning of the line occurs on a line currently marked as a new line not yet inserted.  The line is currently reported as being deleted (but was not yet actually inserted).

There are a number of other situations where the modified line is marked as inserted that are not being handled properly by the document changed function.  One case, this function is incorrectly marking the line as newly inserted if the cursor is at the end of the line after the document change.  This is correct only for some situations.  These issues will be addressed next.

[commit 9b1d127f93]