double-click support
[fanfix.git] / src / jexer / TEditorWidget.java
index 823dea2d113c2d62b66e164dc06b2ce070e8cb69..3d8d57e16569c4d89dbcc8ae3867cb7e00f6a1ff 100644 (file)
@@ -385,6 +385,28 @@ public final class TEditorWidget extends TWidget {
         return document.getLineCount();
     }
 
+    /**
+     * Get the current visible top row number.  1-based.
+     *
+     * @return the visible top row number.  Row 1 is the first row.
+     */
+    public int getVisibleRowNumber() {
+        return topLine + 1;
+    }
+
+    /**
+     * Set the current visible row number.  1-based.
+     *
+     * @param row the new visible row number.  Row 1 is the first row.
+     */
+    public void setVisibleRowNumber(final int row) {
+        assert (row > 0);
+        if ((row > 0) && (row < document.getLineCount())) {
+            topLine = row - 1;
+            alignDocument(true);
+        }
+    }
+
     /**
      * Get the current editing row number.  1-based.
      *