When changing encodings . . .



  • When I change the encoding of the file I’m working on–usually from UTF-8 to ANSI and back again–the view will jump to a portion of the file near the end (not all the way). The cursor won’t move, so it’s easy to get back where I was, but the jump is odd and inconvenient. Is this a known issue and can it be changed?



  • @Brigham-Narins

    i can’t reproduce an automatic scroll to near the end of that file, when changing encoding from utf-8 to ansi and back.

    please test the following, to verify, if a clean notepad++ (without any plugins that could cause this) would work on your system.

    • download the notepad++ 7.7 portable version from >>> here <<<.
      (the portable version does not require any installation and runs completely independent and isolated from your installed version. all custom settings, as well as any stuff you might want to try at the portable version, will not modify your installed version)

    • extract npp.7.7.bin.zip to your desktop.

    • important note: make sure to close all instances of notepad++ that might be running, before starting the portable version at the next step, to make sure you are using this portable version.

    • open the extracted npp.7.7.bin folder and start this portable version by double-clicking on notepad++.exe inside this folder.
      (note: notepad++.exe will just be seen as notepad++, if you have enabled to hide all known file extensions at your explorer settings)

    • open up any larger file and put the cursor anywhere, then change the file format and back again.
      the view should stay where it is.

    best regards.



  • Thanks for the suggestion, @Meta-Chuh. I did as you instructed, and I get the exact same behavior. However, I discovered that switching encodings causes the jumping I described only when word wrap is on. What do you think about that?



  • @Brigham-Narins said:

    only when word wrap is on. What do you think about that?

    We’d say, oh, you use word-wrap and that’s the ONLY oddity you’ve noticed with it? :)



  • @Brigham-Narins

    yes, you are absolutely correct.

    i retested this with files with longer lines, and can reproduce this now, if word wrap is enabled, but not always.
    and it seems to depend on where the cursor is placed within the document, as well as the position where it scrolls to, seems to depend on the current size of the editor window.

    i’ve also tested the same on the scintilla demo editor scite 4.1.5 and it behaves the same, when using word wrap, a similar viewing size and the same document.

    i didn’t have time though, to look if anyone has already posted this behaviour at the scintilla feature request or issue tracker, and i don’t know if this is something that would be worked on if filed.

    many thanks and best regards.



  • @Alan-Kilborn said:

    @Brigham-Narins said:

    only when word wrap is on. What do you think about that?

    We’d say, oh, you use word-wrap and that’s the ONLY oddity you’ve noticed with it? :)

    I’d say yeah, this is the only problem word wrap causes me. I didn’t realize it was a fraught feature. I have to wrap the lines, though, I’m dealing with a lot of text: encyclopedia entries in XML structure.



  • @Meta-Chuh said:

    @Brigham-Narins

    yes, you are absolutely correct.

    i retested this with files with longer lines, and can reproduce this now, if word wrap is enabled, but not always.
    and it seems to depend on where the cursor is placed within the document, as well as the position where it scrolls to, seems to depend on the current size of the editor window.

    Exactly

    i’ve also tested the same on the scintilla demo editor scite 4.1.5 and it behaves the same, when using word wrap, a similar viewing size and the same document.

    Interesting

    i didn’t have time though, to look if anyone has already posted this behaviour at the scintilla feature request or issue tracker, and i don’t know if this is something that would be worked on if filed.

    many thanks and best regards.

    Well, thanks for your help. I really appreciate it.


Log in to reply