| Commit message (Collapse) | Author | Age |
| ... | |
| |
|
|
| |
Moving the window on macOS would cause a panic in certain circumstances.
|
| | |
|
| |
|
|
|
|
| |
Using underscores because it's easy. It's also wrong.
cc #11
|
| |
|
|
|
|
|
|
| |
The terminal mutex is no longer released between event processing and
doing a draw. This may fix the race condition with data arriving but not
being displayed until a subsequent event.
cc #29
|
| | |
|
| |
|
|
|
| |
Searching on the ref tests would find matches in the terminal recording
files and completely screw up the screen state.
|
| |
|
|
|
|
| |
Long lines were previously broken at the terminal width. Now, a wrapping
marker is kept on the final cell so that extra newlines are not
inserted.
|
| | |
|
| |
|
|
| |
The reloaded config was not used immediately.
|
| |
|
|
| |
Still need automatic loading into selection copy buffer for linux.
|
| |
|
|
|
|
|
|
|
|
| |
The somewhat redundant KeyBinding and MouseBinding types were removed in
favor of a Binding<T> type. This allows all binding code to be reused
for both scenarios.
The binding tests were fixed by only asserting on `is_triggered_by()`
instead of checking that the action escape sequence was delivered
properly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The event handling code grew organically over time, and with that came a
number of warts. The primary issue was with passing some random
selection of arguments to the input::Processor based on what the input
was. There was the issue that if multiple events were drained from a
single PollEventsIterator, the terminal mutex was potentially locked and
unlocked many times. Finally, and perhaps most importantly, there was no
good way to pass necessary state to the Action executor without going
through several API layers.
To fix all that, the input::ActionContext and input::Processor are now
generated once per call to the event::Processor. The input::Processor
holds onto the ActionContext so that it doesn't need to be passed
through layers of function calls. When a binding is activated, the
ActionContext is simply passed to the handler.
This did have the effect of breaking the input::Processor tests
(specifically, those relating to bindings). The issue was not addressed
in this commit since a larger refactor of the bindings is planned which
should also improve testability.
|
| |
|
|
|
|
|
| |
Various functions take some permutation of the current selection, the
terminal, and a notifier. Instead of having to juggle some number of
arguments everywhere, the `ActionContext` is constructed and then passed
around.
|
| |
|
|
| |
Only works with strings, currently.
|
| |
|
|
|
|
| |
This adds the ability to click and drag with the mouse and have the
effect of visually selecting text. The ability to copy the selection
into a clipboard buffer is not yet implemented.
|
| |
|
|
|
| |
The main refactor broke config reloading; specifically, colors were not
updating for subsequent draws.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
All of the changes in this commit are due to clippy lints.
|
| |\
| |
| | |
add fish_cc ref
|
| |/
|
|
| |
and update Cargo.lock
|
| |
|
|
| |
Resolves #25
|
| |
|
|
|
|
|
| |
This adds a trait OnResize and a separate method handle_resize to the
display. Instead of having a callback to receive resize events, a list
of &mut OnResize are passed to this new method. Doing this allowed the
only RefCell usage in the codebase to be removed :).
|
| | |
|
| |
|
|
|
|
|
| |
The cell under the cursor is now tracked in the input processor at
`self.mouse.line` and `self.mouse.column`. This could probably be
optimized to only compute the cell when in certain states, but the
calculation is cheap.
|
| | |
|
| |
|
|
|
| |
This makes scrolling work for mouse wheels (was previously just
trackpads).
|
| |
|
|
|
|
|
|
| |
* config::Monitor is more ergonomic and self-contained
* Fixed an issue with macOS resize. Previously, the terminal was marked
as dirty in the window resize handler, but the display can't do that.
Instead, the event processor returns a flag whether it was requested
to wakeup.
|
| |
|
|
|
|
|
|
|
|
| |
This is part of an ongoing decoupling effort across the codebase and
tidying effort in main.rs. Everything to do with showing the window with
a grid of characters is now managed by the `Display` type. It owns the
window, the font rasterizer, and the renderer. The only info needed from
it are dimensions of characters and the window itself for sizing the
terminal properly. Additionally, the I/O loop has access to wake it up
when new data arrives.
|
| |
|
|
| |
The doc comment outlines my plan about cleaning up this function.
|
| | |
|
| |
|
|
|
|
|
|
| |
Adds a wrapper for the glutin::Window which provides strongly typed
APIs and more convenient interfaces. Moves some gl calls into the
opengl-based renderer.
The point of most of the changes here is to clean up main().
|
| |
|
|
|
| |
This cleans up the Config::load API significantly. Several miscellaneous
comments were also added.
|
| |
|
|
|
|
| |
This introduces the `cli` module and the `cli::Options` type. This type
holds all the options passable on the command line in addition to
providing arg parsing.
|
| | |
|
| |
|
|
|
| |
The identify_terminal function signature had to change to support
writing to the terminal before processing additional input.
|
| | |
|
| |
|
|
|
|
|
| |
glutin::Window is not threadsafe; putting it into an Arc is
misleading (although the glutin::Window type claims to be Send + Sync).
The reference was just needed on the main thread anyway, so it's better
to just pass a ref around directly.
|
| |
|
|
|
|
|
|
| |
There's now a ColorList type that provides strongly typed indexing for
not only usize but NamedColor as well. Previously, the `NamedColor` was
casted to a `usize` when indexing the colors. Additionally, only one
copy of the ColorList needs to exist;it's borrowed from the `Config`
when rendering, and the renderer doesn't need a copy.
|
| |
|
|
|
|
|
|
| |
ANSI escape sequences like `\x1b[48;5;10m` were not supported until now.
Specifically, the second attribute, 5, says that the following attribute
is a color index.
The ref tests were updated since `enum Color` variants changed.
|
| |
|
|
|
|
|
| |
This probably should have been renamed in the original refactor, but oh
well. `render_cells()` takes a generic parameter `I` which is any
`Iterator<Item=IndexedCell>` and is thus no longer coupled to the grid
type. Renaming it reflects that.
|
| |
|
|
|
| |
Binding/Action execute now has access to TermMode to support bracketed
paste mode.
|
| |
|
|
|
| |
The cell module was previously implemented within term.rs. Now each
module has its own file.
|
| |
|
|
| |
Also fixes formatting on the Term::new method signature.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The terminal now has a `renderable_cells()` function that returns a
`RenderableCellIter` iterator. This allows reuse of the cell selection
code by multiple renderers, makes it testable, and makes it
independently optimizable.
The render API now takes an `Iterator<Item=IndexedCell>` to support both
the new renderable cells iterator and the `render_string()` method which
generates its own iterator.
The `vim_large_window_scoll` ref test was added here because it provides
a nice large and busy grid to benchmark the cell selection with.
|
| |
|
|
|
| |
Was reading through the code and realized this function could be cleaned
up significantly.
|
| |
|
|
| |
Linebased scrolling is still unsupported (need a mouse to test with).
|
| |
|
|
| |
This allows the user for eg clicking columnts in htop to sort.
|