From 10a43896f91da2e0d2a52e24261907eae9cf263f Mon Sep 17 00:00:00 2001 From: shriprem <45252729+shriprem@users.noreply.github.com> Date: Sat, 17 Aug 2019 16:31:45 -0400 Subject: [PATCH] Create GotoLineCol_Barebones.py This file has only four lines of code. Intended to give a quick understanding of the core functionality in the main GotoLineCol.py script, --- scripts/Samples/GotoLineCol_Barebones.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 scripts/Samples/GotoLineCol_Barebones.py diff --git a/scripts/Samples/GotoLineCol_Barebones.py b/scripts/Samples/GotoLineCol_Barebones.py new file mode 100644 index 00000000..484551a0 --- /dev/null +++ b/scripts/Samples/GotoLineCol_Barebones.py @@ -0,0 +1,6 @@ +curLine = editor.lineFromPosition(editor.getCurrentPos()) + +line = int( notepad.prompt('Line Number:', 'Navigate to a line and character position', str(curLine + 1) )) +pos = int( notepad.prompt('Character Position:', 'Navigate to a line and character position', str( editor.getCurrentPos() - editor.positionFromLine(curLine) + 1 ) )) + +editor.gotoPos(editor.positionFromLine(line - 1) + pos - 1)