vertical bar cursor option
authorKevin Lamonte <kevin.lamonte@gmail.com>
Fri, 16 Aug 2019 00:18:33 +0000 (19:18 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Fri, 16 Aug 2019 00:18:33 +0000 (19:18 -0500)
src/jexer/backend/SwingTerminal.java

index ce26efee97ada8436701c5c373b650a5d9dd3909..283d1ae141071590e903926994ed915074cb7365 100644 (file)
@@ -117,7 +117,12 @@ public class SwingTerminal extends LogicalScreen
         /**
          * Use an outlined block for the cursor.
          */
-        OUTLINE
+        OUTLINE,
+
+        /**
+         * Use a vertical bar for the cursor.
+         */
+        VERTICAL_BAR,
     }
 
     // ------------------------------------------------------------------------
@@ -648,6 +653,8 @@ public class SwingTerminal extends LogicalScreen
             cursorStyle = CursorStyle.OUTLINE;
         } else if (cursorStyleString.equals("block")) {
             cursorStyle = CursorStyle.BLOCK;
+        } else if (cursorStyleString.equals("verticalbar")) {
+            cursorStyle = CursorStyle.VERTICAL_BAR;
         }
 
         // Pull the system property for triple buffering.
@@ -1302,6 +1309,9 @@ public class SwingTerminal extends LogicalScreen
             case OUTLINE:
                 gr.drawRect(xPixel, yPixel, cursorWidth - 1, textHeight - 1);
                 break;
+            case VERTICAL_BAR:
+                gr.fillRect(xPixel, yPixel, 2, textHeight);
+                break;
             }
         }
     }