Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.byte2line

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.byte2line
import { fn } from "https://deno.land/x/ddc_vim@v4.0.5/deps.ts";
const { byte2line } = fn;

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>