benma / visual-regexp.el

A regexp/replace command for Emacs with interactive visual feedback
396 stars 28 forks source link

Scroll to right position when updating text #9

Closed failable closed 10 years ago

failable commented 10 years ago

Supposed we have the following contents in current buffer:

line 1. (defun ... line 2. ... ....many lines here... line 500. (define-package ... ....many lines here... .... line 999. (define-key ...

Now the cursor position in current buffer is 0(line 1, col 1). Then I call vc/query-replace, in mini buffer we input "define-key", the screen will scroll down to line 999, then do nothing, delete "ine-key", the screen stays in line 999. I think a better behavior is that now the screen should scroll up to line 1("def" of "defun" is matched there). Even now we input "ine-package", the screen stays in line 999, a better behavior is that now the screen should scroll to line 500, since the first match pattern is there. That's exactly what isearch and other editors like sublime text 2 do.

I hope you can understand what I mean. It's a bit hard to explain or you can diff that using isearch and vr following the above workflow.

Not a really important issue. :)

benma commented 10 years ago

Fixed in f26f94ac031a521d60e3a01009a253a0f7ef6964. Please test it out and give me feedback. Thanks!

failable commented 10 years ago

I'm having class right now, I'll test it out a bit later! :)


Everything seems fine, thanks for you work.