Skip to main content
Module

x/denops_std/function/mod.ts>searchpos

📚 Standard module for denops.vim
Go to Latest
function searchpos
import { searchpos } from "https://deno.land/x/denops_std@v3.6.0/function/mod.ts";

Same as |search()|, but returns a |List| with the line and column position of the match. The first element of the |List| is the line number and the second element is the byte index of the column position of the match. If no match is found, returns [0, 0]. Example: :let [lnum, col] = searchpos('mypattern', 'n') When the 'p' flag is given then there is an extra item with the sub-pattern match number |search()-sub-match|. Example: :let [lnum, col, submatch] = searchpos('(\l)|(\u)', 'np') In this example "submatch" is 2 when a lowercase letter is found |/\l|, 3 when an uppercase letter is found |/\u|. Can also be used as a |method|: GetPattern()->searchpos()

Parameters

denops: Denops
pattern: unknown
optional
flags: unknown
optional
stopline: unknown
optional
timeout: unknown
optional
skip: unknown

Returns

Promise<unknown>