fix(list): include inbetween empty lines when selecting text

Ayman Bagabas created

Change summary

internal/tui/exp/list/list.go | 5 +++++
1 file changed, 5 insertions(+)

Detailed changes

internal/tui/exp/list/list.go 🔗

@@ -389,6 +389,11 @@ func (l *list[T]) selectionView(view string, textOnly bool) string {
 
 		textBounds := lineTextBounds[y]
 		if textBounds.start < 0 {
+			if textOnly {
+				// We don't want to get rid of all empty lines in text-only mode
+				selectedText.WriteByte('\n')
+			}
+
 			continue // No text on this line
 		}