/cropviewport

A component for bubbletea. Crops view from string given position and size with ANSI SGR support

Primary LanguageGoGNU General Public License v3.0GPL-3.0

Crop Viewport

A component for bubbletea.

Crops view from string given position and size.
With ANSI SGR support.

ansitext

For Usage checkout examples

Keymap

Keymaps are inside the model struct, can be changed if you want to.

Default keymaps:

  • j move down 1 line
  • k move up 1 line
  • ctrl+d move down half page
  • ctrl+u move up half page
  • h move left 1 column
  • l move right 1 column
  • H move left half row
  • L move right half row

wcwidth related

  • if not enough place for a char width over 1, the char will not display and replaced to (multiple) white space.
  • TAB(\t) will be replaced by 4 SPACE( ), and it's hard coded, not sure if processRune should be available to access from the outside

Others

So, this is actually the first time i use go to make stuffs for others to use.
Any suggestion is welcomed here