aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--VERSION2
-rw-r--r--after/ftplugin/diff/prune.vim9
-rw-r--r--autoload/diff/prune.vim3
-rw-r--r--doc/diff_prune.txt5
5 files changed, 11 insertions, 11 deletions
diff --git a/README.md b/README.md
index 1ef1769..4f8511b 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,8 @@ If the changes result in a diff block or file block having no changes left, it
is also removed.
This can be handy for using with the `-e` or `--edit` option to `git-add`,
-which allows you to edit a diff before applying changes to the staging area.
+which allows you to edit a diff before applying changes to the staging area. It
+also seems to work for the `-p` or `--patch` option.
License
-------
diff --git a/VERSION b/VERSION
index 3eefcb9..9084fa2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.0
+1.1.0
diff --git a/after/ftplugin/diff/prune.vim b/after/ftplugin/diff/prune.vim
index 185d04f..53e05cb 100644
--- a/after/ftplugin/diff/prune.vim
+++ b/after/ftplugin/diff/prune.vim
@@ -17,19 +17,16 @@ endif
" Flag as loaded
let b:did_ftplugin_diff_prune = 1
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|unlet b:did_ftplugin_diff_prune'
+let b:undo_ftplugin .= '|unlet b:did_ftplugin_diff_prune'
" Define normal mode mapping target
nnoremap <buffer> <silent> <unique>
\ <Plug>(DiffPrune)
\ :<C-U>set operatorfunc=diff#prune#Prune<CR>g@
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>(DiffPrune)'
+let b:undo_ftplugin .= '|nunmap <buffer> <Plug>(DiffPrune)'
" Define visual mode mapping target
vnoremap <buffer> <silent> <unique>
\ <Plug>(DiffPrune)
\ :<C-U>call diff#prune#Prune(visualmode())<CR>
-let b:undo_ftplugin = b:undo_ftplugin
- \ . '|vunmap <buffer> <Plug>(DiffPrune)'
+let b:undo_ftplugin .= '|vunmap <buffer> <Plug>(DiffPrune)'
diff --git a/autoload/diff/prune.vim b/autoload/diff/prune.vim
index cfbce97..a562d71 100644
--- a/autoload/diff/prune.vim
+++ b/autoload/diff/prune.vim
@@ -16,6 +16,8 @@ function! diff#prune#Prune(type) abort
" Now we need to look for any blocks or files to remove if they have no
" changes in them anymore
+ let l:file_changes = 0
+ let l:block_changes = 0
let l:deletions = {}
for l:li in range(1, line('$') + 1)
@@ -34,7 +36,6 @@ function! diff#prune#Prune(type) abort
let l:block = stridx(l:line, '@@') == 0 && !l:eof
let l:change = (stridx(l:line, '+') == 0 || stridx(l:line, '-') == 0)
\ && !l:eof
- \ && exists('l:file_start')
\ && exists('l:block_start')
" End of old file: flag previous file lines for deletion if no changes,
diff --git a/doc/diff_prune.txt b/doc/diff_prune.txt
index f708d73..d1be82b 100644
--- a/doc/diff_prune.txt
+++ b/doc/diff_prune.txt
@@ -1,4 +1,4 @@
-*diff_prune.txt* For Vim version 7.0 Last change: 2018 June 29
+*diff_prune.txt* For Vim version 7.0 Last change: 2018 July 14
DESCRIPTION *diff_prune*
@@ -11,7 +11,8 @@ If the changes result in a diff block or file block having no changes left, it
is also removed.
This can be handy for using with the `-e` or `--edit` option to `git-add`,
-which allows you to edit a diff before applying changes to the staging area.
+which allows you to edit a diff before applying changes to the staging area. It
+also seems to work for the `-p` or `--patch` option.
REQUIREMENTS *diff_prune-requirements*