#34 call onResize() when window size is changed
[fanfix.git] / src / jexer / TEditorWidget.java
index 3d8d57e16569c4d89dbcc8ae3867cb7e00f6a1ff..dcf5e9e6d267380d3b541bf275d4cdef67f8dcea 100644 (file)
@@ -43,7 +43,7 @@ import static jexer.TKeypress.*;
  * TEditorWidget displays an editable text document.  It is unaware of
  * scrolling behavior, but can respond to mouse and keyboard events.
  */
-public final class TEditorWidget extends TWidget {
+public class TEditorWidget extends TWidget {
 
     /**
      * The number of lines to scroll on mouse wheel up/down.
@@ -164,7 +164,7 @@ public final class TEditorWidget extends TWidget {
 
             document.setLineNumber(newLine);
             setCursorY(mouse.getY());
-            if (newX > document.getCurrentLine().getDisplayLength()) {
+            if (newX >= document.getCurrentLine().getDisplayLength()) {
                 document.end();
                 alignCursor();
             } else {