Re: Search for pattern in the first few lines of a buffer

2021-06-20 Thread Yegappan Lakshmanan
Hi, On Sun, Jun 20, 2021 at 3:59 AM Lifepillar wrote: > > I need to programmatically search for a pattern in the first ten lines > of a given buffer, and save the match in a variable when found. Say, the > pattern is: > > % KEY = value > > I need to extract the value if the above appears in

Re: Translating complete functions to Vim9

2021-06-20 Thread Bram Moolenaar
> Is there a way to turn a completion function (:h complete-functions) > into Vim9 script? > > The issue is that such functions are called twice, and they are expected > to return values of different types in each call. You can use the return type "any". I know in typescript it is possible to

Search for pattern in the first few lines of a buffer

2021-06-20 Thread Lifepillar
I need to programmatically search for a pattern in the first ten lines of a given buffer, and save the match in a variable when found. Say, the pattern is: % KEY = value I need to extract the value if the above appears in the first lines of the buffer. Of course, the state of the buffer's