From ccc2c8119703103648dc4add81f6868ae64ab450 Mon Sep 17 00:00:00 2001 From: Oliver <480930+rivo@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:00:05 +0300 Subject: [PATCH] Clarifications in comments. --- application.go | 4 ++-- textarea.go | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application.go b/application.go index c8a56cf..53bb2f2 100644 --- a/application.go +++ b/application.go @@ -569,8 +569,8 @@ func (a *Application) Draw() *Application { // ForceDraw refreshes the screen immediately. Use this function with caution as // it may lead to race conditions with updates to primitives in other -// goroutines. It is always preferrable to use Draw() instead. Never call this -// function from a goroutine. +// goroutines. It is always preferrable to call [Application.Draw] instead. +// Never call this function from a goroutine. // // It is safe to call this function during queued updates and direct event // handling. diff --git a/textarea.go b/textarea.go index b4b8aae..41cd14e 100644 --- a/textarea.go +++ b/textarea.go @@ -885,7 +885,7 @@ func (t *TextArea) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldT // replace deletes a range of text and inserts the given text at that position. // If the resulting text would exceed the maximum length, the function does not // do anything. The function returns the end position of the deleted/inserted -// range. The provided row is the row of the deleted range start. +// range. // // The function can hang if "deleteStart" is located after "deleteEnd". // @@ -893,7 +893,8 @@ func (t *TextArea) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldT // either appended to the end of a span or a span is shortened at the beginning // or the end (and nothing else). // -// This function does not modify [TextArea.lineStarts]. +// This function only modifies [TextArea.lineStarts] to update span references +// but does not change it to reflect the new layout. func (t *TextArea) replace(deleteStart, deleteEnd [3]int, insert string, continuation bool) [3]int { // Maybe nothing needs to be done? if deleteStart == deleteEnd && insert == "" || t.maxLength > 0 && len(insert) > 0 && t.length+len(insert) >= t.maxLength {