Commit Graph

3696 Commits

Author SHA1 Message Date
Qi Xiao
a140f3e622 newedit: De-export BindingMap. 2019-04-20 16:09:01 +01:00
Qi Xiao
5adf29b15f newedit/editutil: In BasicHandler, only insert the character when the key is a character. 2019-04-19 23:02:44 +01:00
Qi Xiao
f798ef1e98 eval/vars: Clean up and add tests. 2019-04-19 19:44:11 +01:00
Qi Xiao
f5f49b746e eval/vals: Test iterate.go. 2019-04-19 18:48:45 +01:00
Qi Xiao
bbaa846638 Fix test on Unix. 2019-04-19 18:37:35 +01:00
Qi Xiao
89aa69d29d eval/vals: Consolidate the utility functions to build lists and maps. 2019-04-19 18:26:27 +01:00
Qi Xiao
135095881b eval/vals: Remove unused rat.go. 2019-04-19 18:05:34 +01:00
Qi Xiao
15aa823a2b eval/vals: Clean up pipe.go. 2019-04-19 18:05:19 +01:00
Qi Xiao
2541087217 eval/vals: Remove structs (superseded by structmaps). 2019-04-19 18:00:40 +01:00
Qi Xiao
9c55f2de48 eval/vals: Make Index of StructMaps use FromGo. 2019-04-19 17:58:55 +01:00
Qi Xiao
7d793e698b eval/vals: StructMap, an easy way to use Go structs as Elvish values.
Also add a lot of unit tests.
2019-04-19 17:41:07 +01:00
Qi Xiao
9368485f75 eval/vals: Rearrange some files. 2019-04-19 15:39:50 +01:00
Qi Xiao
33b8f73051 eval/vals: Make File an alias for *os.File. 2019-04-19 14:25:15 +01:00
Qi Xiao
c5e30e45e9 eval/vals: Add test for Concat. 2019-04-19 14:21:43 +01:00
Qi Xiao
8b3ca8bd02 eval/vals: Simplify the handling of lists and maps.
Also introduce type aliases List and Map to save some typing.
2019-04-19 12:24:45 +01:00
Qi Xiao
fe6fc5b89a eval/vals: Rearrange the switch clauses in the operation functions. 2019-04-19 01:03:56 +01:00
Qi Xiao
a0c53d4c40 eval: BuiltinFn -> GoFn. 2019-04-18 22:58:06 +01:00
Qi Xiao
c8e767b2fd eval: Fix lint errors. 2019-04-18 22:15:34 +01:00
Qi Xiao
a8a6c71fbd Eval: fix a lot of lint errors.
Also fixed the name of a test file, which was probably accidentally renamed.
2019-04-18 22:14:53 +01:00
Kenneth Shaw
72caaf7e8c Updating dependencies (#817)
Second half to PR #801, this updates to latest module dependencies.

Note: this pins golang.org/x/sys to an older version, as more recent
versions introduce a yet-to-be-determined bug on Darwin.
2019-04-17 23:14:32 +02:00
Qi Xiao
c4189114dd eval/vals: Implement ToString for float64, and add tests against ToString. 2019-04-17 21:09:27 +00:00
Qi Xiao
2ce05eb155 Basic support for float64 as an Elvish type. This addresses #816.
Float64 values are printed like (float64 42). However, the float64
builtin does not actually exist yet, and builtin math functions do not
accept float64 arguments either.

However, after this CL, from-json | to-json is now an identity operator.
Previously:

~> echo '[1]' | from-json | to-json
["1"]

Now:

~> echo '[1]' | from-json | to-json
[1]

It is also possible to use from-json to construct float64 values before
the float64 builtin is actually implemented.
2019-04-09 23:46:04 +01:00
Qi Xiao
4c804711c7 eval: Don't turn nil variables into ''. 2019-04-09 22:50:35 +01:00
Qi Xiao
64c939d7c4 Fix crash when using $nil.
This fixes #818.
2019-04-09 22:47:48 +01:00
Qi Xiao
4811ae619e eval: from-json converts JSON null to $nil. 2019-04-07 22:54:51 +01:00
Qi Xiao
f6bdd0e079 Introduce $nil as a valid value.
The value uses the Go nil as the underlying value.
2019-04-07 22:54:51 +01:00
Qi Xiao
e83bad4153 edit/history: Move utilities into subpackage. 2019-04-07 22:54:51 +01:00
Édouard Lopez
8907fdfbe1 Make installation script fish-compatible (#807) 2019-04-06 16:05:54 +01:00
Kenneth Shaw
f22c0f3b8d Convert to Go modules
Converts Gopkg.{toml,lock} to go.{mod,sum} and makes minor changes to
the travis-ci configuration.
2019-04-06 15:59:38 +01:00
Qi Xiao
71d050b31c newedit: Hook up with its Store dependency. 2019-03-18 22:41:38 +00:00
Qi Xiao
fd81492236 Fix tests that leave behind test directories on Windows. 2019-03-18 22:25:24 +00:00
Qi Xiao
c451ce5ad3 store: Expose the test setup function, and clean up properly.
The cleanup relied on the fact that on Unix systems, files used by other
processes may be removed and the underlying filesystem resource is
released when its last reference is closed. However, this technique does
not work on Windows, leading to pollution of the temporary directory.
This commit fixes this by cleaning up the file after the testing
finishes.
2019-03-18 21:44:05 +00:00
Qi Xiao
7a87a07f5b newedit: Simplify dependency interfaces. 2019-03-17 10:35:53 +00:00
Qi Xiao
a2cf05a463 On Windows, enable VT100 escape sequence on startup.
This fixes #798.
2019-03-14 21:42:21 +00:00
Qi Xiao
3f73331ba0 Adjust the order of TTY restoration on Windows.
Normal commands no longer produce unsupported escape sequences. This
addresses #798.
2019-03-14 21:14:43 +00:00
Qi Xiao
150ee696a6 newedit/listing: Support AutoAccept. 2019-03-13 08:46:43 +00:00
Qi Xiao
9027d35465 newedit/listing: Refilter every time filter changes. 2019-03-12 22:10:40 +00:00
Qi Xiao
e3de2eb8b1 Support filtering in listing mode. 2019-03-12 22:01:08 +00:00
Qi Xiao
06fae6494a newedit: Support accepting in listing mode. Add tests. 2019-03-11 12:25:36 +00:00
Qi Xiao
acb95dac00 newedit: Implement $edit:{listing,lastcmd}:binding. 2019-03-10 21:17:28 +00:00
Qi Xiao
6af426499c newedit: Reorganize lastcmd so that it behaves more like a mode. 2019-03-10 19:15:01 +00:00
Qi Xiao
c6d7be11ed newedit/listing: Add basic selection movement support. 2019-03-10 17:09:57 +00:00
Qi Xiao
4c654b6822 edit/ui: Add ui.K as a constructor for ui.Key. 2019-03-10 16:59:27 +00:00
Qi Xiao
5b179a9daa newedit/listing: Go to initial mode after pressing Esc. 2019-03-10 16:59:21 +00:00
Qi Xiao
2ee2352c95 Add _testwin, a small program to manually test console input on Windows. 2019-03-10 15:56:40 +00:00
Qi Xiao
7e10760892 eval: Update boilerplate.py 2019-03-10 15:24:04 +00:00
Qi Xiao
38dde84a0f eval: opBody -> effectOpBody, for consistency. 2019-03-10 15:23:43 +00:00
Qi Xiao
6b900563e4 newedit: Basic listing and lastcmd mode. 2019-03-02 23:12:06 +00:00
Qi Xiao
686e944cb1 edit/ui: Add renderer for content with vertical scrollbar. 2019-03-02 23:12:06 +00:00
Qi Xiao
0cb066d326 edit/ui: Add test cases against renderers. 2019-03-02 23:12:06 +00:00