File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -200,14 +200,18 @@ end
200200-- @param query_line Line to set cursor position
201201local function get_auth (bufnr , query_line )
202202 local auth = {}
203- local auth_not_empty = false
203+ local is_auth_empty = true
204204 -- Set stop at end of bufer
205205 local stop_line = fn .line (' $' )
206206
207207 -- Iterate over all buffer lines
208208 for _ = 1 , stop_line do
209209 -- Case-insensitive search
210210 local start_line = fn .search (' \\ cAuthorization:' , ' ' , stop_line )
211+ if start_line ~= 0 then
212+ is_auth_empty = false
213+ end
214+
211215 local end_line = start_line
212216 local auth_line = api .nvim_buf_get_lines (
213217 bufnr ,
@@ -227,7 +231,7 @@ local function get_auth(bufnr, query_line)
227231 end
228232
229233 go_to_line (bufnr , query_line )
230- if not auth_not_empty then
234+ if is_auth_empty then
231235 return nil
232236 end
233237 return auth
You can’t perform that action at this time.
0 commit comments