Usability suggestions.

Discussion about CodeLite development process and patches
dsisco11
CodeLite Curious
Posts: 8
Joined: Sat Mar 01, 2014 7:46 am
Genuine User: Yes
IDE Question: C++
Contact:

Usability suggestions.

Post by dsisco11 »

:TOP /*reading is fun! :P*/

I have been using CodeLite for a few months now and I have to say that overall it's very nicely done.
However; I have come across a design flaw that conflicts with common input conventions.

Namely, the shift key should not make you go to the declaration for an item.
Why?: Shift is consistently used across operating systems for selecting blocks of text, you click somewhere on one line and then hold the shift key down and click somewhere else and the text editor highlights all the text inbetween.
Assigning it a different function hinders users from performing a commonly used action, the function in question should not be reassigned to the Ctrl key either as that would present similar problems. I suggest the Alt key be used instead as it inherently implies an "alternate function". To be clear I don't recommend making the function in question trigger on some Shift+Alt or Ctrl+Alt combination, just by holding Alt and clicking a variable or function or class or whatever.


I also have a suggestion for an Improvement.

Fold collapsing support.
At the moment we have the option to toggle all folds, toggle the current fold, toggle the topmost folds in the selection, or toggle every fold in selection.
These are a LOT of options that could be combined into a single one for greater simplicity.
I propose we add a new option named "Code Collapse" or "Collapse fold" or "Collapse block".

How it works:
Let me first state that when I say "block" I am referring to a code fold eg: the block of text between two matching enclosed brackets.

When used, if you have text selected then all the blocks within that selected area will be collapsed.
If you do not have text selected then the block that your cursor is within will be collapsed. Then if there is an empty line above the collapsed block your cursor will move right above the collapsed block so that you could potentially write a comment or something there. If there is no blank line above the block then move the cursor to the beginning of the collapsed blocks line.
After you have collapsed one block using this method you can trigger it again to collapse the block containing the one you previously collapsed. In this way it will be easy to quickly "collapse up" through a nest of blocks.
There should also be a reverse version of this feature so you can use the same logic to uncollapse a block.

I am willing to put this feature in myself if another developer is not wanting.


New feature suggestions:

Feature: Pressing F12 while the caret is on an #include line should open said include file.
Why do it?: This converts what is now a 3 step process (right click line, move to "open file", left click option) to a one step process wherein you merely press F12.
At this time pressing F12 on an #include line does nothing so adding this in would not require removing or altering any other features.

Feature: Support for Ctrl+Shift+<Up/Down arrow> for moving an entire line of text up/down.
Why do it?: Notepad++ does this and its VERY useful. If my hands are already typing and I notice that the line i'm typing out would be better placed a few lines above or below its current location I can simply press Ctrl+Shift+ Up/Down arrow a few times much more quickly then it would take me to grab my mouse and select the entire line and copy it and then go to the line where I want it to be and then hit enter to move that line down and then paste again.


Okay that's all my suggestions, what do you think?


TLDR: goto TOP; /*goto is evil I know*/
DavidGH
CodeLite Plugin
Posts: 710
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Usability suggestions.

Post by DavidGH »

Hi,

Starting at the bottom ;) :
Feature: Support for Ctrl+Shift+<Up/Down arrow> for moving an entire line of text up/down.
This is already available. The default shortcut is Alt-PgUp/Dn.
Fold collapsing support
I agree this is a bit confusing. That's partly because it evolved from just the original 'Toggle single fold'. 'Toggle all folds' was the first addition, but that is unusable when there are >1 all-encompassing folds (things like #ifndef foo.h). So I recently added the others.

I'm in favour of simplification, but only if it retains at least the current useability. In particular it must easily toggle all 'real' folds, despite 'n' all-encompassing ones. With your idea, that would take several key-presses for an average file, and dozens for e.g. LiteEditor/cl_editor.cpp.

Regards,

David
dsisco11
CodeLite Curious
Posts: 8
Joined: Sat Mar 01, 2014 7:46 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Usability suggestions.

Post by dsisco11 »

1)
About the moving lines up/down thing, thanks I hadn't seen that before!
Though I would like to point out that notepad++ is a pretty popular editor, so perhaps adding a second keybinding for these commands that matches the Ctrl+Shift+Up/Down arrow binding which notepad++ uses would be beneficial in helping new users become much more comfortable with CL very quickly.

When you have to go into a new program and change it's keybinds to match what your used to it will immediately start feeling more alien to you.
I'm not saying the current binding needs to change, just that a second alternate one be added, it can only be beneficial!


2)
I'm not suggesting we remove the "toggle all" feature, that one definitely needs to stay.

My idea is to separate the "toggle single fold" command into 2 new ones like "collapse fold" and "expand fold".
Then we can further extend the functionality of the options by making either one able to be continuously triggered to collapse upwards or expand downwards through a tree of folds very quickly if you don't need to collapse ALL the folds on the page.

Because I have gone into a file plenty of times where I have many functions within a namespace and I want to JUST have the functions collapse and leave the encompassing namespace fold expanded, but this is not possible at the moment. Though I suppose the situation i'm describing is the fault more of the fact that "toggle all folds" doesn't seem to collapse them all but rather just the outermost one so that when you re expand it the ones inside it (all the functions folds) are still expanded.

*Edit*
The collapse fold command could be assigned to Alt+Right and the expand fold command could be given to Alt+Left
This would make it still feel natural (if your used to collapsing with Alt+Right) and increase the usability from being limited to toggling a single fold to being able to collapse/expand a whole nest of folds very quickly if needed!

*Edit x2*
As an alternative to my above suggestion, a single new fold toggling function could be added (and maybe given to Alt+Left).
How about a "Toggle declaration folds" option which would toggle folding of only the class and function blocks while completely ignoring any other folds, like namespace ones. Visual C++ has this feature and I used it quite frequently.
Post Reply