File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 100100--- @return integer CMode
101101function O .linewise (p )
102102 local lcs_esc , rcs_esc = U .escape (p .lcs ), U .escape (p .rcs )
103- local pattern = U .get_pattern (p .cfg .ignore )
103+ local pattern = U .is_fn (p .cfg .ignore )
104104 local padding , pp = U .get_padding (p .cfg .padding )
105105 local is_commented = U .is_commented (lcs_esc , rcs_esc , pp )
106106
Original file line number Diff line number Diff line change @@ -93,17 +93,13 @@ function U.escape(str)
9393end
9494
9595--- Call a function if exists
96- --- @param fn function Hook function
96+ --- @param fn function Wanna be function
9797--- @return boolean | string
9898function U .is_fn (fn , ...)
99- return type (fn ) == ' function' and fn (... )
100- end
101-
102- --- Helper to compute the ignore pattern
103- --- @param ig string | function
104- --- @return boolean | string
105- function U .get_pattern (ig )
106- return ig and (type (ig ) == ' string' and ig or U .is_fn (ig ))
99+ if type (fn ) == ' function' then
100+ return fn (... )
101+ end
102+ return fn
107103end
108104
109105--- Check if the given line is ignored or not with the given pattern
You can’t perform that action at this time.
0 commit comments