[prev in list] [next in list] [prev in thread] [next in thread]
List: vim
Subject: Re: Restore the vim screen in a function
From: Benji Fisher <benji () e-math ! ams ! org>
Date: 2000-10-30 1:09:36
[Download RAW message or body]
"Paul Y. Peng" wrote:
>
> Benji Fisher wrote:
> >
[snip]
> > > I use GVIM5.6 on Win98.
> > >
> > > Paul.
> >
> > First of all, recent discussions point out that
> >
> > 0/foo
> >
> > is preferred to
> >
> > ijump! /foo/
> >
> > in these situations.
>
> Sorry, I may have missed the discussion. Why?
>
> >
> > The problem is that you are jumping around the file each time you
> > enter the buffer and you are not doing anything to restore the screen.
> > See
> >
> > :help restore-position
>
> It must be in a newer version of gvim. It is not available in my
> version of gvim. Actually I tried :help restore, :help screen, and
> :help position before seeking help in this list, none of them gave
> me a clue.
>
[snip]
>
> Thanks a lot. It works.
>
> I found another strange thing while debugging this function: if I open
> a tex file by dragging a file name from Windows Explorer and dropping
> it in a gvim window, I get the following message:
>
> Error detected while processing function SetMaster:
> Cannot use :normal from event handler
>
> It stays there for about one second then disappears. In the
> gvim screen, a line
> %MASTER: ""
> is inserted after the first line of the file. However, the line
> is not actually in the file. It will disappear if the file is
> reloaded. I don't have this problem if I simply double click the
> tex file name to open it in a gvim window. Is there anybody who
> knows what happens here.
> Thanks.
>
> Paul.
1. :ijump searches through all included files, and all we need here is a
search in the given file. IMHOP, the ordinary search command is more
readable, since it is more familiar. Note that the docs will soon be
corrected: they currently suggest that
:0/foo
and
:1/foo
have the same effect. In fact, the first will find "foo" if it is on the
first line, but the second will not.
2. Sorry, I did not check the help files for vim 5.6. It looks as though
this was added with vim 5.7. I am glad I decided to give explicit
directions.
3. I do not know what goes on with the different ways of opening a file
from Windows. Anyone else?
--Benji Fisher
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic