Bug 335590 - There is no way to reverse the effect of "Fold Toplevel Nodes"
Summary: There is no way to reverse the effect of "Fold Toplevel Nodes"
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: folding (show other bugs)
Version: 16.04.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-30 13:29 UTC by Cristian Tibirna
Modified: 2016-09-07 14:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Kate's View -> Coding folding menu correct vs missing (26.01 KB, image/png)
2015-02-16 06:35 UTC, Russell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cristian Tibirna 2014-05-30 13:29:53 UTC
In Kate->View->Code Folding, there is "Fold Toplevel Nodes", the only folding command with a default shortcut. This shortcut is chosen to be Ctrl+Shift+-, which is very easy to hit by mistake, while e.g. tuning the font size with Ctrl+- and Ctrl++ shortcuts.

Unfortunately, there is no way to undo/reverse the effect of folding all toplevel nodes, apart from going and unfolding manually each and every toplevel node. In a typical Python code file, for example, this could mean tens of tedious mouse positionings and clicks.

The documentation (for which btw. kate 3.13 is still that of that of kate 3.11) states "Click on the right pointing triangle to expand all toplevel regions" which is at least confusiong (*which* right pointing triangle?) if not sarcastic.

Fortunately, quitting kate, restarting it and reopening the same document brings back the unfolded file, "thanks" to bug 316184.

Reproducible: Always

Steps to Reproduce:
1. Open a document with many toplevel nodes (e.g. a Python module file)
2. Hit "Ctrl+Shift+-" (default shortcut) or click View->Code Folding->Fold Toplevel Nodes
3. Try to unfold everything.
Actual Results:  
There is no way to unfold all toplevel nodes with one single command. One has to go and unfold each node, one at a time.

Expected Results:  
There should exist a "Unfold Toplevel Nodes" action.
Comment 1 Russell 2015-02-06 01:04:45 UTC
The Kate Menu, View -> "Code Folding" use to show 4 submenu items (and corresponding shortcuts):
  Collapse Toplevel
  Expand Toplevel
  Collapse One Local Level
  Expand One Local Level

As of Kate Version 3.14.2 using KDE Development Platform 4.14.2, it only shows 3 submenu items:
  Fold Current Node
  Unfold Current Node
  Fold Toplevel Nodes

There is no way to Unfold Toplevel Nodes.   

Fold/Unfold Toplevel Nodes is a very useful feature when it is working.  To fold without 
an unfold  is a large problems that affects all of Kate syntax highlighing/code folding.

Environment: linut minut 17.1 Rebecca
Comment 2 Russell 2015-02-16 06:35:08 UTC
Created attachment 91104 [details]
Kate's View -> Coding folding menu correct vs missing

I can confirm this bug in Kate.

Please see the attached image. It shows what the Kate -> View -> Code Folding menu use to
look like and what it look like now.

Briefly:
Collapse Toplevel Ctrl+Shift+-
Expand Toplevel Ctrl+Shift++
has been replaced with
Fold Toplevel Nodes Ctrl+Shift+-

The terminology has changed, no problem... but what is critical is the actual missing Unfold (or Expand) Toplevel nodes menu item.

It was still working as of version 3.7.2, development 4.7.2 release 5, but when I upgraded two systems (3.14.2/4.14.2) and (3.14.3/4.14.3) it was missing.

It is very efficient to either use the menu item or a shortcut key to collapse the entire source file to get an overview, maybe scroll to position, and then quickly expand the entire source file.  The ability to Unfold/Expand Toplevel Nodes is missing, which basically cripples the benefit of code folding.   It is unusable without Unfold.
Comment 3 Russell 2015-09-23 20:11:08 UTC
Code folding and unfolding the entire file use to work.  Now it only Folds.
ctrl-shift-minus and ctrl-shift-plus were the shortcut keys.

Please see this 2003 bug that discusses it.
https://bugs.kde.org/show_bug.cgi?id=53577
Snippet:
"Expand all folded code. Changed shortcuts for expanding and collapsing all nodes to Control+Shift+Plus/Minus,..."
Comment 4 Buovjaga 2016-06-25 16:21:48 UTC
Confirmed.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm
Comment 5 Christoph Cullmann 2016-09-07 14:14:16 UTC
Git commit 69ed4f390344940590e37a13fcdfc5f591f37388 by Christoph Cullmann.
Committed on 07/09/2016 at 14:13.
Pushed by cullmann into branch 'master'.

CHANGELOG: Support "Unfold Toplevel Nodes" action again

M  +28   -0    src/buffer/katetextfolding.cpp
M  +8    -0    src/buffer/katetextfolding.h
M  +1    -9    src/data/katepart5ui.rc
M  +11   -42   src/view/kateview.cpp
M  +2    -3    src/view/kateview.h

http://commits.kde.org/ktexteditor/69ed4f390344940590e37a13fcdfc5f591f37388