Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to launch gvim instead vim internally by this script, but it not work. #1

Open
tangyi217 opened this issue Dec 22, 2019 · 0 comments

Comments

@tangyi217
Copy link

tangyi217 commented Dec 22, 2019

When try to use "gvim" instead of "vim" in below line in this script:
vim_rc = subprocess.call(['gvim', '-R', '--cmd', 'au VimEnter * so ' + vim_file_name])

gvim is lunched, but with an error to say that tmp file can not found.....

After i made below change in this script, gvim works fine. Can you have look at it and consider to merge it into master later ?

.....
vim_rc = os.EX_OK
import re
pattern = re.compile("gvim")

if changed_file:
    if pattern.search(script_name):
         vim_rc = subprocess.call(['gvim', '-R', '--cmd', 'au VimEnter * so ' + vim_file_name])
    else:
         vim_rc = subprocess.call(['vim',  '-R', '--cmd', 'au VimEnter * so ' + vim_file_name])
         shutil.rmtree(temp_dir)  ### in gvim case, we can NOT call this which will delete files which is still used by gvim.
sys.exit(vim_rc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant