Preserve index on cza and czp

This commit is contained in:
Tim Pope 2019-07-29 00:48:31 -04:00
parent f3dde245b3
commit 881d72f1af
2 changed files with 10 additions and 4 deletions

View File

@ -4938,9 +4938,9 @@ function! fugitive#MapJumps(...) abort
nnoremap <buffer> cz<Space> :G stash<Space>
nnoremap <buffer> cz<CR> :G stash<CR>
nnoremap <buffer> <silent> cza :<C-U>exe <SID>EchoExec(['stash', 'apply', '--quiet', 'stash@{' . v:count . '}'])<CR>
nnoremap <buffer> <silent> cza :<C-U>exe <SID>EchoExec(['stash', 'apply', '--quiet', '--index', 'stash@{' . v:count . '}'])<CR>
nnoremap <buffer> <silent> czA :<C-U>exe <SID>EchoExec(['stash', 'apply', '--quiet', 'stash@{' . v:count . '}'])<CR>
nnoremap <buffer> <silent> czp :<C-U>exe <SID>EchoExec(['stash', 'pop', '--quiet', 'stash@{' . v:count . '}'])<CR>
nnoremap <buffer> <silent> czp :<C-U>exe <SID>EchoExec(['stash', 'pop', '--quiet', '--index', 'stash@{' . v:count . '}'])<CR>
nnoremap <buffer> <silent> czP :<C-U>exe <SID>EchoExec(['stash', 'pop', '--quiet', 'stash@{' . v:count . '}'])<CR>
nnoremap <buffer> <silent> czv :<C-U>exe 'Gedit' fugitive#RevParse('stash@{' . v:count . '}')<CR>
nnoremap <buffer> <silent> czw :<C-U>exe <SID>EchoExec(['stash', '--keep-index'] + (v:count > 1 ? ['--all'] : v:count ? ['--include-untracked'] : []))<CR>

View File

@ -421,9 +421,15 @@ czz Push stash. Pass a [count] of 1 to add
czw Push stash of worktree. Like `czz` with
`--include-index`.
cza Apply topmost stash, or stash@{count}.
czA Apply topmost stash, or stash@{count}.
czp Pop topmost stash, or stash@{count}.
cza Apply topmost stash, or stash@{count}, preserving the
index.
czP Pop topmost stash, or stash@{count}.
czp Pop topmost stash, or stash@{count}, preserving the
index.
cz<Space> Populate command line with ":G stash ".