Commit Graph
62 Commits
Author SHA1 Message Date
Ayman Bagabas 075dd25792 refactor!: use term/input
feat: update bubbletea & term/input

refactor!: use term/input for input handling

Reference: https://github.com/charmbracelet/x/tree/main/exp/term
2024-04-22 16:24:27 -04:00
Moritz BieringandChristian Rocha 961c081347 Fix division by zero in viewport scrollpercentage calculation 2024-03-11 09:32:23 -04:00
Ivan ValdesandMaas Lalani 1ba1200c31 fix(viewport): pad width to contentWidth 2024-01-08 11:43:20 -05:00
Ayman Bagabas 330dd3fa5d feat: upgrade bubbletea and remove deprecated code
Supersedes: https://github.com/charmbracelet/bubbles/pull/447
2023-12-13 10:37:00 -08:00
Glenn GondaandChristian Rocha 3d3ed883d3 docs: fix typos and improve comment clarity 2023-02-16 17:49:32 -05:00
Christian RochaandGitHub 4a71cee5a1 fix(viewport): performance scrolling (#312)
* fix(viewport): performance scroll behavior for line up/down

* fix(viewport): performance scrolling in multi-line operations
2023-01-20 10:51:00 -05:00
Adam BullandGitHub fac7a01329 feat(viewport): line count getters (#283) 2022-11-07 10:05:03 -05:00
Christian Muehlhaeuser 4ae575a4c5 chore: use latest gofmt 2022-09-26 08:13:03 +02:00
Raphael 'kena' PossandGitHub 278edd1c2b fix(viewport): properly truncate to size (#228)
There are many "interesting" cases:

- logical content is wider than display width (long lines).
  In this case, we truncate.
- logical content is smaller than display height (fewer lines
  than visible).
  In this case, we pad with empty lines up to the specified height.
- logical content is higher than display height (more lines than
  visible).
  In this case, we truncate.

- style specifies a width wider than the display width.
  In this case, we ignore the style width and
  fit in the display width.
- style specifies a height higher than the display height.
  Same as width, we ignore the style and fit in the display height.
- style specifies a narrower width or smaller height than the display.
  In this case we obey the style.
2022-09-02 12:50:33 -07:00
Christian Rocha d44e242f37 fix(viewport): honor width and height settings 2022-08-29 21:05:16 -07:00
Maas LalaniandGitHub e32dcde62a fix(viewport): Guard against negative string repetitions (#196) 2022-07-21 14:39:17 -04:00
Christian RochaandAyman Bagabas 2a8d463bd1 chore: shorten half page up/down help widths 2022-04-29 12:20:18 -04:00
Ayman Bagabas c214837839 fix: add viewport keymap help 2022-04-29 12:20:18 -04:00
Christian Rocha 7ecce3fb97 Ignore width/height settings in viewport's style settings
The Lip Gloss width and height settings compete with the main
width/height settings and can result in funny rendering and generally
cause confusion.
2022-01-20 13:23:58 -05:00
Christian Rocha daba232df4 Fix a bug where viewport y-offset could be negative 2022-01-19 12:32:05 -05:00
Christian Rocha 7a6d306889 Fix off-by-one error in viewport's GotoBottom()
This was most likely introduced by the fix for rendering final lines in
0ac5ecdf81.
2022-01-19 12:32:05 -05:00
Christian Rocha 9401ebbb83 Viewport New() is now optional to ease the upgrade process 2022-01-10 21:21:04 -05:00
Christian Rocha add13c8028 Add a lipgloss style to the viewport for borders, margins, and padding 2022-01-10 21:21:04 -05:00
Christian Rocha 4aed4e0a88 Viewport now has customizable keybindings 2022-01-10 21:21:04 -05:00
Christian Rocha 0ac5ecdf81 Fix bug where performance rendering could render one line too many 2021-09-17 16:25:25 -04:00
Christian Rocha 8c03905dbe Fix bug where viewport wouldn't render final lines
This previously went unnoticed because we all seemed to have newlines at
the end of our viewport input.

This update introduces the Model.SetYOffset method.
2021-09-17 16:25:25 -04:00
Christian Rocha 158097df66 Keep y-offset in bounds when setting content 2021-04-19 19:47:50 -04:00
Christian Muehlhaeuser a0d7cb77a1 Fix godocs for various types and functions 2021-03-12 02:06:30 +01:00
Christian Muehlhaeuser 490a599c05 Use a const for the mouse wheel delta in viewport 2021-03-12 01:33:51 +01:00
Christian RochaandChristian Rocha 84f7b047bb Make Viewport more idomatic BubbleTea (per v0.12.x) 2020-11-08 21:20:15 -05:00
Christian RochaandChristian Rocha 5dbcf95877 Fix situation where short viewports would panic (closes #20) 2020-10-25 15:21:49 -04:00
Will BradleyandChristian Rocha b08b3efa02 add a couple alternate key bindings to make the scrolling slightly more intuitive 2020-10-21 22:54:58 -04:00
Christian Rocha 82097a1c79 Remove unused function 2020-10-16 11:54:44 -04:00
Christian Rocha cbafae84f9 Update mouse wheel stuff in paginator per last-minute Bubble Tea API change 2020-10-06 12:29:18 -04:00
Christian Muehlhaeuser 9a4fbb3be1 Make golint happy 2020-08-22 12:41:09 +02:00
Christian Rocha dbd40713ce Remove extraneous methods 2020-07-29 20:04:09 -04:00
Christian Rocha 5357dd61bd Fix bug where scroll wheel could create duplicate lines on top and bottom 2020-07-20 17:46:15 -04:00
Christian Rocha 88469a499e Tidy up the key case switch in viewport 2020-07-20 11:56:35 -04:00
Christian Rocha b130d96434 Add methods for jumping to the tom and bottom of the viewport 2020-07-17 19:22:08 -04:00
Christian Rocha 185a19e56f Fix cases where pager would add blank lines to bottom of document 2020-07-17 18:38:38 -04:00
Christian Rocha dbb1d93970 Remove redundant viewport commands 2020-07-17 18:22:51 -04:00
Christian Rocha 2f909886c1 Be more consistent with max() argument order 2020-07-17 18:13:48 -04:00
Christian Rocha 5720cfb35a Correct scroll percentage reporting 2020-07-17 18:13:05 -04:00
Christian Rocha 3c07b97d37 Correct typo, add potential TODO 2020-07-17 17:02:37 -04:00
Christian Rocha f341e3c896 Correct mouse wheel behavior 2020-06-23 13:10:50 -04:00
Christian Rocha c9196e5407 Add basic mouse wheel support to viewport 2020-06-23 12:00:17 -04:00
Christian Rocha 7cef3a6f59 Document comments 2020-06-20 13:59:13 -04:00
Christian Rocha 1cdc2045c7 Fix a potential out of bounds panic 2020-06-19 19:46:51 -04:00
Christian Rocha cc480dd2f3 Comments 2020-06-19 19:02:14 -04:00
Christian Rocha 0c1781fbb3 Clamp scroll percentage 2020-06-19 15:04:23 -04:00
Christian Rocha 5255143e87 Rework high performance half-view up/down 2020-06-19 13:23:14 -04:00
Christian Rocha 1629afe087 Rework high-performance pgup/pgdown 2020-06-19 12:20:35 -04:00
Christian Rocha da3150ded7 Rework high performance line-up/line-down 2020-06-19 11:51:44 -04:00
Christian Rocha b82cf5071d Send newlines instead of cursor-downs in performance viewport 2020-06-18 18:31:30 -04:00
Christian Rocha d095a6554c Retire the internal viewport renderer 2020-06-18 18:25:57 -04:00