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

Change python version check #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions autoload/gundo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if !exists("g:gundo_return_on_revert")"{{{
endif"}}}

let s:has_supported_python = 0
if g:gundo_prefer_python3 && has('python3')"{{{
if has('python3') && (g:gundo_prefer_python3 || !has('python'))"{{{
let s:has_supported_python = 2
elseif has('python')"
let s:has_supported_python = 1
Expand Down Expand Up @@ -282,7 +282,7 @@ endfunction"}}}

function! s:GundoOpen()"{{{
if !exists('g:gundo_py_loaded')
if s:has_supported_python == 2 && g:gundo_prefer_python3
if s:has_supported_python == 2
exe 'py3file ' . escape(s:plugin_path, ' ') . '/gundo.py'
python3 initPythonModule()
else
Expand Down Expand Up @@ -403,23 +403,23 @@ endfunction"}}}
"{{{ Gundo rendering

function! s:GundoRenderGraph()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
if s:has_supported_python == 2
python3 GundoRenderGraph()
else
python GundoRenderGraph()
endif
endfunction"}}}

function! s:GundoRenderPreview()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
if s:has_supported_python == 2
python3 GundoRenderPreview()
else
python GundoRenderPreview()
endif
endfunction"}}}

function! s:GundoRenderChangePreview()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
if s:has_supported_python == 2
python3 GundoRenderChangePreview()
else
python GundoRenderChangePreview()
Expand All @@ -431,15 +431,15 @@ endfunction"}}}
"{{{ Gundo undo/redo

function! s:GundoRevert()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
if s:has_supported_python == 2
python3 GundoRevert()
else
python GundoRevert()
endif
endfunction"}}}

function! s:GundoPlayTo()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
if s:has_supported_python == 2
python3 GundoPlayTo()
else
python GundoPlayTo()
Expand Down