aboutsummaryrefslogtreecommitdiff
path: root/scripts/vim-patch.sh
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-09-21 11:55:56 -0400
committerJames McCoy <jamessan@jamessan.com>2016-09-22 07:16:50 -0400
commit9d170a493e679339d656f1bcb193284bd45948cb (patch)
treef507c0d49e382529e77eec15bffb6be74206540c /scripts/vim-patch.sh
parente2ad3fbf278ff25565fc720ef17a8ef997307bb7 (diff)
downloadrneovim-9d170a493e679339d656f1bcb193284bd45948cb.tar.gz
rneovim-9d170a493e679339d656f1bcb193284bd45948cb.tar.bz2
rneovim-9d170a493e679339d656f1bcb193284bd45948cb.zip
vim-patch: Group alternations in preprocess_patch
Without the groupings, only the first alternation matches the diff marker. For example, local na_doc='todo\.txt\|version\d\.txt\|tags' ... +'g^diff --git a/runtime/doc/'${na_doc}'... becomes, after expansion, ... +'g^diff --git a/runtime/doc/todo\.txt\|version\d\.txt\|tags'... so the matches become "^diff --get a/runtime/doc/todo\.txt", "version\d\.txt", or "tags". Adding the grouping ensures the expected behavior of requiring "^diff --get a/runtime/doc/" before every filename.
Diffstat (limited to 'scripts/vim-patch.sh')
-rwxr-xr-xscripts/vim-patch.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index a2750105c3..c3efb27e3a 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -132,15 +132,15 @@ preprocess_patch() {
# Remove *.proto, Make*, gui_*, some if_*
local na_src='proto\|Make*\|gui_*'
na_src="$na_src"'\|if_lua\|if_mzsch\|if_olepp\|if_ole\|if_perl\|if_py\|if_ruby\|if_tcl\|if_xcmdsrv'
- 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<'${na_src}'@norm! d/\v(^diff)|%$ ' +w +q "$file"
+ 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<\%('${na_src}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file"
# Remove todo.txt, version*.txt, tags
local na_doc='todo\.txt\|version\d\.txt\|tags'
- 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/'${na_doc}'@norm! d/\v(^diff)|%$ ' +w +q "$file"
+ 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\%('${na_doc}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file"
# Remove some testdir/Make_*.mak files
local na_src_testdir='Make_amiga.mak\|Make_dos.mak\|Make_ming.mak\|Make_vms.mms'
- 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/'${na_src_testdir}'@norm! d/\v(^diff)|%$ ' +w +q "$file"
+ 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\%('${na_src_testdir}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file"
# Rename src/ paths to src/nvim/
LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g' "$file" > "$file".tmp && mv "$file".tmp "$file"