Skip to content

Commit

Permalink
BUG: Use internal and external ignore lists
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHermitte committed Jun 18, 2024
1 parent b4c9543 commit 02d2a96
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions autoload/lh/style.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
" Version: 1.0.0
let s:k_version = 100
" Created: 12th Feb 2014
" Last Update: 05th Jul 2021
" Last Update: 18th Jun 2024
"------------------------------------------------------------------------
" Description:
" Functions related to help implement coding styles (e.g. Allman or K&R
Expand Down Expand Up @@ -272,7 +272,7 @@ function! s:reinject_cached_ignored_matches(match, nl) abort
endfunction

function! lh#style#reinject_cached_ignored_matches(text, ...) abort
let s:cache_of_ignored_matches = get(a:, 1, get(s:, 'cache_of_ignored_matches', []))
let s:cache_of_ignored_matches = get(a:, 1, []) + get(s:, 'cache_of_ignored_matches', [])
try
if !empty(s:cache_of_ignored_matches)
return substitute(a:text, '\v¤(\d+)¤(\n)=', '\=s:reinject_cached_ignored_matches(submatch(1), submatch(2))', 'g')
Expand Down Expand Up @@ -302,7 +302,9 @@ function! lh#style#just_ignore_this(text, ...) abort
" get() requires the s:var to exist, hence the explicit test
" let cache_of_ignored_matches = get(a:, 1, s:cache_of_ignored_matches)
let cache_of_ignored_matches = (a:0 > 0) ? (a:1) : (s:cache_of_ignored_matches)
return "¤".(len(add(cache_of_ignored_matches, a:text))-1)."¤"
let res = "¤".(len(add(cache_of_ignored_matches, a:text))-1)."¤"
call s:Verbose("Ignoring %1 --> cache = %2", a:text, s:cache_of_ignored_matches)
return res
endfunction

" # lh-brackets Adapters for snippets {{{2
Expand Down

0 comments on commit 02d2a96

Please sign in to comment.