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

Fix visual mode bugs#1304to#1308 #1322

Merged
merged 17 commits into from
May 22, 2017

Conversation

xlaech
Copy link
Contributor

@xlaech xlaech commented Feb 22, 2017

Fixed the bugs in Visual mode:

Did not fix #1306. See Diskussion.

Please intensively review #1308, since this was the most difficult one and i am still not sure if i have forgotten any edge cases. The tests run thought 👍

@xconverge
Copy link
Member

Not ignored ;) he is still on vacation

@xlaech
Copy link
Contributor Author

xlaech commented Feb 25, 2017

Haha 👍
No Problem... won't make a difference if we merge it now or in 2 weeks ;)

johnfn
johnfn previously requested changes Feb 26, 2017
Copy link
Member

@johnfn johnfn left a comment

Choose a reason for hiding this comment

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

Mostly looks good, just a quick question. Thanks so much for the PR, and thanks for adding tests as well! :)

return await new DeleteOperator(this.multicursorIndex).run(vimState, position.getLineBegin(), position.getLineEnd());
if (vimState.currentMode === ModeName.Visual) {
return await new DeleteOperator(this.multicursorIndex).run(vimState,
vimState.lastVisualSelectionStart.getLineBegin(),
Copy link
Member

Choose a reason for hiding this comment

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

Why is it lastVisualSelection? Is the current selection not what we want?

lastSelection was intended for commands like gv that are triggered after you stopped selecting entirely and did something else, so I just wanna make sure this is correct.

Copy link
Member

Choose a reason for hiding this comment

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

Like ideally you should be able to just access the current selection?

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 try it out tomorrow. Since i am not very familiar with the code, i just search with intellisense for possible members/function, i could use 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which properties you want to use?
I can find a current selection member in vimState.

Using TextEditor.getSelection() does not work.

Copy link
Member

Choose a reason for hiding this comment

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

vimState.cursorStartPosition and vimState.cursorPosition. Sorry I didn't make that more clear and you had to hunt around.

@xconverge
Copy link
Member

xconverge commented Apr 9, 2017

This one seems so close, any chance you could get to the last few things @johnfn mentioned, @xlaech?

@xlaech
Copy link
Contributor Author

xlaech commented Apr 24, 2017

Sorry... i worked at another company in the last month and did not have much time. I get to it in 2 weeks :)

@xconverge
Copy link
Member

Great! Will leave it open then!

@xlaech
Copy link
Contributor Author

xlaech commented May 18, 2017

I merged the current master branch into mine. But the action.ts file does no longer exist.
Is this due to a change in the projectstructure? Where does the "old" function now reside?

@xconverge
Copy link
Member

@xlaech it was split between a few files here https://github.com/VSCodeVim/Vim/tree/master/src/actions

I would advise searching for the actions you want with "X" for example

@xlaech
Copy link
Contributor Author

xlaech commented May 19, 2017

There you go :) I was very confused by the merge... so i just wrote the whole fix from scratch.

I also came to the conclusion, that the whole put command might need some refactoring in the future. At the moment, I think it is responsible for 2 many things.
I honestly did not make it much better, since i now added the extra case for VisualMode + Linewise register.
Maybe you have some Ideas about that.

Please provide feedback.

@@ -810,4 +810,136 @@ suite("Mode Visual", () => {
});

});
});

suite("search works in visual mode", () => {
Copy link
Member

Choose a reason for hiding this comment

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

why are these 2 tests here? I think they were already merged into master, probably an artifact from your merge? :)

Copy link
Contributor Author

@xlaech xlaech May 19, 2017

Choose a reason for hiding this comment

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

I just copied the current file from master in the main repo and rewrote the tests. I thought they were added by you guys. If they are not needed i can delete them.

Copy link
Member

Choose a reason for hiding this comment

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

But if they are in master already they shouldn't show up in the diff

Copy link
Member

@Chillee Chillee May 20, 2017

Choose a reason for hiding this comment

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

It was just an artifact of an unresolved merge conflict.

@Chillee
Copy link
Member

Chillee commented May 21, 2017

So is this good to go now?

@Chillee Chillee dismissed johnfn’s stale review May 22, 2017 02:08

old newssss....

@Chillee Chillee merged commit 8658951 into VSCodeVim:master May 22, 2017
@xlaech xlaech deleted the FixVisualModeBugs#1304to#1308 branch May 22, 2017 02:42
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.

Visual Mode Issues: S command
4 participants