Quantcast

MacVim not respecting "gui_running"

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

MacVim not respecting "gui_running"

robert h-2

I have:

if has('gui_running')
        set lines=45
        set columns=100
endif

MacVim does not seem to be picking that up. If I move those two lines
out of the if statement MacVim sizes correctly.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

Björn Winckler

On 20/12/2007, Robert Hicks <[hidden email]> wrote:

>
> I have:
>
> if has('gui_running')
>         set lines=45
>         set columns=100
> endif
>
> MacVim does not seem to be picking that up. If I move those two lines
> out of the if statement MacVim sizes correctly.

It works for me.  For instance, if I type

:echo has("gui_running")

in MacVim, then it responds with "1".  If I add your four lines to
"~/.gvimrc" then every new window I open is 45 lines and 100 columns.

So, make sure you add those lines to "~/.gvimrc", if that doesn't work
then please tell me what happens when you type ':echo
has("gui_running")' in a MacVim window.


/Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2

björn wrote:

> On 20/12/2007, Robert Hicks <[hidden email]> wrote:
>> I have:
>>
>> if has('gui_running')
>>         set lines=45
>>         set columns=100
>> endif
>>
>> MacVim does not seem to be picking that up. If I move those two lines
>> out of the if statement MacVim sizes correctly.
>
> It works for me.  For instance, if I type
>
> :echo has("gui_running")
>
> in MacVim, then it responds with "1".  If I add your four lines to
> "~/.gvimrc" then every new window I open is 45 lines and 100 columns.
>
> So, make sure you add those lines to "~/.gvimrc", if that doesn't work
> then please tell me what happens when you type ':echo
> has("gui_running")' in a MacVim window.
>
>
I don't keep a .gvimrc at all. I do everything in .vimrc using the if
statement to change setting if the gui version is running.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

Björn Winckler

On 21/12/2007, Robert Hicks <[hidden email]> wrote:

> björn wrote:
> > On 20/12/2007, Robert Hicks <[hidden email]> wrote:
> >> I have:
> >>
> >> if has('gui_running')
> >>         set lines=45
> >>         set columns=100
> >> endif
> >>
> >> MacVim does not seem to be picking that up. If I move those two lines
> >> out of the if statement MacVim sizes correctly.
> >
> > It works for me.  For instance, if I type
> >
> > :echo has("gui_running")
> >
> > in MacVim, then it responds with "1".  If I add your four lines to
> > "~/.gvimrc" then every new window I open is 45 lines and 100 columns.
> >
> > So, make sure you add those lines to "~/.gvimrc", if that doesn't work
> > then please tell me what happens when you type ':echo
> > has("gui_running")' in a MacVim window.
> >
> >
> I don't keep a .gvimrc at all. I do everything in .vimrc using the if
> statement to change setting if the gui version is running.

I tried your four lines in "~/.vimrc" and it still works for me...strange.

Can you please let me know what happens if you open up a MacVim window and type

:echo has('gui_running')

What does it say when you type that (0 or 1)?  Which version of Mac OS
X are you using?  Have you always had problems with
"has('gui_running')" in MacVim or did it start happening recently?
The more information you can provide the greater the chance I can
figure out what's going wrong.

Thanks,
Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

Tim Allen-7
In reply to this post by robert h-2

On Dec 22, 7:16 am, Robert Hicks <[hidden email]> wrote:
> I don't keep a .gvimrc at all. I do everything in .vimrc using the if
> statement to change setting if the gui version is running.

According to "starting.txt" in Vim's online help, .vimrc is executed
at step 3 of the start-up process, while the GUI is started
(and .gvimrc is read) at step 8 - so has('gui_running') should never
be true while .vimrc is being processed (and if it ever is true,
that's probably a port-specific glitch you shouldn't rely on).
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2
In reply to this post by Björn Winckler

björn wrote:

