Ayman Bagabas and Christian Rocha
afbb7bc049
feat(textarea): add SetOffset and CursorPosition methods
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
4c214e0848
feat: formatter
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
56f7197cd3
fix: move to last line on accept
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
4755f88132
fix: comp
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
ca9cbbc99e
wip
...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com >
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
8789a984d8
wip
...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com >
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
2ec013be27
wip
...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com >
2024-11-26 14:17:28 -05:00
Carlos Alexandro Becker and Christian Rocha
7073d1abc8
wip: area
...
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com >
2024-11-26 14:17:28 -05:00
Ayman Bagabas
bd415b4eba
chore: update dependencies and fix colors
2024-11-21 12:20:47 -05:00
Christian Rocha
0a6b6e6fd7
chore(merge): branch 'master' into v2-exp
2024-11-15 08:38:55 -05:00
Christian Rocha
398e92c5ae
fix: remove default character limit
2024-11-15 08:30:03 -05:00
Christian Rocha
f439d83043
fix(textarea): max height should not determine max lines
...
Fixes #671 .
2024-11-15 08:30:03 -05:00
Christian Rocha
fc0fa7807e
feat(textarea): add helpers for default light and dark styles
2024-11-05 21:38:29 -05:00
Christian Rocha
52bd03ed5b
feat!(viewport): use getters and setters for width and height
2024-10-31 15:02:05 -04:00
Christian Rocha
3b879e7694
feat!(viewport): width and height are now optional args in New()
2024-10-31 15:02:05 -04:00
Christian Rocha
4ce3faadcf
feat!(textarea): DefaultKeyMap is now a func instead of a global
2024-10-31 15:02:05 -04:00
Ayman Bagabas
db64e3cd78
feat: update lipgloss to v2
2024-10-29 15:54:24 -04:00
Christian Rocha
12271df027
chore(textarea): nest focused and blurred styles in a parent struct
2024-10-24 17:29:41 -04:00
Christian Rocha
1efec1505f
chore(textarea): minimal updates for Lip Gloss v2
2024-10-24 16:44:30 -04:00
Christian Rocha
57ac102802
chore(merge): branch 'master' into v2-mini-tidy
2024-10-24 15:22:16 -04:00
Christian Rocha
4e05c24fc4
chore: move runeutil and memoization into internal
2024-10-24 15:21:20 -04:00
Christian Rocha
358a6c58c8
chore(lint): fix and suppress all soft lint issues; update directives
2024-10-24 12:35:42 -04:00
Ayman Bagabas
f4fca1b3a0
fix(textarea): add support for bracketed-paste msg
2024-10-10 17:50:59 -04:00
Ayman Bagabas
a2602f8509
feat!: v2: move to v2 module
2024-09-18 14:12:55 -04:00
Ayman Bagabas
0fdf5f5be5
feat: use bubbletea/v2
2024-09-18 14:09:58 -04:00
Ayman Bagabas
a93bfef532
feat!: use bubbletea@v2-exp
2024-09-09 14:12:52 -04:00
Ayman Bagabas
549d0767b3
chore: fix lint
2024-08-19 16:27:18 -04:00
Christian Rocha
a9344b5953
chore(textarea): lift an if condition into a parent loop
2024-07-17 09:26:38 -04:00
Christian Rocha
c30c185b93
feat(textarea): end of buffer lines span the full block
...
This is for styling purposes, particularly when you want to apply
a background to the entire textarea.
2024-07-17 09:26:38 -04:00
Christian Rocha
95d338b099
feat(textarea): dynamically determine line number integer padding
2024-07-17 09:26:38 -04:00
Christian Rocha
1a3627eb98
feat(textarea): inherit styles from base (and elsewhere)
...
This reduces the amount of styling needed for what's likely more common
use cases, such as using Styles.Base to apply a background color to the
entire field.
2024-07-17 09:26:38 -04:00
Ayman Bagabas and GitHub
11a9fccd58
chore: fix lint issues ( #534 )
2024-05-31 16:48:29 -04:00
Michael Lorant and GitHub
296fcf77fa
feat(textarea) Add multiline placeholder ( #302 )
...
Add the capability to show a multiline placeholder. Some refactoring was
required to improve readability and improve logic.
End of line buffer character was only shown when line numbers were
displayed which requires some verification whether this is the intended
outcome. This change resolves this issue.
2024-05-30 20:28:20 -04:00
Garrett Martin and GitHub
620ca7dfa9
fix: default textarea EndOfBufferCharacter should be ' ' ( #510 )
2024-05-23 17:37:59 -04:00
Ayman Bagabas
14a62710fc
fix(textarea): use x/ansi to strip ansi sequences
2024-05-23 15:01:44 -04:00
Michael Lorant and Maas Lalani
48dffdd97e
refactor(textarea): Improve setting width
...
When setting the width of the textarea there were some issues
preventing this from working correctly. These problems included:
- If the maximum width needed to be used, the width of the textarea did
not take into account the prompt and line number width.
- The viewport width did not take into account the style width.
The entire function was confusing to understand and a refactor was
warranted.
As part of this refactor, the bugs mentioned above were fixed and the
code was simplified.
To verify that the logic works as expected, unit tests were expanded to
validate that setting the width works as expected.
Signed-off-by: Michael Lorant <michael.lorant@nine.com.au >
2024-04-06 01:37:46 -04:00
Michael Lorant and GitHub
b9e62cbfe1
Improve textarea tests ( #490 )
2024-03-08 19:23:05 -05:00
Michael Lorant and GitHub
6c9e52a8fd
Fix end of buffer character ( #491 )
2024-02-29 10:29:45 -05:00
Travis Harrison and GitHub
9fb83699e9
feat(textarea): add help to textarea key bindings ( #418 )
2024-02-28 11:38:47 -05:00
Maas Lalani
c94f0cc151
fix(textarea): end of buffer alignment
2024-02-28 10:57:49 -05:00
Michael Lorant and Maas Lalani
e985ec9f15
Add tests for textarea view
...
Add improved unit tests for textarea view function.
The end of buffer unit test was flawed and failed to properly check
whether the end of buffer character was in the correct location. This
test has been removed as this feature is now verified as part of these
test cases.
Signed-off-by: Michael Lorant <michael.lorant@nine.com.au >
2024-02-28 10:49:34 -05:00
Christian Muehlhaeuser and Maas Lalani
d98bf9db0a
fix(textarea): correctly trim incoming paste
2024-01-28 12:11:46 -05:00
6fe92f94b5
perf(textarea): implement wrapping memoization
...
* Improve textarea performance by caching the wrap results
* Add memoization utility
* Fix failing github jobs due to requirement for 1.18
* Address linting issues
* Fix redundant docstrings
* fix: minor changes to memoization
* fix: soft-wrapped hidden line numbers
* perf: switch to `uniseg.StringWidth`
---------
Co-authored-by: Maas Lalani <maas@lalani.dev >
2024-01-22 13:30:34 -05:00
remiposo and GitHub
9266653c39
Reset blink only when CursorBlink ( #378 )
2023-05-13 12:56:18 -04:00
Raphael 'kena' Poss and Maas Lalani
afb975b469
feat(textarea): make max width/height configurable
2023-05-01 13:06:34 -04:00
Glenn Gonda and Christian Rocha
3d3ed883d3
docs: fix typos and improve comment clarity
2023-02-16 17:49:32 -05:00
Raphael 'kena' Poss and Maas Lalani
ee382285e7
fix(textarea): fix data corruption after multi-line input
...
Previously, when inserting multiple lines of input at once, the underlying
Go data array was incorrectly shared in memory across multiple rows
of the textarea. This was causing input corruption, where a user trying
to modify one line would see their text added on the next line as well.
This patch fixes it.
2023-02-05 10:19:05 -08:00
Raphael 'kena' Poss and Maas Lalani
db06ae17d3
fix(textarea): support pastes that end with a newline character
...
My previous fix did not properly handle a multi-rune input that *ends*
with a newline character. In that case, the final newline was removed.
I found this using the test suite I built for textarea in bubbline at
https://github.com/knz/bubbline/tree/main/editline/internal/textarea/testdata .
2023-01-24 14:19:14 -05:00
a6a12c4a31
fix(textarea): app would crash if deleteWordRight was called at the end of line ( #313 )
...
* fix(textarea): app would crash if deleteWordRight was called at the end
of line
* fix(textarea): deleteWordRight would work incorrectly
Co-authored-by: infastin <thecookied123@gmail.com >
2023-01-23 13:10:21 -05:00
Raphael 'kena' Poss and Maas Lalani
53724e6a72
feat: bracketed paste in textarea + textinput
...
This also fixes a longstanding bug where newlines, tabs
or other control characters in the clipboard would cause
the input to be corrupted on paste.
2023-01-09 16:30:24 -05:00