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

TextSelectionOverwrite #44

Merged
merged 5 commits into from
May 7, 2022
Merged

Conversation

rapsalands
Copy link
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
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
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.

@@ -14,9 +14,9 @@
"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
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
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
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
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