export class cursorLocator {
	constructor() {
		this._editor = document.getElementById('editor');
		this._lines = this._editor.getElementsByClassName('lines')[0]?.children;
	}
	
	// cursorがどこかにいるかどうかを返す
	hasFocus() {
		return !!this._cursorLine;
	}
	
	// cursorがいる行の行番号と行idを返す
	// タイトル行を0行目とする
	// @return {index:number; id:string}?
	get line() {
		const currentLine = this._cursorLine;
		return {index: [...this._lines].indexOf(currentLine), id: this.currentLine.id};
	}