From 881d72f1af0009838e375178ada7da7e34067f59 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 29 Jul 2019 00:48:31 -0400 Subject: [PATCH] Preserve index on cza and czp --- autoload/fugitive.vim | 4 ++-- doc/fugitive.txt | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a3f45ca..f714a39 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4938,9 +4938,9 @@ function! fugitive#MapJumps(...) abort nnoremap cz :G stash nnoremap cz :G stash - nnoremap cza :exe EchoExec(['stash', 'apply', '--quiet', 'stash@{' . v:count . '}']) + nnoremap cza :exe EchoExec(['stash', 'apply', '--quiet', '--index', 'stash@{' . v:count . '}']) nnoremap czA :exe EchoExec(['stash', 'apply', '--quiet', 'stash@{' . v:count . '}']) - nnoremap czp :exe EchoExec(['stash', 'pop', '--quiet', 'stash@{' . v:count . '}']) + nnoremap czp :exe EchoExec(['stash', 'pop', '--quiet', '--index', 'stash@{' . v:count . '}']) nnoremap czP :exe EchoExec(['stash', 'pop', '--quiet', 'stash@{' . v:count . '}']) nnoremap czv :exe 'Gedit' fugitive#RevParse('stash@{' . v:count . '}') nnoremap czw :exe EchoExec(['stash', '--keep-index'] + (v:count > 1 ? ['--all'] : v:count ? ['--include-untracked'] : [])) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 92a6e71..15c56cf 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -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 Populate command line with ":G stash ".