Closed Kvaz1r closed 6 years ago
This behaviour(data race) related not only for backspace action but also can be reproducing with paste operation.
Yep, this is a problem where editor.Text()
is being called in a non-UI goroutine while editor.SetText()
is being called in the UI goroutine. I've got some ideas in my head about how to solve this, but I would like to do some benchmarks. Anything relating to user input should stay as fast as possible, so I don't want to implement a solution without exploring a little.
I've added a preliminary fix in #128 and nelsam/gxui#8. I have to try to run the editor with -race
turned on for a while before I'll be confident with the fix, but it seems to work.
nelsam/gxui#8 and #128 were merged. It seemed like it was working fine. I made some attempts to trigger the data race again and couldn't, so I think it's working at least a bit cleaner.
I was having a hard time triggering it on my computer even before the fixes, though, so let me know if you still see problems.
Yes, after the patch it works as should only deprecation warning trigger for copy paste here.
Fixed the deprecation warnings. I'm going to be removing those pretty soon. I just wanted a short transition period to make sure there wasn't too much overlap where vidar couldn't be built.
Description
Incorrect removing when "massive" backspacing.
Steps to reproduce
Expected behavior
Removing only previous symbols.
Actual behavior
Symbols deleting in both direction
Stack trace
Guess the reason is in the data race, log from build with
-race
flag: