I experimented to comment out WrapLine(wsAll) in Editor::MovedCaret and even WrapLine(wsIdle) in Editor::Idle, with expecting WrapLine(wsVisible) in Editor::Paint do the wraping properly on the fly. My test program with huge file with the wrapping activated looks work without any trouble, except for the difference between the actual visible area and the presumed scrolled positon. If SCI_SETSEL moves the caret far from the current visible area it may fail to make the new visible area include the caret...
Thank you for the clear explanation. Though I prefer programmatic caret moving and arrow key had the same effect, I would live with the current policy. I might patch a little by myself for my specific requirement...
I think Editor::Paint is called whenever the control is redrawn, and it calls WrapLine(wsVisible) by itself to show correctly wraped lines if the shown area has not been wrapped yet. So calling WrapLine(wsAll) is not required beforehand unless you need exact location to show. For example, SCI_SETSEL moves the caret somewhere and try to show the location, but does not call WrapLine(wsAll) beforehand. Consequently the caret may not be inside the newly shown area, if it is beyond the already wrapped...
Moving caret in a huge file prevents operation afterward
Can't mark a script as TRUSTED with 20.03