Text input: Ctrl+Backspace deletes the previous word (and Ctrl+Delete the next word) #583

Closed
opened 2026-10-09 02:02:25 +00:00 by sky_line · 1 comment
Owner

Ctrl+Backspace should delete the whole word before the cursor, and Ctrl+Delete the word after it, as in browsers, editors and other viewers. Today both keys delete a single character.

Where

  • LLLineEditor::handleSpecialKey (indra/llui/lllineeditor.cpp, KEY_BACKSPACE ~1432, KEY_DELETE) covers single-line fields: chat bar, IM input, search fields, names/descriptions.
  • LLTextEditor (indra/llui/lltexteditor.cpp, KEY_BACKSPACE ~1899) covers multi-line text: notecards, LSL editor, profile text.
  • Both classes already have prevWordPos()/nextWordPos(), which Ctrl+Left/Right uses, so word boundaries match cursor movement.

Behaviour

  • Ctrl+Backspace: delete from prevWordPos(cursor) to the cursor.
  • Ctrl+Delete: delete from the cursor to nextWordPos(cursor).
  • With a selection: delete the selection, as plain Backspace does.
  • Undo: each word deletion is one undo step.
  • Read-only fields: respect them.
  • Password fields: delete the whole field or fall back to a character delete. Don't reveal word boundaries.
  • Shortcut conflicts: check that Ctrl+Backspace isn't already bound in the keybindings (llkeyconflict / key bindings XML) for a viewer action that should take priority while a text field has focus.

Done when

  • Ctrl+Backspace and Ctrl+Delete delete whole words in chat, IM, notecards and the script editor.
  • Undo restores the deleted text.
Ctrl+Backspace should delete the whole word before the cursor, and Ctrl+Delete the word after it, as in browsers, editors and other viewers. Today both keys delete a single character. ## Where - `LLLineEditor::handleSpecialKey` (`indra/llui/lllineeditor.cpp`, `KEY_BACKSPACE` ~1432, `KEY_DELETE`) covers single-line fields: chat bar, IM input, search fields, names/descriptions. - `LLTextEditor` (`indra/llui/lltexteditor.cpp`, `KEY_BACKSPACE` ~1899) covers multi-line text: notecards, LSL editor, profile text. - Both classes already have `prevWordPos()`/`nextWordPos()`, which Ctrl+Left/Right uses, so word boundaries match cursor movement. ## Behaviour - **Ctrl+Backspace:** delete from `prevWordPos(cursor)` to the cursor. - **Ctrl+Delete:** delete from the cursor to `nextWordPos(cursor)`. - **With a selection:** delete the selection, as plain Backspace does. - **Undo:** each word deletion is one undo step. - **Read-only fields:** respect them. - **Password fields:** delete the whole field or fall back to a character delete. Don't reveal word boundaries. - **Shortcut conflicts:** check that Ctrl+Backspace isn't already bound in the keybindings (`llkeyconflict` / key bindings XML) for a viewer action that should take priority while a text field has focus. ## Done when - Ctrl+Backspace and Ctrl+Delete delete whole words in chat, IM, notecards and the script editor. - Undo restores the deleted text.
sky_line added this to the Slipstream project 2026-10-09 02:02:25 +00:00
Author
Owner

Done: bd95a92a26 (Ctrl+Backspace / Ctrl+Delete delete the previous / next word in line and text editors). Verified by the owner. Lands in 1.2.0 Beta 8.

Done: bd95a92a26 (Ctrl+Backspace / Ctrl+Delete delete the previous / next word in line and text editors). Verified by the owner. Lands in 1.2.0 Beta 8.
sky_line 2026-10-09 22:36:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#583
No description provided.