Skip to content

Unable to type when text is selected backwards #273146

@Yavanosta

Description

@Yavanosta

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: Version: 1.105.1
  • OS Version: MacOS 15.7.1

Steps to Reproduce:

  1. Open the web version of VS Code (https://vscode.dev/)
  2. Open settings and find editor.editContext option
  3. Disable editor.editContext option. Alternatively use browser without EditContext support, ex Safari or Firefox.
  4. Open new text file
  5. Type in any text
  6. Select any piece of text going backwards. Works both with keyboard selection (Shift + ArrowLeft) and mouse selection
  7. Start typing

Expected result:

  1. Selected text is replaced with new typed text

Actual result:

  1. Nothing happens.
  2. When press another button, the second symbol will be typed correctly

Likely is introduced in this commit in #259042 while fixing #256833. In this code snippet selectionStart will be greater or equal then selectionEnd since length is always non negative. Seems that other parts of the code expect selectionStart to always be before selectionEnd. See this file for example.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions