Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/function/mod.ts>byte2line

๐Ÿ“š Standard module for denops.vim
Go to Latest
function byte2line
import { byte2line } from "https://deno.land/x/denops_std@v5.0.2/function/mod.ts";

Return the line number that contains the character at byte count {byte} in the current buffer. This includes the end-of-line character, depending on the 'fileformat' option for the current buffer. The first character has byte count one. Also see line2byte(), go and :goto.

Returns -1 if the {byte} value is invalid.

Can also be used as a method:

GetOffset()->byte2line()

not available when compiled without the +byte_offset feature

Parameters

denops: Denops
byte: number

Returns

Promise<number>