Skip to content

Commit ac97c66

Browse files
authored
Merge pull request python-mode#947 from fpob/fix-preview
Improve preview window
2 parents 63e3866 + b20a234 commit ac97c66

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Contributors:
2828
* Diego Rabatone Oliveira (https://github.com/diraol)
2929
* Dimitrios Semitsoglou-Tsiapos (https://github.com/dset0x);
3030
* Dirk Wallenstein (http://github.com/dirkwallenstein);
31+
* Filip Poboril (https://github.com/fpob)
3132
* Florent Xicluna (http://github.com/florentx);
3233
* Fredrik Henrysson (http://github.com/fhenrysson);
3334
* fwuzju (https://github.com/fwuzju);

autoload/pymode.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ endfunction "}}}
6262
" DESC: Open temp buffer.
6363
fun! pymode#tempbuffer_open(name) "{{{
6464
pclose
65-
exe "botright 8new " . a:name
65+
exe g:pymode_preview_position . " " . g:pymode_preview_height . "new " . a:name
6666
setlocal buftype=nofile bufhidden=delete noswapfile nowrap previewwindow
6767
redraw
6868
endfunction "}}}

autoload/pymode/doc.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ fun! pymode#doc#show(word) "{{{
3232
if g:pymode_doc_vertical
3333
wincmd L
3434
endif
35+
36+
normal gg
37+
3538
wincmd p
3639

3740
endfunction "}}}

autoload/pymode/rope.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ fun! pymode#rope#show_doc()
7676
setlocal nomodifiable
7777
setlocal nomodified
7878
setlocal filetype=rst
79+
80+
normal gg
81+
7982
wincmd p
8083
endif
8184
endfunction

doc/pymode.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ Setup pymode |quickfix| window.
132132
let g:pymode_quickfix_minheight = 3
133133
let g:pymode_quickfix_maxheight = 6
134134
135+
Set pymode |preview| window height. *'g:pymode_preview_height'*
136+
Preview window is used to show documentation and ouput from |pymode-run|.
137+
>
138+
let g:pymode_preview_height = &previewheight
139+
140+
Set where pymode |preview| window will appear. *'g:pymode_preview_position'*
141+
>
142+
let g:pymode_preview_position = 'botright'
143+
144+
Value is command which can influcece where new window created by `:new` command
145+
will appear, eg. `:botright`.
146+
135147
-------------------------------------------------------------------------------
136148
2.1. Python version ~
137149
*pymode-python-version*

plugin/pymode.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ call pymode#default('g:pymode_quickfix_maxheight', 6)
6868
" Maximal height of pymode quickfix window
6969
call pymode#default('g:pymode_quickfix_minheight', 3)
7070

71+
" Height of preview window
72+
call pymode#default('g:pymode_preview_height', &previewheight)
73+
74+
" Position of preview window
75+
call pymode#default('g:pymode_preview_position', 'botright')
76+
7177
" LOAD VIRTUALENV {{{
7278
"
7379
" Enable virtualenv support

0 commit comments

Comments
 (0)