1
0
mirror of https://github.com/rivo/tview.git synced 2025-04-24 13:48:56 +08:00

Added tabs. Also added TextArea to main documentation.

This commit is contained in:
Oliver 2022-08-13 17:03:57 +02:00
parent ad62b2aa7c
commit 980ae61d2a

View File

@ -1420,6 +1420,14 @@ func (t *TextArea) InputHandler() func(event *tcell.EventKey, setFocus func(p Pr
t.cursor.row = -1
t.truncateLines(row - 1)
t.clampToCursor(row)
t.selectionStart = t.cursor
case tcell.KeyTab: // Insert TabSize spaces.
from, to, row := t.getSelection()
t.cursor.pos = t.replace(from, to, strings.Repeat(" ", TabSize))
t.cursor.row = -1
t.truncateLines(row - 1)
t.clampToCursor(row)
t.selectionStart = t.cursor
case tcell.KeyRune:
if event.Modifiers()&tcell.ModAlt > 0 {
// We accept some Alt- key combinations.