> On 21/12/2007, Robert Hicks <[hidden email]> wrote:
>> björn wrote:
>>> On 20/12/2007, Robert Hicks <[hidden email]> wrote:
>>>> I have:
>>>>
>>>> if has('gui_running')
>>>>         set lines=45
>>>>         set columns=100
>>>> endif
>>>>
>>>> MacVim does not seem to be picking that up. If I move those two lines
>>>> out of the if statement MacVim sizes correctly.
>>> It works for me.  For instance, if I type
>>>
>>> :echo has("gui_running")
>>>
>>> in MacVim, then it responds with "1".  If I add your four lines to
>>> "~/.gvimrc" then every new window I open is 45 lines and 100 columns.
>>>
>>> So, make sure you add those lines to "~/.gvimrc", if that doesn't work
>>> then please tell me what happens when you type ':echo
>>> has("gui_running")' in a MacVim window.
>>>
>>>
>> I don't keep a .gvimrc at all. I do everything in .vimrc using the if
>> statement to change setting if the gui version is running.
>
> I tried your four lines in "~/.vimrc" and it still works for me...strange.
>
> Can you please let me know what happens if you open up a MacVim window and type
>
> :echo has('gui_running')
>
> What does it say when you type that (0 or 1)?  

I get a 1 with that

> Which version of Mac OS
> X are you using?  

I am using the latest "Tiger"

> Have you always had problems with
> "has('gui_running')" in MacVim or did it start happening recently?
> The more information you can provide the greater the chance I can
> figure out what's going wrong.

It just started with the last build.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2
In reply to this post by Tim Allen-7

Tim Allen wrote:
> On Dec 22, 7:16 am, Robert Hicks <[hidden email]> wrote:
>> I don't keep a .gvimrc at all. I do everything in .vimrc using the if
>> statement to change setting if the gui version is running.
>
> According to "starting.txt" in Vim's online help, .vimrc is executed
> at step 3 of the start-up process, while the GUI is started
> (and .gvimrc is read) at step 8 - so has('gui_running') should never
> be true while .vimrc is being processed (and if it ever is true,
> that's probably a port-specific glitch you shouldn't rely on).

That cannot be true. I have been read that others do it in the regular
Vim newsgroup (I think Tony M. may do it). I have used it for years on
Windows, HP/UX and OSX without a hitch. I compile the HP and OSX from
source without doing anything weird and it works without a problem.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2
In reply to this post by Björn Winckler

The "carbon" version of Vim that Bram puts out works fine.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2
In reply to this post by Tim Allen-7

 From :help gui

- When you use the same vimrc file on various systems, you can use something
   like this to set options specifically for each type of GUI: >

        if has("gui_running")
            if has("gui_gtk2")
                :set guifont=Luxi\ Mono\ 12
            elseif has("x11")
                " Also for GTK 1
                :set guifont=*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-*
            elseif has("gui_win32")
                :set guifont=Luxi_Mono:h12:cANSI
            endif
        endif


That would indicate to me the it is fine to do what I want from inside
the .vimrc with 'gui_running'.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

Björn Winckler
In reply to this post by robert h-2

On 24/12/2007, Robert Hicks <[hidden email]> wrote:

>
> björn wrote:
> > On 21/12/2007, Robert Hicks <[hidden email]> wrote:
> >> björn wrote:
> >>> On 20/12/2007, Robert Hicks <[hidden email]> wrote:
> >>>> I have:
> >>>>
> >>>> if has('gui_running')
> >>>>         set lines=45
> >>>>         set columns=100
> >>>> endif
> >>>>
> >>>> MacVim does not seem to be picking that up. If I move those two lines
> >>>> out of the if statement MacVim sizes correctly.
> >>> It works for me.  For instance, if I type
> >>>
> >>> :echo has("gui_running")
> >>>
> >>> in MacVim, then it responds with "1".  If I add your four lines to
> >>> "~/.gvimrc" then every new window I open is 45 lines and 100 columns.
> >>>
> >>> So, make sure you add those lines to "~/.gvimrc", if that doesn't work
> >>> then please tell me what happens when you type ':echo
> >>> has("gui_running")' in a MacVim window.
> >>>
> >>>
> >> I don't keep a .gvimrc at all. I do everything in .vimrc using the if
> >> statement to change setting if the gui version is running.
> >
> > I tried your four lines in "~/.vimrc" and it still works for me...strange.
> >
> > Can you please let me know what happens if you open up a MacVim window and type
> >
> > :echo has('gui_running')
> >
> > What does it say when you type that (0 or 1)?
>
> I get a 1 with that

