As with commit #eb2a792 I acknowledge that `golint` recommendations are
controversial and should not automatically be acted on. Nonetheless,
this change fixes legitimate lint issues such as copy/paste cleanups,
style problems I introduced (`i += 1` versus `i++`) or method/var comments
that are not in the preferred form.
There are some Navigation mode corner cases whose current behavior is
surprising. Such as inserting a space before the filename when the space
isn't wanted or redundant. Also, selecting an empty directory and pressing
Enter should insert nothing rather than an empty string.
Fixes#1169
I was working on issue #661 and noticed that github.com/kr/pty was dead
when I ran into a problem with that module on macOS (GOARCH == darwin).
Replace that dependency with github.com/creack/pty which is ostensibly
being actively maintained.
I also chose to remove a couple of obsolete module signatures at the
same time.
Most of the code uses keyed fields in composite literals; i.e., struct
literals. However, running `go vet ./...` reports a few places that use
anonymous fields. This modifies those composite literals to use keyed
fields. This does make the code a bit more verbose without reducing
the likelihood of a bug. But it does make the code more consistent, use
best practices, and make it easier to notice if a potential problem is
introduced when running `go vet ./...` since that command now produces
no diagnostic output.
I considered adding a `make vet` target that explicitly ran
go vet -composites=false ./...
I decided not to do that since consistently using keyed composite literals
is preferable to having a mix of keyed and unkeyed composite literals.
This also removes the unused `ExampleLoop` function which causes this
`go vet` warning:
pkg/cli/loop_test.go:130:1: ExampleLoop refers to unknown identifier: Loop
I started by writing tests for sys.Ioctl but after I had 100% coverage
of that function it occurred to me the function could be eliminated.
Related #1062
I stumbled across a comment that began with "XXX". It was clearly meant as
a "TODO" comment. This changes all such occurrences. However, a few "XXX"
comments are ambiguous and a better prefix might be "WARNING". The "TODO"
prefix at least ensures someone, eventually, looks into the situation
and either rewords the comment or fixes the problem. This change means
everyone can assume searching for "// TODO" will find all such comments
rather than requiring they also know to search for "// XXX".
I started by writing tests for sys.Ioctl but after I had 100% coverage
of that function it occurred to me the function could be eliminated.
Related #1062
In addition to an uncontroversial spelling fix this addresses several,
related, warnings produced by the `golint` tool. In general I agree with
golint that unnecessary "else" blocks should be avoided. So this change
refactors those cases.
Note: I recognize that `golint` is deprecated (see
https://github.com/golang/go/issues/38968) since it is no longer being
maintained and there is controversy about its set of warnings. Nonetheless,
it appears that the warnings it emits for this project are all reasonable
and actionable with one potential exception: the naming of the `map_`
method in pkg/eval/compile_value.go.
- Organize code around two interfaces, Store and Cursor.
- Ensure that a session store is always available, even if the DB is not
accessible.
This fixes#909.
Since elvish does not support job control it should run all external
commands with the tty job control signals set to be ignored. See "APUE",
third edition, page 379.
This doesn't actually fix the problem in the case of broken programs
like vim which blindly assume the parent process implements job control.
But there isn't much we can do about that other than try to get those
programs to pay attention to being told to ignore SIGTSTP.
Fixes#988
Augment the implementation by adding support for small word based
expansion to that mimics typical editor behavior. This also makes it
safer to create and use abbreviations that consist of alphanum sequences
without having them expanded in unexpected places.
Resolves#947
The current style of red BG makes for low contrast on white-on-black color
palettes. Force its foreground to bright-white to work well in all situations.
The w.update call was after app.MutateState, so it could potentially race with a
w.Render call (which calls w.update). Moving it before app.MutateState fixes the
race condition.
This addresses #73.