Skip to content

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

License

Notifications You must be signed in to change notification settings

ogios/cropviewport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages