Skip to content

TextSelectionOverwrite#44

Merged
dawsbot merged 5 commits intodawsbot:masterfrom
rapsalands:OverwriteBranch
May 7, 2022
Merged

TextSelectionOverwrite#44
dawsbot merged 5 commits intodawsbot:masterfrom
rapsalands:OverwriteBranch

Conversation

@rapsalands
Copy link
Copy Markdown
Contributor

@rapsalands rapsalands commented Apr 26, 2020

Fixes #42

This pull request will enable user to replace selected text when inserting new relative path. In case of no selection, relative path will be entered in cursor position.

@rapsalands rapsalands mentioned this pull request Apr 26, 2020
let position: Position = window.activeTextEditor.selection.end;
editBuilder.insert(position, relativeUrl);
// Get all selections
let selections = window.activeTextEditor.selections;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you teach me about how selections can be an array? I would assume this is just a string containing the characters currently highlighted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User may select a text (let's say 'pdf') and press Ctrl+D, this selects all the 'pdf' text in that file. This will lead to multiple selections.

"resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.34.tgz",
"integrity": "sha512-sUvpieq+HsWTLdkeOI8Mi8u22Ag3AoGuM3sv+XMP1bKtbaIAHpEA2f52K2mz6vK5PVhTa3bFyRZLZMqTxOo2Cw==",
"requires": {
"@types/events": "1.1.0",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for a diff to this file, can you remove these dependency changes so this PR is only the changed lines from extension.ts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it. Does it reflect the same now?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Looks like there's still a diff for package-lock.json

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done now. Could you please confirm?

@dawsbot dawsbot merged commit 446ec81 into dawsbot:master May 7, 2022
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

Successfully merging this pull request may close these issues.

Should overwrite text

2 participants