Skip to content
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