Two cents worth - I've long had problems like this, on Suse Linux, where 
something, the OS I have assumed, or the X graphics system, takes control of 
the sizing of my gvim application.
The size is initially set by my lines and columns settings, but something else 
resizes it afterwards, making lines and columns no longer valid.
The only reliable solution I found was to write a function to resize my window, 
and to install an autocmd using the CursorHold event, with a suitable 
updatetime set.
I tried using other autocmds, eg GUIEnter and VIMEnter, but they fired before 
the OS had its say.
The idea - let the OS size gvim as it wants, and a second or so afterwards, 
with no key strokes pressed, the Cursorhold event fires and my function fixes 
things.
It's a horrible solution, and wastes time on startup - but it's quicker than me 
manually resizing, and I've got no better solution.
I can provide some code if you want (though I'd love someone to resolve it 
properly).

In case anyone is interested, my setup looks like this:
version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Mar 27 2007 10:50:46)
Included patches: 1-220
Compiled by [EMAIL PROTECTED]
Big version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+cryptv +cscope
+cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval 
+ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer 
+fork() +gettext
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall 
+linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname 
+mouse +mouseshape +mouse_dec
+mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang 
-mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript +printer 
-profile -python
+quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff 
+statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white 
-tcl +terminfo
+termresponse +textobjects +title +toolbar +user_commands +vertsplit 
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu 
+windows +writebackup +X11
-xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr1/Generic/vim/7.0/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -DXTHREADS 
-D_REENTRANT -DXUSE_MTSAFE_API -I/opt/gnome/include/gtk-2.0 
-I/opt/gnome/lib/gtk-2.0/include -I/usr/X1
1R6/include -I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/pango-1.0 
-I/usr/include/freetype2 -I/usr/include/freetype2/config 
-I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/g
lib-2.0/include     -g -O2  -I/usr/X11R6/include
Linking: gcc -L/opt/gnome/lib   -L/usr/X11R6/lib   -L/usr/local/lib -o vim   
-Wl,--export-dynamic -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 
-lgdk_pixbuf-2.0 -lm -lp
angoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0   
-lXt -lncurses -lgpm

Cheers,
John

On Monday 30 April 2007 16:41, A.J.Mechelynck wrote:
> Zhaojun WU wrote:
> > Hi, Vimmers,
> > 
> > Just found an interesting problem but don't why.
> > 
> > I am using Debian on my Linux box and used the vim-gtk package before.
> > I have the settings like:
> > =========================
> > if has("gui_running")
> >        set guifont=BitStream\ Vera\ Sans\ Mono\ 11
> >        set guioptions=mei      " only display Menu, Tab, and Icon
> >        colorscheme oceandeep
> >        set lines=60 columns=89
> >        "set cursorline         " Highlight Current Line in GUI mode
> > endif
> > ==========================
> > 
> > I set the lines and columns to make it start with a gvim window to
> > cover half part of my screen (lines=60 and columns=89). This settings
> > worked fine no matter when I run the "gvim" from the XFCE launch menu
> > or from a command "$gvim".
> > 
> > Recently, I replaced the "vim-gtk" package with "vim-full",  if I
> > launched it from the XFCE menu, it works like before (give me a 60x89
> > gvim window). But, if I run "gvim" from my bash prompt, I can get a
> > window with random-sized gvim window.
> > 
> > I am sure the gvim shortcut in the XFCE launch menu is also pointing
> > to the "gvim" I ran on the my rxvt.
> > 
> > So, in this case, I am just wondering who actually controls the lines,
> > cols of my gvim window? Any difference btw vim-full and vim-gtk makes
> > it happened?
> > 
> > Thanks,
> > 
> 
> Try
> 
>       :verbose set lines? columns?
> 
> It should tell you where they were last set.
> 
> 
> Best regards,
> Tony.
> -- 
> Sixtus V, Pope from 1585 to 1590 authorized a printing of the Vulgate
> Bible.  Taking no chances, the pope issued a papal bull automatically
> excommunicating any printer who might make an alteration in the text.
> This he ordered printed at the beginning of the Bible.  He personally
> examined every sheet as it came off the press.  Yet the published
> Vulgate Bible contained so many errors that corrected scraps had to be
> printed and pasted over them in every copy.  The result provoked wry
> comments on the rather patchy papal infallibility, and Pope Sixtus had
> no recourse but to order the return and destruction of every copy.
> 

Reply via email to