Menu

#554 TCoolEdit::DeleteWordBack fails

8
pending
1
2026-03-31
2023-09-12
No

TCoolEdit::DeleteWordBack sometimes fails. This can be observed in the OWLMaker editor: If you are not within or at the end of a word, then Ctrl+Backspace (DeleteWordBack) does nothing in Release mode and fails with a precondition in Debug mode:

Precondition failed in "cooledit.cpp" at line 1740 []: startPos.row < endPos.row || (startPos.row == endPos.row && startPos.col < endPos.col)

The precondition resides in TCoolFileBuffer::GetText.

In both build modes, an Undo-node is added that does nothing (i.e. so pressing Ctrl+Z after the failed Ctrl+Backspace does nothing).

This is reproducible anywhere in the text, except when the cursor is at column 1 or 2 (index 0 or 1). At column 1 the preceding line-break is deleted, if not at line 1 (index 0). And at column 2 (index 1) any character at the start of the line is deleted, whether or not it is a word character.

Note on proper behaviour

In the Visual Studio editor, Ctrl+Backspace will delete any whitespace to the left, then any word or token (such "<<" or "++"). If the whitespace extends to the beginning of the line, it will stop there, but a second Ctrl+Backspace will delete the preceding line-break, if any, and proceed as if you issued the command at the end of the preceding line. If already within a word or token, just the part of it to the left is deleted.

Also, note that TCoolEdit::DeleteWord (to the right) will delete all non-word characters to the right up until the next word. For symmetry, this simple behaviour may be implemented for DeleteWordBack as well, rather than the more complex behaviour in Visual Studio.

Related

Bugs: #556
Feature Requests: #252
Wiki: OWLNext_Roadmap_and_Prereleases

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2023-09-14
    • status: open --> pending
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2023-09-14

    This issue has now been fixed [r6563] [r6564].

     

    Related

    Commit: [r6563]
    Commit: [r6564]

  • Vidar Hasfjord

    Vidar Hasfjord - 2025-10-04
    • Status: pending --> closed
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2026-03-31
    • Status: closed --> pending
     

Log in to post a comment.

MongoDB Logo MongoDB