<commit_before>/*
    <NAME>

    Class used to get and set cursor position in the current document
    
*/

const vscode = require('vscode');

//----------------------------------------------------
// class defining a single field value and the filename it was found in
class CursorManager {
	// return the current cursor position
	get CursorPosition() {
		const editor = vscode.window.activeTextEditor;
		const position = editor.selection.active;
		return position;
	}

	// set the position of the cursor in the document
	set CursorPosition(CursorLocation) {
		const editor = vscode.window.activeTextEditor;
		var newPosition = new vscode.Position(CursorLocation.Line, CursorLocation.Character);
		var newSelection = new vscode.Selection(newPosition, newPosition);
		editor.selection = newSelection;
	}
}

exports.CursorManager = CursorManager;<commit_msg>v1.9 changes. Scroll to cursor if outside of viewport added<commit_after>/*
    <NAME>

    Class used to get and set cursor position in the current document
    
*/

const vscode = require('vscode');

//----------------------------------------------------
// class defining a single field value and the filename it was found in
class CursorManager {
	// return the current cursor position
	get CursorPosition() {
		const editor = vscode.window.activeTextEditor;
		const position = editor.selection.active;
		return position;
	}

	// set the position of the cursor in the document. Reveal the cursor position (if not in the viewport).
	set CursorPosition(CursorLocation) {
		const editor = vscode.window.activeTextEditor;
		var newPosition = new vscode.Position(CursorLocation.Line, CursorLocation.Character);
		var newSelection = new vscode.Selection(newPosition, newPosition);
		var newRange = new vscode.Range(newPosition,newPosition);
		editor.selection = newSelection;
		editor.revealRange(newRange, vscode.TextEditorRevealType.InCenterIfOutsideViewport);
	} 
}

exports.CursorManager = CursorManager;
{'fraction_non_alphanumeric': 0.12983706720977597, 'fraction_numerical': 0.0010183299389002036, 'mean_word_length': 3.376391982182628, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3058047', 'n_tokens_mistral': 554, 'n_tokens_neox': 528, 'n_words': 173}