-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Replace mode #580
Replace mode #580
Conversation
constructor(startPosition: Position) { | ||
this._replaceCursorStartPosition = startPosition; | ||
let text = TextEditor.getLineAt(startPosition).text.substring(startPosition.character); | ||
/* tslint:disable:forin */ |
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.
Use for of
Whoa, this is huge! Replace mode has been a big want of mine. Is it ready to go? |
@johnfn replace for...in with for...of with returning iterators. I suppose it's ready to go :) |
constructor(startPosition: Position) { | ||
this._replaceCursorStartPosition = startPosition; | ||
let text = TextEditor.getLineAt(startPosition).text.substring(startPosition.character); | ||
for (let [key, value] of text.split("").entries()) { |
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.
That's that ES6 style that I like :-)
Yeah, it generally looks good to me. Two quick questions before merge.
|
@johnfn my bad ... I'll add tests real quick. |
Added test cases for Replace Mode and The coverage of |
Replace commands can be prefixed with numbers but it's not implemented here, if I implement it before this PR gets merged, I'll update this PR. Otherwise create separate task to track it. |
Wonderful work, @rebornix. This is big enough to push out a new version, IMO. I'll give it a spin locally and hopefully get to doing that later tonight. :) |
Yay! We love PRs! 🎊
Please include a description of your change & check your PR against this list, thanks:
gulp tslint
)Add a new mode; Replace :)