bugGNU Octave - Bugs: bug #51396, Saving file should not un-fold...


bug #51396: Saving file should not un-fold folded code.

Submitted by:  Marshall <marsian>
Submitted on:  Wed 05 Jul 2017 10:02:33 PM UTC  
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Marsian Open/Closed:  Closed
Release:  4.2.1 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Thu 20 Jul 2017 04:57:17 AM UTC, comment #14: 

I have pushed the patch with changeset

Torsten Lilge <ttl>
Project Member
Mon 17 Jul 2017 05:52:57 PM UTC, comment #13: 

Works for me too.

Mike Miller <mtmiller>
Project Administrator
Fri 14 Jul 2017 08:10:48 PM UTC, comment #12: 

Patch works for me
applied to hg-id "528b124e337f+"
Qt 5.7.1
qscintilla-qt5 2.10


Dmitri A. Sergatskov <dasergatskov>
Fri 14 Jul 2017 07:40:26 PM UTC, comment #11: 

Please find attached a patch that prevents the editor from making lexer updates when saving the file or when "saving as" with the same extension. I have tested it only under Linux and with a qscintilla-version which is not showing the issues described in this report.

(file #41205)

Torsten Lilge <ttl>
Project Member
Sat 08 Jul 2017 10:22:14 AM UTC, comment #10: 

I will have a look at the file_editor_tab::update_lexer call, which was mentioned by Mike in comment #8 and prepare a patch.

Torsten Lilge <ttl>
Project Member
Fri 07 Jul 2017 10:00:11 PM UTC, comment #9: 

I have updated to qscintilla-2.10.1 and i do not see the problem any more.


Dmitri A. Sergatskov <dasergatskov>
Fri 07 Jul 2017 07:00:15 PM UTC, comment #8: 

I think this may be due to file_editor_tab::update_lexer, which is called even when an existing file with a valid lexer is saved under the same name.

If I comment out the call to set_file_name in file_editor_tab::save_file, the file is saved, the lexer is not changed, and the folds remain as they were.

Since we see different behavior with different scintilla versions, this may be an intentional change in the scintilla project, but I haven't found any documentation about it if so.

Mike Miller <mtmiller>
Project Administrator
Fri 07 Jul 2017 04:31:48 PM UTC, comment #7: 

I can reproduce on Debian with Qscintilla 2.9.3, with either Qt 4 or Qt 5.

Qscintilla 2.9.3 is the version also used in mxe-octave.

Mike Miller <mtmiller>
Project Administrator
Thu 06 Jul 2017 05:56:41 PM UTC, comment #6: 

I do not see the problem on Fedora 26 with Qt4 (4.6.3).
(the same computer and source tree where I see problem with Qt5).


Dmitri A. Sergatskov <dasergatskov>
Thu 06 Jul 2017 05:27:40 PM UTC, comment #5: 

I see the problem on Fedora 26 (Qt5 / qscintilla 2.10) and
do NOT see the problem on RHEL 7.4 (Qt4 / qscintilla 2.8)

hg id "3e93a2a66cdf"


Dmitri A. Sergatskov <dasergatskov>
Thu 06 Jul 2017 03:17:31 PM UTC, comment #4: 

That would be, 'I see it happening on my win 10 ...'.

John Donoghue <lostbard>
Project Member
Thu 06 Jul 2017 03:13:39 PM UTC, comment #3: 

I see if happening on my win 10 dev 4.3.0+ and 4.2.1 versions of octave.

Also on my 4.3.0+ (of a couple weeks ago) fedora octave.

John Donoghue <lostbard>
Project Member
Thu 06 Jul 2017 02:34:24 PM UTC, comment #2: 

Yes, it happens with any file, simple or complex. If I make a new file with only

if true

Then fold the if statement and press ctl-s, then it unfolds the if. I've tested this on two different Win10 computers.

Marshall <marsian>
Thu 06 Jul 2017 05:14:18 AM UTC, comment #1: 

Thank you for the report.

This behavior is not reproducible on my Ubuntu system with the default branch. Does this happen every time or only with specific files?

Torsten Lilge <ttl>
Project Member
Wed 05 Jul 2017 10:02:33 PM UTC, original submission:  

I have found that saving a file in the GUI editor will un-fold any folded code. This invalidates the reason for folding any code and the view can jump quite a bit when this happens. This shouldn't happen.

Marshall <marsian>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #41205:  bug51396_v1.patch added by ttl (5KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by marsian (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-07-20 ttl StatusPatch Reviewed => Fixed
        Open/ClosedOpen => Closed
    2017-07-17 mtmiller StatusNone => Patch Reviewed
    2017-07-14 ttl Attached File- => Added bug51396_v1.patch, #41205

    Back to the top

    Powered by Savane 3.5