From f755285cf33f98f50fd16ae89a5bd413a255f3b1 Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sat, 18 Apr 2020 21:47:22 -0700 Subject: [PATCH] simplified the CountE function cleanup for HTML comment tag checks --- autoload/tablemode/spreadsheet.vim | 8 +------- autoload/tablemode/spreadsheet/formula.vim | 16 +++++++--------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/autoload/tablemode/spreadsheet.vim b/autoload/tablemode/spreadsheet.vim index 005272e..8abcc94 100644 --- a/autoload/tablemode/spreadsheet.vim +++ b/autoload/tablemode/spreadsheet.vim @@ -50,13 +50,7 @@ function! s:Max(list) "{{{2 endfunction function! s:CountE(list) "{{{2 - let result = 0 - for item in a:list - if empty(item) - let result += 1 - endif - endfor - return result + return len(filter(copy(a:list), {_,l -> empty(l)})) endfunction function! s:CountNE(list) "{{{2 diff --git a/autoload/tablemode/spreadsheet/formula.vim b/autoload/tablemode/spreadsheet/formula.vim index 85e840f..5d9b230 100644 --- a/autoload/tablemode/spreadsheet/formula.vim +++ b/autoload/tablemode/spreadsheet/formula.vim @@ -1,4 +1,8 @@ " Private Functions {{{1 +function! s:IsHTMLComment(line) "{{{2 + return getline(a:line) =~# '^\s*