Commit Graph

429 Commits

Author SHA1 Message Date
Qi Xiao
bb1078d002 Trivial cleanup. 2016-02-24 13:18:16 +01:00
Qi Xiao
0fc6c01077 edit/reader.go: Make race detector happy. 2016-02-23 14:55:56 +01:00
Qi Xiao
67e4b5df11 Prompt can now be customized by modifying le:{,r}prompt.
This fixes #103.
2016-02-23 13:24:28 +01:00
Qi Xiao
9d7e5de667 edit: Add a Prompt interface, going to support customizable prompt. 2016-02-23 13:08:41 +01:00
Qi Xiao
e90c3fc984 Nav mode hides dotfiles by default. ^H triggers.
This resolves #114.
2016-02-23 03:00:19 +01:00
Qi Xiao
619f274f61 Put writer log under a flag. 2016-02-22 23:10:25 +01:00
Qi Xiao
60ea1ffb35 Add logging; don't relay signal from stub after seeing EOF. 2016-02-22 23:06:00 +01:00
Qi Xiao
6fbadd6f31 Add a builtin namespace. Now this is really Pythonic.
The "acme" builtin module finally works.
2016-02-22 22:56:23 +01:00
Qi Xiao
92d34ec78d edit: New "smart-enter" builtin to insert newline when input is incomplete. 2016-02-22 13:46:35 +01:00
Qi Xiao
0396de6b91 edit: Fix how asyncReader writes to error channel. 2016-02-21 18:12:51 +00:00
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