Skip to content

Commit

Permalink
Refactoring: Use ingo#regexp#split#TopLevelBranches()
Browse files Browse the repository at this point in the history
This function provides an extended version of the split() that was previously used here.
  • Loading branch information
inkarkat committed Jun 24, 2018
1 parent 58747fe commit 4a3c9b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
12 changes: 8 additions & 4 deletions autoload/mark.vim
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
" Script Name: mark.vim
" Description: Highlight several words in different colors simultaneously.
"
" Copyright: (C) 2008-2015 Ingo Karkat
" Copyright: (C) 2008-2018 Ingo Karkat
" (C) 2005-2008 Yuheng Xie
" The VIM LICENSE applies to this script; see ':help copyright'.
"
" Maintainer: Ingo Karkat <[email protected]>
"
" Dependencies:
" DEPENDENCIES:
" - ingo/cmdargs/pattern.vim autoload script
" - ingo/err.vim autoload script
" - ingo/msg.vim autoload script
" - ingo/regexp/split.vim autoload script
" - ingo/cmdargs/pattern.vim autoload script
" - ingo/err.vim autoload script
" - ingo/msg.vim autoload script
" - SearchSpecial.vim autoload script (optional, for improved search messages).
"
" Version: 3.0.0
" Version: 3.0.1
" Changes:
" 26-May-2015 Ingo Karkat
" - CHG: Parse :Mark arguments as either /{pattern}/ or whole {word}.
Expand Down Expand Up @@ -617,7 +621,7 @@ function! s:EchoMarksDisabled()
endfunction

function! s:SplitIntoAlternatives( pattern )
return split(a:pattern, '\%(\%(^\|[^\\]\)\%(\\\\\)*\\\)\@<!\\|')
return ingo#regexp#split#TopLevelBranches(a:pattern)
endfunction

" Return [success, markGroupNum]. success is true when the mark has been set or
Expand Down
5 changes: 4 additions & 1 deletion doc/mark.txt
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ To uninstall, use the |:RmVimball| command.
DEPENDENCIES *mark-dependencies*

- Requires Vim 7.1 with |matchadd()|, or Vim 7.2 or higher.
- Requires the |ingo-library.vim| plugin (vimscript #4433), version 1.020 or
- Requires the |ingo-library.vim| plugin (vimscript #4433), version 1.034 or
higher.

==============================================================================
Expand Down Expand Up @@ -503,6 +503,9 @@ https://github.com/inkarkat/vim-mark/issues or email (address below).
==============================================================================
HISTORY *mark-history*

3.0.1 RELEASEME
*** You need to update to ingo-library (vimscript #4433) version 1.034! ***

3.0.0 18-Sep-2017
- CHG: Parse :Mark arguments as either /{pattern}/ or whole {word}. This
better addresses the common use case of searching for whole words, and is
Expand Down

0 comments on commit 4a3c9b1

Please sign in to comment.