Highlight the beginning selected, empty lines. (#1149)

pull/1151/head
Benjamin Quinn 2 years ago committed by GitHub
parent b389792002
commit 4e11298d4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      lib/src/widgets/text_line.dart

@ -1107,6 +1107,19 @@ class RenderEditableTextLine extends RenderEditableBox {
_selectedRects ??= _body!.getBoxesForSelection(
local,
);
// Paint a small rect at the start of empty lines that
// are contained by the selection.
if (line.isEmpty &&
textSelection.baseOffset <= line.offset &&
textSelection.extentOffset > line.offset
) {
final lineHeight =
preferredLineHeight(TextPosition(offset: line.offset));
_selectedRects?.add(
TextBox.fromLTRBD(0, 0, 3, lineHeight, textDirection));
}
_paintSelection(context, effectiveOffset);
}
}

Loading…
Cancel
Save