mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 03:23:47 -05:00
Compare commits
3 Commits
7b0b5098e3
...
6620e5fbbe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6620e5fbbe | ||
|
|
33cb7744c3 | ||
|
|
d3a9986fe8 |
@@ -533,6 +533,8 @@ let g:gitgutter_async = 0
|
||||
|
||||
Add `let g:gitgutter_preview_win_floating = 1` to your `~/.vimrc`. Note that on Vim this prevents you staging (partial) hunks via the preview window.
|
||||
|
||||
On Neovim, the preview hunk command will move the cursor into the floating window if it is already open.
|
||||
|
||||
|
||||
#### The appearance of a floating/popup window for hunk previews
|
||||
|
||||
|
||||
@@ -359,6 +359,11 @@ endfunction
|
||||
|
||||
|
||||
function! s:preview(hunk_diff)
|
||||
if g:gitgutter_preview_win_floating && exists('*nvim_set_current_win') && s:winid != 0
|
||||
call nvim_set_current_win(s:winid)
|
||||
return
|
||||
endif
|
||||
|
||||
let lines = split(a:hunk_diff, '\r\?\n')
|
||||
let header = lines[0:4]
|
||||
let body = lines[5:]
|
||||
|
||||
@@ -201,11 +201,13 @@ Commands for operating on a hunk:~
|
||||
:GitGutterUndoHunk Undo the hunk the cursor is in.
|
||||
|
||||
*gitgutter-:GitGutterPreviewHunk*
|
||||
:GitGutterPreviewHunk Preview the hunk the cursor is in.
|
||||
:GitGutterPreviewHunk Preview the hunk the cursor is in or, if you are using
|
||||
floating preview windows in Neovim and the window is
|
||||
already open, move the cursor into the window.
|
||||
|
||||
To stage part of the hunk, move to the preview window,
|
||||
delete any lines you do not want to stage, and
|
||||
|GitGutterStageHunk|.
|
||||
delete any lines you do not want to stage, and |write|
|
||||
or |GitGutterStageHunk|.
|
||||
|
||||
To close a non-floating preview window use |:pclose|
|
||||
or |CTRL-W_z| or |CTRL-W_CTRL-Z|; or normal window-
|
||||
|
||||
Reference in New Issue
Block a user