Skip to content

Honor selected content upon input

lineinthesand requested to merge lineinthesand/honor_selection into main

This addresses issue #214 of the upstream GitHub project.

When text is selected in the editor input field, pressing a key will now behave differently from when no text is selected.

  • When pressing a digit or pasting text, the selected text will be replaced with the cursor to the right of the inserted text.
  • When hitting backspace, the selected text will be erased without deleting the character left of the selection.
  • When cutting selected text, the cursor will stay at the start of the original selection.
  • When pressing an operator, the selected text will be put into parentheses and the cursor will be placed after these and the operator.
  • When pressing parentheses, the selected text will be put in parentheses
  • and the cursor will be placed after them.

The behavior with no text selected stays the same, i.e. the text cursor will be put inside of the parentheses when inserting them, backspace will erase the content left to the cursor.

Behavior before change (from upstream GitHub issue)
Behavior introduced with this change
Edited by lineinthesand

Merge request reports

Loading