From b0ab5ae06e45d827eb6f1759626f6e1d718f6ff0 Mon Sep 17 00:00:00 2001 From: Chris Waldon Date: Wed, 16 Mar 2022 16:01:39 -0400 Subject: [PATCH] widget: remove unneeded editor flicker logic We cannot find a way to trigger this flickering condition anymore, and so we're removing the logic guarding against it. Signed-off-by: Chris Waldon --- widget/editor.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/widget/editor.go b/widget/editor.go index 754bf19a..a1fd3648 100644 --- a/widget/editor.go +++ b/widget/editor.go @@ -889,17 +889,6 @@ func (e *Editor) layoutText(s text.Shaper) ([]text.Line, layout.Dimensions) { lines, _ = nullLayout(r) } dims := linesDimens(lines) - for i := 0; i < len(lines)-1; i++ { - // To avoid layout flickering while editing, assume a soft newline takes - // up all available space. - if layout := lines[i].Layout; len(layout.Text) > 0 { - r := layout.Text[len(layout.Text)-1] - if r != '\n' { - dims.Size.X = e.maxWidth - break - } - } - } return lines, dims }