-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
let position: Position = window.activeTextEditor.selection.end; | ||
editBuilder.insert(position, relativeUrl); | ||
// Get all selections | ||
let selections = window.activeTextEditor.selections; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
package-lock.json
Outdated
@@ -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", |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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?
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.