Commit Graph

419 Commits

Author SHA1 Message Date
Qi Xiao
34e4f68bc0 Put terminal fd in blocking mode when writing.
This fixes #140.
2016-02-21 17:13:00 +00:00
Qi Xiao
d2d119af7f Move functionality of edit/search.go to util. 2016-02-21 14:32:13 +01:00
Zirak
bf64621b7e edit: Fix crash in history listing mode
When you had too few history entries to display in the terminal,
entering history listing mode attempted to access a negative index and
crashed.
2016-02-20 12:31:47 +00:00
Qi Xiao
83b214e31c edit: When doing a refresh, erase just once in the beginning.
Previously if you bind `le:binding[insert][Ctrl-L] = { put * }`, there is a
small defect that is readily observed by pressing Ctrl-L repeatedly:
the prompt will never go to the bottom of terminal, but always kept one line
higher than the bottom.

This is because invoking a closure from the editor causes a full refresh,
which in turn causes an erase to be done near the end of writer.refresh,
which, in the old algorithm, always adds a superfluous newline.

By doing the erase at the very beginning, we avoid the superfluous newline.
Now pressing Ctrl-L repeatedly will push the prompt to the bottom.
2016-02-20 03:05:03 +01:00
Qi Xiao
5c03407a8a Wait for store jobs to finish when exiting.
This fixes #144 #147.
2016-02-20 02:32:12 +01:00
Qi Xiao
b2dbfaee39 Sort variables in completion. 2016-02-19 20:54:40 +01:00
Qi Xiao
7502b61b3e Don't style variables in completion menu. 2016-02-19 20:51:08 +01:00
Qi Xiao
2cdbf67147 Slightly simplify Repr. 2016-02-19 20:31:54 +01:00
Qi Xiao
2413edcc09 Implement pretty printing.
This fixes #112.
2016-02-19 20:11:31 +01:00
Qi Xiao
7efeb9c56f Remove ContextualError. 2016-02-19 17:46:21 +01:00
Qi Xiao
be3b938bcf The compiler no longer takes name and source. 2016-02-19 17:33:55 +01:00
Qi Xiao
9a2c30dd3e edit: Don't show tips when about to exit ReadLine. 2016-02-19 17:26:44 +01:00
Qi Xiao
50af039e16 Introduce a ListLike interface, let *EnvPathList implement it.
All embedded Value's have been removed from the interfaces in edit/value.go.
2016-02-19 12:19:19 +01:00
Qi Xiao
99eb48b2b5 Fix display of parser error 2016-02-16 19:58:47 +01:00
Qi Xiao
5db90fd20f Merge *util packages into an util package. 2016-02-16 19:15:29 +01:00
Qi Xiao
64c9bf842d edit: Hide errors at the end. 2016-02-16 14:47:14 +01:00
Qi Xiao
b86ff2eb06 Show parser errors as well. 2016-02-16 14:32:35 +01:00
Qi Xiao
9ca0f83256 Show content of compiler error. 2016-02-16 13:55:10 +01:00
Qi Xiao
a016fb8cbe Add an XXX about concurrency-safety. 2016-02-16 13:04:43 +01:00
Qi Xiao
4a5f836626 Show output of key-bound function in notification. 2016-02-16 12:13:35 +01:00
Qi Xiao
5000c60813 add Eval.Struct, use it to wrap structs. 2016-02-15 22:36:37 +01:00
Qi Xiao
fa8a69c5d3 edit: Fix interface of BindingTable. 2016-02-15 18:34:31 +01:00
Qi Xiao
a8635caab7 Use \e[2m (dim) as the style for completion and history. 2016-02-15 13:37:08 +01:00
Qi Xiao
d1fbe07f46 edit: Insert history in a separate goroutine. 2016-02-15 09:56:44 +01:00
Qi Xiao
0afe57b179 Parse G3 arrow keys. 2016-02-14 18:31:36 +01:00
Qi Xiao
b9a2693e57 edit: Only write bufListing when necessary. 2016-02-14 17:52:06 +01:00
Qi Xiao
a1abcdff28 Disable mouse tracking for now. 2016-02-14 15:35:32 +01:00
Qi Xiao
09c91f2628 edit: Break mode-changing sequences apart. 2016-02-14 15:35:07 +01:00
Qi Xiao
0e981ee6de Preliminary parsing of control structures. 2016-02-14 15:29:00 +01:00
Qi Xiao
fe2b07e936 Add a history listing mode. 2016-02-14 07:52:31 +00:00
Qi Xiao
d377d89dcb Fix logger prefixes. 2016-02-13 21:40:54 +01:00
Qi Xiao
4ed010ab7d Edit: Update the render algorithm.
The old erase sequence is restored and explained in the comment. Some
unncessary sequences are suppressed.
2016-02-13 21:38:33 +01:00
Qi Xiao
725d1d48c8 Fix last commit. 2016-02-13 21:06:35 +01:00
Qi Xiao
8e728ef076 Allow setting log file at runtime. 2016-02-13 21:05:35 +01:00
Qi Xiao
9483c60f19 edit: Simplify the erase sequence. 2016-02-13 20:54:39 +01:00
Qi Xiao
fee18f2543 edit: Use %+v to print mouse event. 2016-02-13 20:37:21 +01:00
Qi Xiao
089d4ad79c edit: read "normal" mouse event as well. 2016-02-13 20:37:02 +01:00
Qi Xiao
874855e967 edit: fix addTip. 2016-02-13 20:35:06 +01:00
Qi Xiao
3c718a9bff edit: Adjust reader logic to deal with CSI starter. 2016-02-13 20:19:14 +01:00
Qi Xiao
26c4eba04c Initialize currentSeq properly. 2016-02-13 19:43:49 +01:00
Qi Xiao
1dd89b8fe6 edit: Support multi-line tips.
The line-cutting strategy has also been refined.
2016-02-13 19:40:43 +01:00
Qi Xiao
55e3f4b029 pushTip -> addTip; make it nicer to use. 2016-02-13 19:27:21 +01:00
Qi Xiao
c08ae1ea54 edit: More small refactor. 2016-02-13 19:21:29 +01:00
Qi Xiao
4586199219 edit: Small refactor. 2016-02-13 19:17:20 +01:00
Qi Xiao
011f4dcaa2 Fix select-history-next. 2016-02-13 16:45:16 +01:00
Qi Xiao
2be8cef135 Fix compilation. 2016-02-13 16:42:08 +01:00
Qi Xiao
0785b4a847 Use pushTip for mouse event. 2016-02-13 16:41:25 +01:00
Qi Xiao
2c97375636 Consider bufNoti when calculating the height of bufListing. 2016-02-13 16:40:02 +01:00
Qi Xiao
213e43ee1b Implement notification.
This fixes #122.
2016-02-13 16:35:16 +01:00
Qi Xiao
d7cbcffdbf Remove per-session history.
This fixes #116.
2016-02-13 15:12:19 +01:00