File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ fun! pymode#virtualenv#init() "{{{
1111
1212endfunction " }}}
1313
14- fun ! pymode#virtualenv#activate (relpath ) " {{{
15- let g: pymode_virtualenv_path = getcwd () . ' / ' . a: relpath
14+ fun ! pymode#virtualenv#activate (path ) " {{{
15+ let g: pymode_virtualenv_path = a: path
1616 call pymode#virtualenv#init ()
1717endfunction " }}}
Original file line number Diff line number Diff line change @@ -212,8 +212,8 @@ Bind keys to show documentation for current word (selection)
212212 *pymode-virtualenv*
213213
214214Commands:
215- *:PymodeVirtualenv* <path> -- Activate virtualenv (path is related to
216- current working directory)
215+ *:PymodeVirtualenv* <path> -- Activate virtualenv (path can be absolute or
216+ relative to current working directory)
217217
218218Enable automatic virtualenv detection *'g:pymode_virtualenv'*
219219>
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ def enable_virtualenv():
1515
1616 """
1717 path = env .var ('g:pymode_virtualenv_path' )
18+ # Normalize path to be an absolute path
19+ # If an absolute path is provided, that path will be returned, otherwise
20+ # the returned path will be an absolute path but computed relative
21+ # to the current working directory
22+ path = os .path .abspath (path )
1823 enabled = env .var ('g:pymode_virtualenv_enabled' )
1924 if path == enabled :
2025 env .message ('Virtualenv %s already enabled.' % path )
You can’t perform that action at this time.
0 commit comments