Open GoogleCodeExporter opened 9 years ago
Are you sure the description of what you're seeing is correct? The behavior
I'm seeing is that the cursor is still on the last line of the buffer, but the
last line of the buffer is now being displayed at the top of the bottom window.
That is, before ":pedit %", the cursor and last line of the buffer are at the
bottom of the, at this point, only window. After ":pedit %", the cursor and
last line of the buffer are at the top of the bottom window and the last line
of the buffer is at the bottom of the preview window.
Original comment by vega.james@gmail.com
on 13 Jan 2015 at 12:21
Yes. On my machine, after the :pedit %, I see the copyright notice at the top
of my 1400-line file, in the bottom window. In the top (preview) window I still
see the bottom of the file where I had my cursor prior to the :pedit command.
While stepping through at one point I saw the cursor at line 1 in window 1 when
I used line('.') and winnr() in echo commands. I don't remember the exact
details, however.
Original comment by fritzoph...@gmail.com
on 13 Jan 2015 at 3:07
Same behavior (bottom window set to cursor on line 1, top window a preview
window set to cursor on last line where it started) in the Vim on my home
computer, starting from gvim -N -u NONE -i NONE and sourcing the minimal script:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 17 2014 21:27:42)
MS-Windows 32-bit GUI version
Included patches: 1-183
Compiled by {me}
Huge version with GUI. Features included (+) or not (-):
Original comment by fritzoph...@gmail.com
on 13 Jan 2015 at 3:11
I am not sure, why this happens only when an autocommand is defined, but this
patch saves and restores the cursor position.
Original comment by chrisbr...@googlemail.com
on 13 Jan 2015 at 6:10
Attachments:
Confirmed, this seems to fix the issue.
It sounds like it's more of a band-aid than a fix, though?
Oh well, a band-aid is enough for me until an official patch comes out. :-)
Original comment by fritzoph...@gmail.com
on 13 Jan 2015 at 9:15
I discovered today that although the cursor position is thankfully fixed by the
patch, there is still an error message that pops up if my buffer is modified.
Original comment by fritzoph...@gmail.com
on 15 Jan 2015 at 10:04
The error is expected since you're trying to :edit a modified buffer.
Original comment by vega.james@gmail.com
on 16 Jan 2015 at 1:21
Except the buffer is already loaded so it is more like a split. AFAIK there is
no way to open a preview window on the current buffer without triggering the
error. and you're always opening a split so it won't be abandoning it.
Original comment by fritzoph...@gmail.com
on 16 Jan 2015 at 2:37
Original issue reported on code.google.com by
fritzoph...@gmail.com
on 12 Jan 2015 at 10:23