Bug 53258 - Code folding keyboard shortcuts
Summary: Code folding keyboard shortcuts
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-22 10:08 UTC by Robert Jonsson
Modified: 2007-12-11 15:29 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Jonsson 2003-01-22 10:08:36 UTC
Version:           2.1 (using KDE KDE 3.0.99)
Installed from:    Mandrake RPMs
OS:          Linux

Code folding is a _very_ welcome addition to the editor engine, great stuff!

I've got one issue though. No keyboard shortcuts for folding/unfolding. 
While standing anywhere inside a block (or on the line with the start of the block if that is easier to implement) and pressing the kbd shortcut should toggle folding/unfolding. Not one kbd shortcut for fold and one for unfold, a toggling kbd shortcut would be better I think.
The exact kbd shortcut sequence is of lesser importance (it should be possible to change anyway).

In essence this should be a rule for _anything_ that in some way handles the text window. >>There should be keyboard shortcuts.<< Using the mouse is distracting and slow. The things I can do without removing my hands from the keyboard are clear improvements.
Comment 1 Hamish Rodda 2003-01-27 10:33:43 UTC
Subject: kdelibs/kate/part

CVS commit by rodda: 

Code folding keyboard shortcuts, use Control + Plus/Minus.  The only shortcuts not
implemented that I can think of are a global collapse/expand (other than the toplevel
one already implemented), but I think it probably wouldn't be that useful.

Requires my next commit (.rc file) to use.

Exposes (or makes it easier to see :) a few bugs in the folding code itself.

Kate devs: if we get the bugs ironed out, this might be a good candidate for a backport (makes code folding much more useful imho)...?

CCMAIL:53258-done@bugs.kde.org


  M +80 -1     katecodefoldinghelpers.cpp   1.44
  M +13 -11    katecodefoldinghelpers.h   1.19
  M +18 -1     kateview.cpp   1.234
  M +3 -1      kateview.h   1.109



Comment 2 Hamish Rodda 2003-01-27 10:35:47 UTC
Robert, have a think about how a toggle would really work... and then try this. If you 
still think a toggle would be better, reopen the bug :) 
 
This makes code folding much more useful imho, so much so that I've turned it on as 
default :) 
Comment 3 Hamish Rodda 2003-01-27 10:45:30 UTC
Oops I meant turned it on as default for my personal copy, not in the source ;) 
Comment 4 Nicola Larosa 2006-06-04 14:58:18 UTC
[Cannot find a way to reopen the bug.]

I'd like to stress one of Robert's concerns:

"Not one kbd shortcut for fold and one for unfold, a toggling kbd shortcut would be better I think."

This is crucial for a good interaction. Having to switch among two different shortcuts slows things down too much, and it's not like one may further collapse a collapsed section, or further expand an expanded one, anyway. :-)

I realize it may not be easy to alternatively associate two different operations to the same shortcut: I would really appreciate it, though.

(A minor point: the Ctrl++ and Ctrl+- are usually associated to font size change, in other applications; it would be nice to be consistent. I use Alt+3 to toggle one level, and Alt+4 to toggle the whole file, in other apps; they are a bit peculiar, I know.)

I greatly miss another feature: a shortcut to jump among the first lines of the main sections, like classes, methods and functions (Alt+Up and Alt+Down would be great).

The combination of the above two features makes a world of difference in my daily programming, when using other apps; Kate deserves no less. :-)
Comment 5 Hamish Rodda 2006-06-05 11:13:47 UTC
Well, it perhaps would be better to make a new bug and have that reference this bug, as the bug has not returned, but this is a new request.  But i'll reopen anyway.
Comment 6 premierSullivan 2007-06-29 05:32:25 UTC
I don't see what the use of code folding is unless there is a global collapse function... in fact, the lack of that single simple feature is a complete showstopper for me, and I'm going to find another editor/IDE... I'm not going to manually go through my entire program and collapse every fold, that's ridiculous.

I guess I'll manually go in a add the feature myself... I just don't see the point, I just don't see the point...
Comment 7 Randy Kramer 2007-06-29 14:52:23 UTC
Re: "This is crucial for a good interaction. Having to switch among two different shortcuts slows things down too much, and it's not like one may further collapse a collapsed section, or further expand an expanded one, anyway."

I just want to put my $.02 in: Actually, in my use case I can "further collapse a collapsed section, or further expand an expanded one", so if a toggle were implemented, I'd need to be able to change it to a non-toggle (probably by assigning two different keyboard shortcuts).

My use case collapses (primarily text) documents at the levels of the equivalent of the HTML h1 thru h6 heading tags.  (My text uses TWiki markup with some modifications/additions.)

I would like to say +1 to the global collapse function--that would make things much better.  (Or an option such that files are opened in a globally collapsed function.)  Some background: (using kate 2.4.2, planning to switch within the month to 2.5.6): There are enough (well, too many) anomalies in Kate's folding that I occasionally have to reload a file to "clear" those anomalies.  If I'm working with a file, it is usually collapsed except for the area I'm working in.  Barring the addition of a means to preserve the folded condition on a save and re-open, the next best thing (for me) would be for the document to open fully collapsed (or allow me to globally collapse with one keyboard shortcut).
Comment 8 Randy Kramer 2007-06-29 15:01:32 UTC
Re: "(Or an option such that files are opened in a globally collapsed function.)"

s/function/condition/
Comment 9 FiNeX 2007-12-11 14:51:01 UTC
In both Kate: 2.5.8 and Kate: 2.97.1 (from the upcoming KDE4) has code folding keyboard shortcuts for local folding and global... Exactly, what is now the exact issue?
Comment 10 Robert Jonsson 2007-12-11 15:00:50 UTC
Being the original reporter I barely remember. ;-)
I see in the comments that the issue has taken on several "meanings" and solutions. I defer judgment to anyone with current opinion about the subject. For me you can consider it fullfilled.
Comment 11 FiNeX 2007-12-11 15:29:14 UTC
I consider closed it too. Thanks Robert :-)