Commit Graph

14 Commits

Author SHA1 Message Date
Joe Wilm 689e0f4ad7 Unify Cursor, Location and name it Point 2016-12-29 11:09:29 -05:00
Joe Wilm 115a4085b4 Fix selection copy for long lines
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.
2016-12-29 10:43:58 -05:00
Joe Wilm ae470bf68b Implement copying selection for macOS
Still need automatic loading into selection copy buffer for linux.
2016-12-26 22:56:19 -05:00
Joe Wilm 6e708d2119 Implement visual component of mouse selections
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.
2016-12-22 13:44:13 -05:00
Joe Wilm bde4dacc79 Misc formatting fixes 2016-12-16 22:48:04 -08:00
Joe Wilm dc918ae71a Rustup and clippy
All of the changes in this commit are due to clippy lints.
2016-12-16 22:13:51 -08:00
Joe Wilm 0b3d2dac44 Handle overflow in Term::move_backward
Resolves #25
2016-12-15 09:13:34 -08:00
Joe Wilm 1a1b740c38 Remove need for Rc<RefCell<_>> usage
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 :).
2016-12-12 09:31:48 -08:00
Joe Wilm 4b63bddd55 Track terminal cells on mouse movement
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.
2016-12-11 22:02:03 -08:00
Joe Wilm ed0b1cfff0 Display manages window, renderer, rasterizer
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.
2016-12-11 20:23:41 -08:00
Joe Wilm ed48d08c03 Implement Handler::identify_terminal for Term
The identify_terminal function signature had to change to support
writing to the terminal before processing additional input.
2016-12-11 20:23:41 -08:00
Joe Wilm 23e36f1925 Add support for indexed colors
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.
2016-12-11 20:23:41 -08:00
Joe Wilm ff5081d5e5 Add support for bracketed paste
Binding/Action execute now has access to TermMode to support bracketed
paste mode.
2016-12-11 20:23:41 -08:00
Joe Wilm 7bf3d059c3 Move term::cell module to its own file
The cell module was previously implemented within term.rs. Now each
module has its own file.
2016-12-11 20:23:41 -08:00