Mercurial > vim
diff runtime/plugin/logiPat.vim @ 8869:b73f9ed65072
commit https://github.com/vim/vim/commit/939a1abe935a539f2d4c90a56cb0682cbaf3bbb0
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 10 01:31:25 2016 +0200
Updated runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 10 Apr 2016 01:45:05 +0200 |
parents | ee45d3b0579b |
children | 02bd0fe77c68 |
line wrap: on
line diff
--- a/runtime/plugin/logiPat.vim +++ b/runtime/plugin/logiPat.vim @@ -1,7 +1,7 @@ -" LogiPat: +" LogiPat: Boolean logical pattern matcher " Author: Charles E. Campbell -" Date: Mar 13, 2013 -" Version: 3 +" Date: Apr 04, 2016 +" Version: 4 " Purpose: to do Boolean-logic based regular expression pattern matching " Copyright: Copyright (C) 1999-2011 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, @@ -36,21 +36,22 @@ " --------------------------------------------------------------------- " Load Once: {{{1 -if &cp || exists("loaded_logipat") +if &cp || exists("loaded_logiPat") finish endif -let g:loaded_LogiPat = "v3" +let g:loaded_logiPat = "v4" let s:keepcpo = &cpo set cpo&vim "DechoRemOn " --------------------------------------------------------------------- " Public Interface: {{{1 -com! -nargs=* LogiPat call LogiPat(<q-args>,1) -silent! com -nargs=* LP call LogiPat(<q-args>,1) -com! -nargs=+ ELP echomsg LogiPat(<q-args>) -com! -nargs=+ LogiPatFlags let s:LogiPatFlags="<args>" -silent! com -nargs=+ LPF let s:LogiPatFlags="<args>" +com! -nargs=* LogiPat call LogiPat(<q-args>,1) +sil! com -nargs=* LP call LogiPat(<q-args>,1) +sil! com -nargs=* LPR call LogiPat(<q-args>,1,"r") +com! -nargs=+ LPE echomsg LogiPat(<q-args>) +com! -nargs=+ LogiPatFlags let s:LogiPatFlags="<args>" +sil! com -nargs=+ LPF let s:LogiPatFlags="<args>" " ===================================================================== " Functions: {{{1 @@ -66,6 +67,9 @@ fun! LogiPat(pat,...) else let dosearch= 0 endif + if a:0 >= 3 + let s:LogiPatFlags= a:3 + endif let s:npatstack = 0 let s:nopstack = 0 @@ -126,7 +130,7 @@ fun! LogiPat(pat,...) " perform the indicated search if dosearch - if exists("s:LogiPatFlags") + if exists("s:LogiPatFlags") && s:LogiPatFlags != "" " call Decho("search(result<".result."> LogiPatFlags<".s:LogiPatFlags.">)") call search(result,s:LogiPatFlags) else