import * as assert from "assert" ; import * as Oni from "oni-api" ; import { createNewFile , getTemporaryFilePath , insertText , navigateToFile } from "./Common" ; export const test = async ( oni ) => { await oni . automation . waitForEditors ( ) ; createNewFile ( "ts" , oni ) ; await insertText ( oni , "console.log('apple')" ) ; const activeBuffer = oni . editors . activeEditor . activeBuffer ; const { cursorOffset } = activeBuffer ; assert . equal ( cursorOffset , 20 ) ; const { line , character } = await activeBuffer . convertOffsetToLineColumn ( cursorOffset ) ; assert . equal ( line , 0 ) ; assert . equal ( character , 19 ) ; const { line : currentLine , character : currentCharacter , } = await activeBuffer . getCursorPosition ( ) ; assert . strictEqual ( line , currentLine ) ; assert . strictEqual ( currentCharacter , character ) ; } ;