} else if (keypress.equals(kbRight)) {
document.right();
alignTopLine(true);
+ } else if (keypress.equals(kbAltLeft)
+ || keypress.equals(kbCtrlLeft)
+ ) {
+ document.backwardsWord();
+ alignTopLine(false);
+ } else if (keypress.equals(kbAltRight)
+ || keypress.equals(kbCtrlRight)
+ ) {
+ document.forwardsWord();
+ alignTopLine(true);
} else if (keypress.equals(kbUp)) {
document.up();
alignTopLine(false);
&& !keypress.getKey().isCtrl()
) {
// Plain old keystroke, process it
- // TODO: fix document to use ints, not chars
document.addChar(keypress.getKey().getChar());
alignCursor();
} else {
}
}
+ /**
+ * Set the current visible column number. 1-based.
+ *
+ * @return the visible column number. Column 1 is the first column.
+ */
+ public int getVisibleColumnNumber() {
+ return leftColumn + 1;
+ }
+
+ /**
+ * Set the current visible column number. 1-based.
+ *
+ * @param column the new visible column number. Column 1 is the first
+ * column.
+ */
+ public void setVisibleColumnNumber(final int column) {
+ assert (column > 0);
+ if ((column > 0) && (column < document.getLineLengthMax())) {
+ leftColumn = column - 1;
+ alignDocument(true);
+ }
+ }
+
/**
* Get the current editing column number. 1-based.
*