Commit Graph

434 Commits (paragraph-scroll)
 

Author SHA1 Message Date
Florian Dehau 54b841fab6 feat(widgets/paragraph): improve scrolling
Add optional callback to `Wrap` to compute the scroll offsets given the wrapped lines. This let
users compute the offsets dynamically.
4 years ago
Florian Dehau ecb482f297 fix(backend): move the cursor when first diff is on second cell
Both termion and crossterm backends were not moving the cursor if the first diff to draw was on the
second cell. The condition triggering the cursor move has been updated to fix this. In addition, two
tests have been added to avoid future regressions.
4 years ago
Florian Dehau 641f391137 feat(terminal): add unstable api to use a fixed viewport
There was now way to avoid the autoresize behavior of `Terminal`. While it was fine for most users,
it made the testing experience painful as it was impossible to avoid the calls to `Backend::size()`.
Indeed they trigger the following error: "Inappropriate ioctl for device" since we are not running
the tests in a real terminal (at least in the CI).

This commit introduces a new api to create a `Terminal` with a fixed viewport.
4 years ago
Florian Dehau dc26f7ba9f chore: document rustc min version supported
- Add section to README
- Run ci tests with this min version in addition of stable to track changes that would require a min
rustc version bump.
4 years ago
Florian Dehau 6504930888 Release v0.10.0 4 years ago
Florian Dehau 6b52c91257 chore: update CHANGELOG 4 years ago
Florian Dehau 0ffea495b1 refactor: implement cascading styles
- merge `Style` and `StyleDiff` together. `Style` now is used to activate or deactivate certain
style rules not to overidden all of them.
- update all impacted widgets, examples and tests.
4 years ago
Florian Dehau 72ba4ff2d4 refactor(examples): remove unecessary `terminal.hide_cursor` calls 4 years ago
Florian Dehau 88c4b191fb feat(text): add new text primitives 4 years ago
Brooks Rady 112d2a65f6
feat(widgets/paragraph): add option to preserve indentation when the text is wrapped (#327) 4 years ago
Xiaopeng Li d999c1b434
feat(widgets/paragraph): Add horizontal scroll (#329)
* `Paragraph:scroll` takes a tuple of offsets instead of a single vertical offset.
* `LineTruncator` takes this new horizontal offset into account to let the paragraph scroll horizontally.
4 years ago
Mikko Rantanen 3aa8b9a259 Implement `patch` between two `StyleDiff` 4 years ago
Florian Dehau fdbea9e2ee fix(widgets/canvas): avoid panic on zero-width bounds 4 years ago
Priime 6204eddade fix(readme): typo in demo section
There was a very small typo in the README on line 40, which cited the
`examples` folder as `exmples`. This resolves that issue.
4 years ago
Aram Drevekenin e789c671b0 Update README.md 4 years ago
Alexander Batischev 8c2ee0ed85
feat(terminal): Add after-draw() cursor control to Frame (#91) (#309) 4 years ago
Cokemonkey11 2b48409cfd
fix(examples): remove typo in demo text 4 years ago
Florian Dehau 7251186762 feat(style): add StyleDiff 4 years ago
Florian Dehau 82fda4ac0e doc(style): improve documentation of Style 4 years ago
Kenta Iwasaki 1d12ddbdfc layout: add vertical split constraint test on height 4 years ago
Kenta Iwasaki f474c76e19 layout: force constraint that width and height are non-negative 4 years ago
Florian Dehau ac99104114 feat(style): add support to serialize and deserialize Style using serde
* Add serde as an optional dependency.
* Add feature-gated derives to Color, Modifier and Style.
4 years ago
Paul Horn 0bb9b388f7 Borrow layout for splitting instead of moving it
This allows for layouts to be saved and reused and does not require an additional clone
4 years ago
Florian Dehau b59e4bb808 feat(examples): enable mouse capture to make crossterm demo on par with termion 4 years ago
Florian Dehau 4fe647df0a refactor(tests): rename integration tests to be able to call group of tests 4 years ago
Florian Dehau a00350ab54 refactor(tests): rename test files and use the new `TestBackend::assert_buffer` method 4 years ago
Florian Dehau 96c6b4efcb refactor(tests): move test utilities to TestBackend
* Remove custom Debug implementation of Buffer
* Add `TestBackend::assert_buffer` to compare buffers in integration tests. When
the assertion fails, the output now show the list of differences in addition
of the views of the computed and expected buffers. This effectively replaces
the table of debug code for colors and modifiers as it is easier to read.
4 years ago
Florian Dehau 18714caa60 Release v0.9.5 4 years ago
Stephan Dilly 7110fe0159 fix panic on narrow buffers (fixes #293) 4 years ago
Florian Dehau 5a590bca74 chore: enable clippy on all targets and all features
- Remove deny warnings in lib.rs. This allows easier iteration when developing
new features. The warnings will make the CI fails anyway on the clippy CI
stage.
- Run clippy on all targets (including tests and examples) and all features.
- Fail CI on clippy warnings.
4 years ago
Florian Dehau 963f11a6b1 Release v0.9.4 4 years ago
Florian Dehau a7761fe55d fix(buffer): ignore zero-width graphemes 4 years ago
Florian Dehau 10cf9305f1 Release v0.9.3 4 years ago
Clement Tsang b72ced4511
fix(widgets/chart): remove overflow when dataset if empty (#274)
* docs: Fix missing code block fence
* use slice::windows to deal with underflow issue
* add test for empty dataset and lines
4 years ago
Florian Dehau eb47c778db Release v0.9.2 4 years ago
Darrien Glasser 359b7feb8c
fix(widgets/canvas): Add bounds check when drawing line high/low (#283)
* Add bounds check when drawing line high/low
* Add test to ensure codepath doesn't break
4 years ago
chrunchyjesus 6ffdede95a
chore: add documentation field in Cargo.toml (#277) 4 years ago
24seconds 4db0250b95
Add rust-sadari-cli in `Apps using tui` section (#278) 4 years ago
SoptikHa2 69780bbbec Add desed to list of apps using tui?
Desed is new application that is using tui-rs. It's debugger for sed with all the things like stepping, setting breakpoints and examining runtime state.
4 years ago
Florian Dehau fda89d6859 Release v0.9.1 4 years ago
Florian Dehau 5d99b4af00 docs: improve widgets documentation 4 years ago
Florian Dehau da4d4e1672 test: assert items are correctly truncated in the `List` widget 4 years ago
Björn Steinbrink 8f9aa276e8 fix(widgets/list): fix line length calculation for selectable lists
The code that outputs the list elements uses the full inner width of its
block, without taking the width of the highlight symbol into
consideration. This allows the elements to overflow the box and draw
over the block's border. To fix that, we need to reduce the target width
for the list elements.
4 years ago
Florian Dehau 8debb0d338 Release v0.9.0 4 years ago
Florian Dehau bc2a512101 feat: add missing `Clone` and `Copy` on types 4 years ago
Florian Dehau 4f728d363f fix(widgets/list): stop highlighting blank placeholders 4 years ago
Florian Dehau e81af75427 fix(examples): improve input handling in crossterm demo
* avoid stacking events
* ensure tick events are sent at the given tick rate (and not everytime a key is pressed).
4 years ago
Florian Dehau 8387b32bb8 chore: update changelog 4 years ago
Florian Dehau 2fccee740b chore: add command to README to run demos without all unicode symbols 4 years ago
Florian Dehau c98002eb76 feat: add an option to run the examples without all unicode symbols 4 years ago