Commit Graph

3707 Commits

Author SHA1 Message Date
Qi Xiao
d4fb9e5ffb newedit/clicore: Editor -> App. 2019-04-25 09:43:41 +01:00
Qi Xiao
5151b4cbbf newedit/editutil -> newedit/cliutil. 2019-04-25 09:32:32 +01:00
Qi Xiao
eef1fd1540 newedit/types -> newedit/clitypes. 2019-04-25 09:31:19 +01:00
Qi Xiao
0e5341b8ce newedit/core -> newedit/clicore. 2019-04-25 09:25:03 +01:00
Qi Xiao
5eaec24f11 newedit: Implement a basic location mode. 2019-04-25 09:12:58 +01:00
Qi Xiao
5e41a4cd40 newedit/histlist: Cleanup. 2019-04-24 21:48:52 +01:00
Qi Xiao
b7f11e6816 _website: Fix Elvish codeblocks. 2019-04-24 20:38:12 +01:00
Qi Xiao
d1a47ec49a _website: Add examples for "if", and document the implicit logical and. 2019-04-24 20:36:06 +01:00
Qi Xiao
5291dae422 newedit: Implement histlist mode.
This addresses #778.
2019-04-22 23:39:51 +01:00
Qi Xiao
a46d854ab5 Provide a constructor for tty.KeyEvent.
And fix linter errors in newedit/listing by using this new constructor.
2019-04-20 17:34:59 +01:00
Qi Xiao
6eb319f661 newedit: Call st.AddCmd after readline. 2019-04-20 17:13:05 +01:00
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