Thanks for the tip Benji, a good one.

:verbose set lines? columns? gives me
  lines=51
  columns=315
        Last set from ~/.vimrc

It is correct that it should last have been set by .vimrc, but the only time it 
appears to be set in .vimrc I've got a print out after it indicating it is 360, 
which is what I'm trying to set it to.
There's nothing else appearing to touch &columns.
However, your tip did alert me to the fact that whilst I'm normally running 
this function from the VimEnter event, for this particular application it's 
getting called via a "-c" command line switch - which does happen earlier in 
the init process.  
I'll modify things to ensure it is indeed VimEnter which triggers the function, 
which might, if I'm lucky, happen after the OS has finished it's window sizing 
functionality.

Thanks again for your reply,
John

On Monday 30 October 2006 15:46, Benji Fisher wrote:
> On Mon, Oct 30, 2006 at 11:30:40AM +1000, John Orr wrote:
> > Hi all,
> > 
> > I'm using Suse Linux, with KDE, and have a vim function to set my window 
> > size on startup.
> > The function just sets &columns and &lines, and calls winpos, depending 
> > upon various other variables I provide.
> > Previously I was registering this function to be called by an autocmd on 
> > the GUIEnter event - but I found that the window seemed to be resized by 
> > the operating system afterwards.
> > I tried changing to the VimEnter event which should come last - and that 
> > works most of the time, but not always.
> > I tried inserting a 5 second sleep into my function triggered by VimEnter - 
> > so the operating system could mess around with the window size before I 
> > then set it to the size I want - but no, I get a 5 second delay, my window 
> > is then set to my size - and then reset by the OS.
> > It's not dramatically reset - eg, I set it to 360 columns (spanning two 
> > monitors), and the OS reset it to 315.  If I run my function again 
> > manually, it sets the 360 columns perfectly.
> > 
> > I guess there may be some X related ways to achieve what I want - but all I 
> > really want to do is wait until after the operating system has had it's 
> > play with the window size, and then let my function go to work.
> > 
> > Anyone got any hints please?
> > 
> > Thanks in advance,
> > John
> 
>      If you are right that the OS is messing with your window, then this
> may not help, but it does not hurt to try:
> 
> :verbose set lines? columns?
> 
> after starting up.
> 
>      Somewhat more involved is to set 'verbose' to something big and log
> all messages.  If you are using vim 7.0, this is pretty easy:
> 
> :help 'verbosefile'
> 
> It is a little harder with earlier versions of vim.  Again, this may not
> help at all.  On the other hand, if there is a way to fix it in your
> vimrc file, then looking at these messages should point to it.
> 
> HTH                                   --Benji Fisher
> 

Reply via email to