Okay. I wasn't sure if it was in the plan. Thank you for explaining.
I wrote this function that does the job, but with a few defaults that I like:
1. Defaults to the current buffer
2. Uses the current search pattern if none is provided
3. Starts on line 1
4. Ends on the last line in the file (basically, defaults to the whole file)
If both ignorecase and smartcase are on and the pattern contains any uppercase letter, it temporarily turns off ignorecase to force the function to match case.
The function:
export def g:MatchBufLine( buf: any = bufnr(), pat: string = @/, lnum: any = 1, end: any = '$', dict: dict<any> = {} ): list<dict<any>>
var matchCase: bool = false
if ( &ignorecase && &smartcase && pat =~# '[A-Z]' )
matchCase = true
set noignorecase
endif
var result: list<dict<any>> = matchbufline( buf, pat, lnum, end, dict )
if ( matchCase )
set ignorecase
endif
return result
enddef
Hope someone else finds it useful.
Salman