Menu

#1921 View is not maintained when toggling between different tabs with word wrap eanbled

Bug
closed-duplicate
nobody
2
2019-12-07
2017-03-11
mikhoul
No

Description of the Scintilla Bug/Issue

This appears a regression since Scintilla Ver. 3.7.3
"Word wrap" needs to be set.
The text of a long file gets scrolled when switching to a different tab and then back.
[This was originally erroneously associated to Notepad++ AutoSave plugin when the option to save all files was selected since the plugin needs to switch tabs to perform some operations.]

Steps to Reproduce the Issue

  1. Enable word wrap
  2. Open a first tab with enough text to exceed what can be displayed in a single view
  3. Scroll to the very bottom/end
  4. Switch momentarily to a different tab
  5. Switch back to the previous tab
  6. Observe that now the view show the content shifted so that the last lines are not visible

Expected Behavior

The content of the tab should not scroll when switching among the tabs

Actual Behavior

The content of the tab is scrolled when switching among the tabs.

Demonsration of the bug/regression

Screencast toi see the bug/regression happening: http://screencast-o-matic.com/watch/cbeXqg64Tg

N.B.: Tested under Windows 7/64 with binary from plain Scintilla editor with the February release here: http://www.scintilla.org/Sc373.exe

Regards.

Discussion

  • mikhoul

    mikhoul - 2017-03-11

    I forgot to mention that to see the contents "jump" in the editor you must be at the end of the file like in the screencast.

    If you need more information just ask.

    Regards !

     
  • Neil Hodgson

    Neil Hodgson - 2017-03-11
    • labels: --> scite, wrap
    • status: open --> open-duplicate
     
  • Neil Hodgson

    Neil Hodgson - 2017-03-11

    Duplicate of [#1395] and [#1387].

    This behaviour appears unchanged from SciTE 3.0. This is not a Scintilla issue, instead caused by when Scintilla APIs are called by applications.
    Wrapping occurs asynchronously and may take an arbitrary amount of time after the view is positioned.

     

    Related

    Bugs: #1387
    Bugs: #1395

  • mikhoul

    mikhoul - 2017-03-12

    You're right Neil, I understand why it happen it's because the word wrap is done AFTER the page is positionned/scrolled to the same place it was.

    I use NP++ as an editor.

    I have to work with many "WIDE" and long text file so I use "wordwrap" so it's a very annoying behavior since each time I swap to another tab I lost my position. Also I use the Autosave plugin in NP++ and it is configurated to save all my open docs when NP++ lose focus, so everytime I go to another application again I lose my position since the autosave has to go in each tab to save the content.

    Wordwrap is a pretty basic function so it should work without issue like that.

    What would be the best way @Neil to have it fixed since it seem to be a pretty old issue ?

    Thanks for your help and unseful work.

    Regards !

     
    • Neil Hodgson

      Neil Hodgson - 2017-03-12

      If word wrap took zero time then it could be made to work without issue but, since it does take appreciable time, any chosen technique will be a compromise with issues in some situations.

      You could ask how other people implement document switching for wrapped documents on the Scintilla mailing list https://groups.google.com/forum/#!forum/scintilla-interest.

       
  • mikhoul

    mikhoul - 2017-03-13

    Thanks Neil for the fast reply,

    I'm not a a C++ coder I use Javascript mainly I will ask to the devs of NP++ if they are willing to do something to have it fixed it at least in NP++

    I will let you know if they come with a fix that you could use or implement directly in scintilla.

    Regards !

     
  • Neil Hodgson

    Neil Hodgson - 2019-12-07
    • status: open-duplicate --> closed-duplicate
     

Log in to post a comment.

MongoDB Logo MongoDB