Giter Club home page Giter Club logo

Comments (6)

xolox avatar xolox commented on August 19, 2024

It's not exactly clear to me what your issue is:

  1. What is the problem you are seeing?
  2. How do you want me to fix it?

from vim-session.

CandySunPlus avatar CandySunPlus commented on August 19, 2024

The HTR:

  1. open gvim or mvim and save a session.
  2. open vim in terminal and save the session again
  3. open gvim again and open the session

Observation:
The guifont and guioptions in the session saved in step 1. are lost.

The following code chould solve this problem

if is_all_tabs && (has('gui_running') || has('gui_macvim')) 
    call add(a:commands, 'set guioptions=' . escape(&go, ' "\'))
    call add(a:commands, 'silent! set guifont=' . escape(&gfn, ' "\'))
endif

from vim-session.

xolox avatar xolox commented on August 19, 2024

Thanks for the clear description, I see what you mean now; I can reproduce it using MacVim. On Linux this works fine, which is why I'd never noticed, but MacVim has to act "special" again ;-). I can fix this, but I don't want to change the code for other platforms, because it works fine on e.g. Ubuntu Linux (GVim using GTK). So what I'll probably do is make the change conditional on whether has('macunix') is true.

from vim-session.

xolox avatar xolox commented on August 19, 2024

By the way, in my version of MacVim has('gui_running') is true when has('gui_macvim') is true, so for me there would be ne reason to change that code. I guess the behavior is different on your system? What version of MacVim are you using? I'm running MacVim 7.3 including patches 1-646.

from vim-session.

xolox avatar xolox commented on August 19, 2024

I just noticed that has('macunix') is false in console Vim on Mac OS X. That brought me to the cause of the bug you're seeing (most likely). When you run MacVim, you're probably executing one of these executables:

  • /Applications/MacVim.app/Contents/MacOS/MacVim (always GUI)
  • /Applications/MacVim.app/Contents/MacOS/Vim (console or GUI depending on -g argument)

Of course you probably don't type out the command above in a console; you run the mvim wrapper script or click on the MacVim icon. When you run Vim in the console, I'm guessing you run this executable:

  • /usr/bin/vim

You can check this by:

  1. Confirming that when you run console Vim you normally type vim in the console to start it
  2. Checking the output of the command which vim, this will report the full pathname of the vim command

The /usr/bin/vim executable is a console-only Vim which doesn't support any GUI options (they're all reported as empty strings by Vim). I guess it's included with Mac OS X by default. I can still fix this, but I always like to know the cause of a bug before I fix it :-)

Edit: If my assumption is correct, the best check would be has('gui') (this indeeds reports false in /usr/bin/vim on Mac OS X).

from vim-session.

xolox avatar xolox commented on August 19, 2024

I just released vim-session 2.3.11 on GitHub and Vim Online. This version fixes the problem you reported (I just tested it on Mac OS X with the version of MacVim I previously mentioned). I'm closing this issue now because I think the problem is resolved, but if the problem is not resolved then please feel free to reopen this issue. Thanks for the feedback & happy Vimming!

from vim-session.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.