Skip to content

Commit

Permalink
Add g:lsc_preview_split_direction config
Browse files Browse the repository at this point in the history
Allows the preview window to be treated different than normal splits.
  • Loading branch information
natebosch committed Aug 4, 2017
1 parent 6429372 commit 9f0005c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- Bug Fix: Handle completion items with empty detail.
- `LSClientShowHover` now reuses the window it already opened rather than
closing it and splitting again to allow for maintaining layout.
- Add optional configuration `g:lsc_preview_split_direction` to override
`splitbelow`.

# 0.2.3

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ using the default mappings) to populate the quickfix list with usage locations.

While the cursor is on any identifier call `LSClientShowHover` (`K` if using the
default mappings) to request hover text and show it in a preview window.
Override the direction of the split by setting `g:lsc_preview_split_direction`
to either `'below'` or `'above'`.
8 changes: 6 additions & 2 deletions autoload/lsc/util.vim
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,12 @@ function! s:createOrJumpToPreview(line_count) abort
execute 'resize '.want_height
endif
else
sp __lsc_preview__
execute 'resize '.want_height
if exists('g:lsc_preview_split_direction')
let direction = g:lsc_preview_split_direction
else
let direction = ''
endif
execute direction.' '.string(want_height).'split __lsc_preview__'
endif
set previewwindow
set winfixheight
Expand Down

0 comments on commit 9f0005c

Please sign in to comment.