summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-09-07 06:33:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-09-07 06:33:46 -0700
commit4c7c4e5fc3c53fca40d619e73b891269feffa010 (patch)
treec84e008f2773c32ecf748faee1e6b784c2638586 /parser.l
parentf7e9981975a28b36ae30340e11f3b79abd31e8b0 (diff)
downloadtxr-4c7c4e5fc3c53fca40d619e73b891269feffa010.tar.gz
txr-4c7c4e5fc3c53fca40d619e73b891269feffa010.tar.bz2
txr-4c7c4e5fc3c53fca40d619e73b891269feffa010.zip
linenoise: visual feedback for incomplete entry.
When a line of input is incomplete and the cursor is at the end of that line, hitting Enter causes an uncomfortable ambiguity. Although the cursor moves to the next line, it is not clear whether that is because the input is being accepted, or whether the expression which was entered is executing. For instance, these appear to behave the same way: > (while t[Enter][Enter]... > (while t)[Enter][Enter]... One is just waiting for more input; the other is sitting in an infinite loop just echoing the newline characters. To partially address this issue, we introduce a visual feedback mechanism. When Enter is issued at the end of an incomplete line, then immediately after the insertion of Enter, the character ! is flashed twice, alerting the user that the line is incomplete. In other situations, there isn't any feedback. An infinite loop or lengthy calculation like (while t) looks the same as code which is reading input like (get-line). * linenoise/linenoise.c (LINNOISE_FLASH_DELAY): New macro. (flash): New static function. (edit): Call flash to flash the ! character when Enter is issued at the end of an incomplete line, and we are not in paste mode.
Diffstat (limited to 'parser.l')
0 files changed, 0 insertions, 0 deletions