Skip to content

Commit dd05bfc

Browse files
committed
Fix run and doc
1 parent 04e408e commit dd05bfc

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

ftplugin/python/pymode.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ if g:pymode_doc
5252

5353
" DESC: Set keys
5454
exe "nnoremap <silent> <buffer> " g:pymode_doc_key ":call pymode#doc#Show(expand('<cword>'))<CR>"
55+
exe "vnoremap <silent> <buffer> " g:pymode_doc_key ":call pymode#doc#Show('<C-R><C-A>')<CR>"
5556

5657
endif
5758

@@ -115,10 +116,11 @@ endif
115116
if g:pymode_run
116117

117118
" DESC: Set commands
118-
command! -buffer -nargs=0 Pyrun call pymode#run#Run()
119+
command! -buffer -nargs=0 -range=% Pyrun call pymode#run#Run(<f-line1>, <f-line2>)
119120

120121
" DESC: Set keys
121122
exe "nnoremap <silent> <buffer> " g:pymode_run_key ":Pyrun<CR>"
123+
exe "vnoremap <silent> <buffer> " g:pymode_run_key ":Pyrun<CR>"
122124

123125
endif
124126

plugin/pymode.vim

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let g:pymode_version = "0.5.7"
1+
let g:pymode_version = "0.5.8"
22

33
com! PymodeVersion echomsg "Current python-mode version: " . g:pymode_version
44

@@ -11,10 +11,11 @@ endif
1111
" DESC: Check python support
1212
if !has('python')
1313
echoerr expand("<sfile>:t") . " required vim compiled with +python."
14-
echoerr "Pymode rope, pylint and virtualenv plugins will be disabled."
15-
let g:pymode_lint = 0
16-
let g:pymode_rope = 0
17-
let g:pymode_path = 0
14+
let g:pymode_lint = 0
15+
let g:pymode_rope = 0
16+
let g:pymode_path = 0
17+
let g:pymode_doc = 0
18+
let g:pymode_run = 0
1819
let g:pymode_virtualenv = 0
1920
endif
2021

@@ -179,10 +180,6 @@ endif
179180

180181
if !pymode#Default("g:pymode_doc", 1) || g:pymode_doc
181182

182-
if !pymode#CheckProgram("pydoc", "or disable pymode_doc.")
183-
let g:pymode_doc = 0
184-
endif
185-
186183
" OPTION: g:pymode_doc_key -- string. Key for show python documantation.
187184
call pymode#Default("g:pymode_doc_key", "K")
188185

@@ -216,11 +213,7 @@ endif
216213

217214
if !pymode#Default("g:pymode_run", 1) || g:pymode_run
218215

219-
if !pymode#CheckProgram("python", "or disable pymode_run.")
220-
let g:pymode_run = 0
221-
endif
222-
223-
" OPTION: g:pymode_doc_key -- string. Key for show python documantation.
216+
" OPTION: g:pymode_doc_key -- string. Key for show python documentation.
224217
call pymode#Default("g:pymode_run_key", "<leader>r")
225218

226219
endif

0 commit comments

Comments
 (0)