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

Replace in visual selection #69

Open
user471 opened this issue Apr 1, 2016 · 13 comments
Open

Replace in visual selection #69

user471 opened this issue Apr 1, 2016 · 13 comments
Labels

Comments

@user471
Copy link

user471 commented Apr 1, 2016

Is it possible to use anzu in selected region?
For example I have this line

foo foo foo

I press V to select the line and use anzu-replace-at-cursor-thing but it shows

No symbol at cursor!!
@syohex
Copy link
Contributor

syohex commented Apr 1, 2016

Is it possible to use anzu in selected region?

No.

Emacs replacement commands use region for limiting replacement range. Replace commands of anzu behaves same as them.

@user471
Copy link
Author

user471 commented Apr 1, 2016

I think I need to rephrase. Yes, I can use anzu in selected region. But anzu-replace-at-cursor-thing sometime doesn't detect an symbol at cursor.
For example it works on first line but it doesn't work on second.

img

@syohex
Copy link
Contributor

syohex commented Apr 2, 2016

Thanks for information. I'll try to check.

@syohex
Copy link
Contributor

syohex commented Apr 4, 2016

In evil-mode, cursor is moved to forward of region-end after calling execute-extended-command(M-x).

@syohex
Copy link
Contributor

syohex commented Apr 4, 2016

Hmm, I cannot get original point before invoking command. How I get it ?

@syohex
Copy link
Contributor

syohex commented Apr 4, 2016

It is retrieve from evil-visual-point.

@syohex
Copy link
Contributor

syohex commented Apr 4, 2016

@user471 I have fixed #70. Could you check it ?

@user471
Copy link
Author

user471 commented Apr 4, 2016

On line

foo foo foo

when cursor is on the second foo and I press V and anzu-replace-at-cursor-thing, anzu highlights all three foo instead of just second and third.
Also there is a weird cursor jumping to the next line.

@syohex
Copy link
Contributor

syohex commented Apr 4, 2016

when cursor is on the second foo and I press V and anzu-replace-at-cursor-thing, anzu highlights all three foo instead of just second and third.

In such case, region is from beginning of line to end of line so this behaviour is expected.

@user471
Copy link
Author

user471 commented Apr 4, 2016

Would it be possible to support this cursor position similar to normal cursor?
untitled

@user471
Copy link
Author

user471 commented Apr 4, 2016

On the other hand this cursor doesn't play well with multi line selection (selection should be reverted). So maybe it's not worth it.

@syohex
Copy link
Contributor

syohex commented Apr 4, 2016

Would it be possible to support this cursor position similar to normal cursor?

Yes. But I suppose few people expects such behaviour.

@gonewest818
Copy link
Collaborator

As I'm just picking up maintenance on this package, I'm going to mark this with a "won't fix" based on syohex's last comment (few people would expect this behavior).

However I'll also leave the ticket open for a while in case there are strong objections. Please leave a comment and let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants