comparison 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
comparison
equal deleted inserted replaced
8868:0fcc63fd49e6 8869:b73f9ed65072
1 " LogiPat: 1 " LogiPat: Boolean logical pattern matcher
2 " Author: Charles E. Campbell 2 " Author: Charles E. Campbell
3 " Date: Mar 13, 2013 3 " Date: Apr 04, 2016
4 " Version: 3 4 " Version: 4
5 " Purpose: to do Boolean-logic based regular expression pattern matching 5 " Purpose: to do Boolean-logic based regular expression pattern matching
6 " Copyright: Copyright (C) 1999-2011 Charles E. Campbell {{{1 6 " Copyright: Copyright (C) 1999-2011 Charles E. Campbell {{{1
7 " Permission is hereby granted to use and distribute this code, 7 " Permission is hereby granted to use and distribute this code,
8 " with or without modifications, provided that this copyright 8 " with or without modifications, provided that this copyright
9 " notice is copied with it. Like most anything else that's free, 9 " notice is copied with it. Like most anything else that's free,
34 " throne of his father, David, and he will reign over the house of 34 " throne of his father, David, and he will reign over the house of
35 " Jacob forever. There will be no end to his kingdom. (Luke 1:31-33 WEB) 35 " Jacob forever. There will be no end to his kingdom. (Luke 1:31-33 WEB)
36 36
37 " --------------------------------------------------------------------- 37 " ---------------------------------------------------------------------
38 " Load Once: {{{1 38 " Load Once: {{{1
39 if &cp || exists("loaded_logipat") 39 if &cp || exists("loaded_logiPat")
40 finish 40 finish
41 endif 41 endif
42 let g:loaded_LogiPat = "v3" 42 let g:loaded_logiPat = "v4"
43 let s:keepcpo = &cpo 43 let s:keepcpo = &cpo
44 set cpo&vim 44 set cpo&vim
45 "DechoRemOn 45 "DechoRemOn
46 46
47 " --------------------------------------------------------------------- 47 " ---------------------------------------------------------------------
48 " Public Interface: {{{1 48 " Public Interface: {{{1
49 com! -nargs=* LogiPat call LogiPat(<q-args>,1) 49 com! -nargs=* LogiPat call LogiPat(<q-args>,1)
50 silent! com -nargs=* LP call LogiPat(<q-args>,1) 50 sil! com -nargs=* LP call LogiPat(<q-args>,1)
51 com! -nargs=+ ELP echomsg LogiPat(<q-args>) 51 sil! com -nargs=* LPR call LogiPat(<q-args>,1,"r")
52 com! -nargs=+ LogiPatFlags let s:LogiPatFlags="<args>" 52 com! -nargs=+ LPE echomsg LogiPat(<q-args>)
53 silent! com -nargs=+ LPF let s:LogiPatFlags="<args>" 53 com! -nargs=+ LogiPatFlags let s:LogiPatFlags="<args>"
54 sil! com -nargs=+ LPF let s:LogiPatFlags="<args>"
54 55
55 " ===================================================================== 56 " =====================================================================
56 " Functions: {{{1 57 " Functions: {{{1
57 58
58 " --------------------------------------------------------------------- 59 " ---------------------------------------------------------------------
63 " LogiPat(pat,dosearch) 64 " LogiPat(pat,dosearch)
64 if a:0 > 0 65 if a:0 > 0
65 let dosearch= a:1 66 let dosearch= a:1
66 else 67 else
67 let dosearch= 0 68 let dosearch= 0
69 endif
70 if a:0 >= 3
71 let s:LogiPatFlags= a:3
68 endif 72 endif
69 73
70 let s:npatstack = 0 74 let s:npatstack = 0
71 let s:nopstack = 0 75 let s:nopstack = 0
72 let s:preclvl = 0 76 let s:preclvl = 0
124 let s:nopstack= 0 128 let s:nopstack= 0
125 endif 129 endif
126 130
127 " perform the indicated search 131 " perform the indicated search
128 if dosearch 132 if dosearch
129 if exists("s:LogiPatFlags") 133 if exists("s:LogiPatFlags") && s:LogiPatFlags != ""
130 " call Decho("search(result<".result."> LogiPatFlags<".s:LogiPatFlags.">)") 134 " call Decho("search(result<".result."> LogiPatFlags<".s:LogiPatFlags.">)")
131 call search(result,s:LogiPatFlags) 135 call search(result,s:LogiPatFlags)
132 else 136 else
133 " call Decho("search(result<".result.">)") 137 " call Decho("search(result<".result.">)")
134 call search(result) 138 call search(result)