Ok.  So it is at least correctly set when MacVim has started.

> > Which version of Mac OS
> > X are you using?
>
> I am using the latest "Tiger"

Can you give me a step-by-step way to recreate the problem?  I also
run Tiger, but I can't reproduce this behaviour.

> > Have you always had problems with
> > "has('gui_running')" in MacVim or did it start happening recently?
> > The more information you can provide the greater the chance I can
> > figure out what's going wrong.
>
> It just started with the last build.

Maybe it has something to do with the new forking code...Nico any
comments on this?   Could it be that 'gui.starting' isn't set when Vim
forks?

Robert, please try starting MacVim with the -f flag (e.g. mvim
-f)...does that solve your problem?  (I'm not suggesting this as a
solution, but if -f fixes the problem then we know that it has
something to do with the new forking code.)


/Björn

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

Nico Weber-3

> Maybe it has something to do with the new forking code...Nico any
> comments on this?   Could it be that 'gui.starting' isn't set when Vim
> forks?

Well, it _should_ be no problem, the forked vim starts with the  
exactly the same command line parameters as the original instance (but  
with a '-f') added. But I wouldn't completely rule out that the  
forking patch might cause the problem.

Robert, does it work with 0711?

Nico

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2

Nico Weber wrote:

>> Maybe it has something to do with the new forking code...Nico any
>> comments on this?   Could it be that 'gui.starting' isn't set when Vim
>> forks?
>
> Well, it _should_ be no problem, the forked vim starts with the  
> exactly the same command line parameters as the original instance (but  
> with a '-f') added. But I wouldn't completely rule out that the  
> forking patch might cause the problem.
>
> Robert, does it work with 0711?
>

I do not have that one but I believe it did work. I looked on the Google
site but didn't see a download.

Using "mvim" won't even start the editor for me whether I use the -f
flag or not. Maybe my download was corrupted somehow?

Can you put 0711 back up there and I will redownload 0712 and see if
that was the problem as well.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2
In reply to this post by Nico Weber-3

I did the redownload of 0712 and still the same behavior.

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2
In reply to this post by Nico Weber-3

Nico Weber wrote:
>> Maybe it has something to do with the new forking code...Nico any
>> comments on this?   Could it be that 'gui.starting' isn't set when Vim
>> forks?
>
> Well, it _should_ be no problem, the forked vim starts with the  
> exactly the same command line parameters as the original instance (but  
> with a '-f') added. But I wouldn't completely rule out that the  
> forking patch might cause the problem.

Okay...I had to start mvim as sudo...it started AND it did the
'gui_running' stuff even without the -f flag. So what is different about
that and just running the straight MacVim.app itself?

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

Nico Weber-3
In reply to this post by robert h-2

> I do not have that one but I believe it did work. I looked on the  
> Google
> site but didn't see a download.

On the "Downloads" page, select "Deprecated Downloads" from the  
dropdown and hit "Search".

> Using "mvim" won't even start the editor for me whether I use the -f
> flag or not. Maybe my download was corrupted somehow?

About the `su` thing: Did you download MacVim as another user? Does  
repairing permissions help?

Nico

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: MacVim not respecting "gui_running"

robert h-2

Nico Weber wrote:

>> I do not have that one but I believe it did work. I looked on the  
>> Google
>> site but didn't see a download.
>
> On the "Downloads" page, select "Deprecated Downloads" from the  
> dropdown and hit "Search".
>
>> Using "mvim" won't even start the editor for me whether I use the -f
>> flag or not. Maybe my download was corrupted somehow?
>
> About the `su` thing: Did you download MacVim as another user? Does  
> repairing permissions help?
>

No I didn't. I do everything as my user and su/sudo when needed.
However, I got it to work (see another post in this thread).

Robert


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Loading...