Qi Xiao
51e4d97568
interface{} -> any now that Elvish requires Go 1.18.
2022-03-20 16:17:19 +00:00
Qi Xiao
8cbd39f006
Support calling edit:notify with a styled text.
...
This fixes #1438 .
2021-12-08 00:26:17 +00:00
Qi Xiao
d71e52cbd7
Refactor the API of eval.NsBuilder to be completely based on methods.
2021-10-23 21:44:11 +01:00
Qi Xiao
db0b88f664
Rename pkg/cli/mode -> pkg/cli/modes.
2021-09-03 20:44:04 +01:00
Qi Xiao
1bfcaeb218
Support a stack of addons in cli.App.
...
This is motivated by supporting a minibuf from any mode (even in minibuf mode
itself), but could have other applications too.
2021-08-30 00:55:09 +01:00
Qi Xiao
9af7297f75
pkg/cli/mode: Expose the instant mode as a widget.
2021-02-13 23:21:39 +00:00
Qi Xiao
7f0463a156
pkg/cli: Pass the widget to binding bodies.
...
A new type, tk.Bindings is defined for bindings. It is always called with the
widget currently handling the event, in addition to the event being handled.
2021-02-12 21:34:47 +00:00
Qi Xiao
0427c536d0
Simplify the API of pkg/cli.
...
* Move all widget types to a new pkg/cli/tk.
* Move Mode{Line Prompt} to a new pkg/cli/mode.
* Move all packages in pkg/cli/addons to pkg/cli/mode.
* Remove WriteListing.
* Remove StdTTY.
* Rename GetCodeBuffer to CodeBuffer.
2021-02-11 19:24:37 +00:00
Qi Xiao
278e7d7191
Improve API of pkg/edit.
...
* De-export BindingMap, as it is only used within the package.
* Improve the godoc of the Editor type.
2021-02-11 01:50:45 +00:00
Qi Xiao
196eea21d4
Change module import path to src.elv.sh
2021-01-27 01:30:25 +00:00
Qi Xiao
2033600881
pkg/eval: Clean up Port related code.
2021-01-05 05:23:17 +00:00
Qi Xiao
e43492ba17
pkg: Move edit.capturePort to eval.CaptureStringPort.
2021-01-02 02:39:03 +00:00
Qi Xiao
f92ae06a04
pkg/edit: In instant mode, use (*Evaler).Eval to evaluate the code.
...
This avoids the use of the more low-level eval.NewTopFrame call, and is another
step in making (*Evaler).Eval a unified entry point for evaluating code.
2021-01-02 02:24:12 +00:00
Qi Xiao
6419f4524a
Implement namespaces using slices instead of maps.
...
More related improvements and cleanups will be done in followup commits.
This fixes #1139 .
2020-12-25 17:46:46 +00:00
Qi Xiao
27fa20d65e
pkg/eval: Move ChopLineEnding to the strutil package.
...
Also add unit tests.
2020-09-04 21:16:06 +01:00
Qi Xiao
eb37f92300
pkg/eval: Use eval.ChopLineEnding everywhere for removing line ending.
2020-05-06 23:10:57 +01:00
Qi Xiao
ba7bedcbd9
Support \r\n everywhere output is processed as individual lines.
...
This fixes #970 .
2020-05-03 23:30:23 +01:00
Qi Xiao
90d212abe6
pkg/edit: Change the notifier interface to be implemented by *Editor.
...
This is preparing for the work of saving exceptions in a variable (#945 ).
2020-05-02 23:28:42 +01:00
Qi Xiao
c767f92d01
Support compile-time deprecation.
...
This fixes #898 .
2020-04-26 13:14:51 +01:00
Qi Xiao
20979b44a2
pkg/parse: Use Source values, not pointers.
...
The Source type is small enough that using values is likely more efficient.
2020-04-25 19:22:38 +01:00
Qi Xiao
b8505c7065
pkg/eval/source.go -> pkg/parse/source.go.
2020-04-25 18:26:17 +01:00
Qi Xiao
53a1eca9af
pkg/eval: Remove New*Source functions.
...
All call sites of such functions are replaced with simple &Source{...}
expressions.
2020-04-25 13:22:07 +01:00
Qi Xiao
d77ad829b6
pkg/eval: Add Evaler.ParseAndCompile.
...
Also require a name argument in NewInteractiveSource.
2020-04-14 23:54:45 +01:00
Qi Xiao
096ee354d6
pkg/eval: Simplify API for output capture.
2020-04-10 01:12:25 +01:00
Qi Xiao
eb38fb0259
Make sure that changes introduced in 0.13 are documented.
2019-12-26 16:31:24 +00:00
Qi Xiao
8fd49cada9
Merge pkg/cli/el/* into pkg/cli.
2019-12-26 01:15:24 +00:00
Qi Xiao
e45fdf7228
Move all libraries to new pkg/.
2019-12-23 20:00:59 +00:00