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 <christopher.waldon.dev@gmail.com>
This commit is contained in:
Chris Waldon
2022-03-16 16:01:39 -04:00
committed by Elias Naur
parent 1ad785658e
commit b0ab5ae06e
-11
View File
@@ -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
}