Commit Graph
23 Commits
Author SHA1 Message Date
remiposoandGitHub 9266653c39 Reset blink only when CursorBlink (#378) 2023-05-13 12:56:18 -04:00
Raphael 'kena' PossandMaas Lalani afb975b469 feat(textarea): make max width/height configurable 2023-05-01 13:06:34 -04:00
Glenn GondaandChristian Rocha 3d3ed883d3 docs: fix typos and improve comment clarity 2023-02-16 17:49:32 -05:00
Raphael 'kena' PossandMaas 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' PossandMaas 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' PossandMaas 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
hhe07andGitHub b2b7040ccf fix(textarea): paste (#250) 2022-10-06 15:54:43 -04:00
Maas Lalani d3aed22a41 Revert "chore: move cursor bubble to internal"
This reverts commit a4ed54327f.
2022-10-06 15:33:16 -04:00
Maas Lalani a4ed54327f chore: move cursor bubble to internal 2022-09-14 15:45:51 -04:00
Raphael 'kena' PossandMaas Lalani 09e1f00349 textarea: support dynamic prompts
The dynamic prompt can be different on every line.
See for example:
[![asciicast](https://asciinema.org/a/iFBPBwoDZOzcoRJOgfmPk8ObH.svg)](https://asciinema.org/a/iFBPBwoDZOzcoRJOgfmPk8ObH)
2022-09-02 14:31:26 -04:00
Raphael 'kena' PossandMaas Lalani c099d31570 textarea: add some comments 2022-09-02 14:31:26 -04:00
Raphael 'kena' PossandMaas Lalani db2a8b4e16 textarea: new bindings for "go to begin" / "go to end" 2022-09-02 13:44:52 -04:00
kenaandGitHub 1c26128786 textarea: add uppercase/lowercase/capitalize word right (#210)
* Extract char navigation in separate function.

* Make wordLeft/wordRight find words on the prev/next line

... if there's no word on the current line to find any more.

* Support uppercase/lowercase/capitalize commands.

* Add transpose
2022-08-19 11:17:36 -04:00
kenaandGitHub 649f78e1fd fix(textarea): pre-allocation of value (#213)
The maximum slice size of m.value is the max number of rows,
which is the max height.
2022-08-15 10:25:20 -04:00
kenaandGitHub e72e4a190b perf(textarea): amortize heap allocs in Value (#212) 2022-08-15 10:24:54 -04:00
Maas Lalani e200bf8c81 feat: LineCount method for counting number of lines in textarea 2022-08-05 16:37:05 -04:00
Maas Lalani 47eee84147 fix: include new line characters for Length() 2022-08-05 16:37:05 -04:00
Maas Lalani 84eacf535a fix: CharLimit <= 0 should be ignored 2022-08-04 14:52:50 -04:00
Maas LalaniandGitHub 746ec595c3 fix(textarea): change placeholder color to match textinput (#192) 2022-07-07 22:34:48 -04:00
Maas Lalani 3a34fc4ff8 fix(textarea): Add deleteWordRight 2022-07-05 14:26:22 -04:00
Maas Lalani 2a2fb10f5f fix(textarea): account for base styling frame when calculating width 2022-07-05 14:26:22 -04:00
Maas Lalani 2fd583c8ef feat(textarea): Add multi-line text input 2022-06-28 12:29:24 -04:00