Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: TextEditorEdit.replace does not select empty selection anymore #182441

Open
SrTobi opened this issue May 14, 2023 · 1 comment
Open
Assignees

Comments

@SrTobi
Copy link
Contributor

SrTobi commented May 14, 2023

Type: Bug

My extension broke because a call to TextEditorEdit.replace does not select the inserted text anymore, when the selection was empty.

For example, for a text file

a <sel> b

calling editor.edit(e => e.replace(<sel>, "test")) used to give

a <start>test<end> b

now it gives

a test<sel> b

I'm not 100% sure if this intentional, but it makes working with replace much harder, because now I have to create the selections manually which is a super headache.

Note also that this is not in line with the behaviour when something is selected.
For example, the same call from above gives the expected, original behaviour when something is selected:

a <start>x<end> b
=>
a <start>test<end> b

VS Code version: Code 1.78.0 (252e546, 2023-05-03T20:09:46.685Z)
OS version: Linux x64 5.15.110
Modes:
Sandboxed: No
Remote OS version: Linux x64 5.15.110

System Info
Item Value
Remote Dev Container: code-clip-ring-docker-dev
OS Linux x64 5.15.110
CPUs AMD Ryzen 9 5900X 12-Core Processor (24 x 3324)
Memory (System) 62.72GB (55.35GB free)
VM 0%
Extensions (13)
Extension Author (truncated) Version
Bookmarks ale 13.3.1
spellright ban 3.0.116
language-postcss cpy 1.1.0
vscode-great-icons emm 2.1.92
vscode-drawio hed 1.6.6
remote-containers ms- 0.292.0
remote-ssh ms- 0.102.0
remote-ssh-edit ms- 0.86.0
remote-explorer ms- 0.4.0
scala sca 0.5.6
pdf tom 1.2.2
gitignore cod 0.9.0
gitlens eam 13.6.0

(1 theme extensions excluded)

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.78.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@vscodenpa vscodenpa added the stale Issues that have not been triaged in an appropriate amount of time label May 21, 2023
@lramos15 lramos15 assigned jrieken and unassigned deepak1556 and lramos15 May 22, 2023
@lramos15 lramos15 removed triage-needed stale Issues that have not been triaged in an appropriate amount of time labels May 22, 2023
@jrieken jrieken assigned alexdima and unassigned jrieken May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants