Skip to content

Commit 6dff027

Browse files
committed
Dont load virtualenv twice.
1 parent 8acb90c commit 6dff027

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

after/plugin/pymode_virtualenv.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@ if !g:pymode_virtualenv || !g:pymode
77
finish
88
endif
99

10+
call helpers#SafeVar("g:pymode_virtualenv_enabled", [])
11+
1012
fun! pymode_virtualenv#Activate() "{{{
13+
14+
for env in g:pymode_virtualenv_enabled
15+
if env == $VIRTUAL_ENV
16+
return 0
17+
endif
18+
endfor
19+
20+
call add(g:pymode_virtualenv_enabled, $VIRTUAL_ENV)
21+
echomsg "Enabled virtualenv: " . $VIRTUAL_ENV
22+
1123
python << EOF
1224
ve_dir = os.environ['VIRTUAL_ENV']
1325
ve_dir in sys.path or sys.path.insert(0, ve_dir)

ftplugin/python/pymode.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ endif
2222

2323
" Add virtualenv paths
2424
if g:pymode_virtualenv && exists("$VIRTUAL_ENV")
25-
echomsg "Enabled virtualenv: " . $VIRTUAL_ENV
2625
call pymode_virtualenv#Activate()
2726
endif
2827

0 commit comments

Comments
 (0)