- Rename the method from "Close" to "Dimiss" to avoid any conflict with the
standard interface{ Close() error }
- Remove the "accept" parameter from the Dismiss method and App.PopAddon - it is
false in most places, and the few places that pass accept=true has knowledge
of how to accept the state in the particular widget.
- edit:history:accept has been removed as a consequence - it is never
documented, and is not currently used by any Elvish code published on GitHub
(https://github.com/search?q=%22edit%3Ahistory%3Aaccept%22+extension%3Aelv&type=Code)
This is needed since there can now be an arbitrary number of widgets competing
for vertical space.
- Add a new MaxHeight method to the tk.Widget interface to provide hint on how
to distribute the height.
- Implement the algorithm in distributeHeight in cli/app.go.
A test in navigation_mode.go verifies that a certain key has no effect. It does
that by verifying that the buffer has not changed, which results in a race
condition: the verification might happen after the key is handled, in which
case the test works. But the verification may also happen before the key is
actually handled, in which case the key handling code has not run and thus has
no coverage.
Fix this by queueing another key that would result in an unrelated buffer
change, thus indirectly verifying that the previous key had no effect.
Also simplify the logic of AltGr handling. It seems that AltGr and
AltGr+Shift don't actually combine with any other modifiers, so we can
test whether filteredMod is leftCtrl|rightAlt or
leftCtrl|rightAlt|shift, and leave the Mod field unpopulated in the
return value.
I noticed that testutil.MustPipe was not covered by any unit tests. This
converts the handful of places that should use it to do so. This changes
the coverage of pkg/testutil/must.go from 61.5% to 73.1%. There isn't
any way to increase that further without explicitly testing the panic
paths.
The "-count" flag causes the test functions to be invoked multiple times. Since
some tests mutate their test data or some global state, they will fail when
invoked with a count larger than 1.
This commit changes *some* of such tests to either avoid mutating the test data,
or resetting the global state. Some such tests still remain and will be fixed later.