Forum > Editor

Unfolding bug after searching

<< < (2/5) > >>

Muso:

--- Quote from: Martin_fr on April 20, 2021, 04:25:05 pm ---Ok, so I did (partly) fix the advance mouse....

--- End quote ---

To be honest, I am an IDE beginner. I code with Pascal for years, but never had the time to dive into the IDE. Now I have a larger project and struggle with basic things. So maybe before you proceed, here is what I would find very useful:

- right-click on the + icon in front of a procedure/function and get in the context menu the option to un/fold all procedures/functions (like already implemented for comments)
- same as above but for all except blocks
- either a menu or a context menu option, to unfold everything to level 0
- the advanced mouse actions should be self-explanatory. because at the moment I don't understand what is e.g. the current shortcut to fold everything.

I updated Lazarus trunk via FCPupDeluxe and now I can no longer fold everything using Shit+Alt+0. So what do I have to use now for this?
I see in the Advanced Mouse options:

Fold Code   Left   Any   Up   -   -   Y   0      All (Nodes)

So I think I have to cleft-click while pressing the Ctrl button and then all nodes will be unfold. But this doesn't work

Martin_fr:

--- Quote from: Muso on April 20, 2021, 07:35:17 pm ---
--- Quote from: Martin_fr on April 20, 2021, 04:25:05 pm ---Ok, so I did (partly) fix the advance mouse....

--- End quote ---
To be honest, I am an IDE beginner. I code with Pascal for years, but never had the time to dive into the IDE.

--- End quote ---

Actually I hadn't paid attention that you are using trunk, and that therefore you could just fpdeluxe up to the fixed version...

So you do not need to edit the file (or apply the patch).
If you did have to, it is easy.
- Open the file, edit the one line, as shown on the github page.
- Save the file
- Tools > Options > Build IDE
done.

But anyway, not needed.


--- Quote ---So maybe before you proceed, here is what I would find very useful:

- right-click on the + icon in front of a procedure/function and get in the context menu the option to un/fold all procedures/functions (like already implemented for comments)
- same as above but for all except blocks

--- End quote ---
Nice ideas, but I have a large todo list, before this.


--- Quote ---- either a menu or a context menu option, to unfold everything to level 0

--- End quote ---
"to level 0" is just a fancy way to say: unfold all / remove all folds?

If you have folded lines, then the fold gutter context menu has that entry.


--- Quote ---- the advanced mouse actions should be self-explanatory. because at the moment I don't understand what is e.g. the current shortcut to fold everything.

--- End quote ---
The advanced mouse option, is a bit like Firefox "beware dragons" advanced options.

The normal mouse options, cover more than most people need. But there always had been a few people wanting something different. The advanced options are for this.
(Currently the overall options do not have a way have disabling advanced options, otherwise they would be invisible by default).

They are explained on the wiki. But they are to complex to be intuitive. (In a way they are a basic programming language)

In this case, I gave you the exact setting to apply. => that is to apply blindly, without understanding why. (the why is on the wiki)
 

--- Quote ---I updated Lazarus trunk via FCPupDeluxe and now I can no longer fold everything using Shit+Alt+0. So what do I have to use now for this?

--- End quote ---
This should still work. Please check your keymap setting, as in the attached image.


--- Quote ---I see in the Advanced Mouse options:

Fold Code   Left   Any   Up   -   -   Y   0      All (Nodes)

So I think I have to cleft-click while pressing the Ctrl button and then all nodes will be unfold. But this doesn't work

--- End quote ---
I assume that is in the section "collapsed". I.e. applies when you click on a [ + ] symbol

Depends on your reading of "all nodes".
"all nodes" here means: all nodes on this line.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if a then begin if b then beginif both "begin" blocks are folded, you can either
- open one of them
- open both (all)

That does not apply to nodes on other lines.

If you want to, I can give you instructions, how to unfold all nodes on all lines, by clicking on the fold gutter.
(Ideally just clicking on the gutter outside of a [ +- ] symbol. I.e. empty parts of the fold gutter, or vertical line parts. / Or using middle button / Otherwise a lot more editing is needed).

Or send me your editoroptions.xml => and I add the middle click to unfold all, and send it back to you.



Muso:

--- Quote from: Martin_fr on April 20, 2021, 08:21:58 pm ---
--- Quote ---- either a menu or a context menu option, to unfold everything to level 0

--- End quote ---
"to level 0" is just a fancy way to say: unfold all / remove all folds?

If you have folded lines, then the fold gutter context menu has that entry.

--- End quote ---

Yes, I meant to completely fold, like using Alt+Shift+1.
I don't see this in the context menu. I right-click onto the + icon in front of a procedure and get the attached.

So when I right-click onto the icon in front of a folded procedure I get a content option to unfold all, but when I right-click onto the icon in front of an unfolded procedure I get no context option to fold all.


--- Quote ---They are explained on the wiki. But they are to complex to be intuitive. (In a way they are a basic programming language)

--- End quote ---
;D
Thanks for the info.


--- Quote ---
--- Quote ---I updated Lazarus trunk via FCPupDeluxe and now I can no longer fold everything using Shit+Alt+0. So what do I have to use now for this?

--- End quote ---
This should still work. Please check your keymap setting, as in the attached image.

--- End quote ---

I run fpcupdeluxe another time to update trunk despite there are no new commits, and now it works again. Strange.

Martin_fr:

--- Quote --- All (Nodes)
--- End quote ---
I changed the text for that to "All on line (Nodes)"

The "Nodes" part is, because this is used as the name in the dialog. Even though it is not of much meaning in the grid. (But for other options it is needed to be repeated)



--- Quote from: Muso on April 20, 2021, 08:51:28 pm ---
--- Quote from: Martin_fr on April 20, 2021, 08:21:58 pm ---
--- Quote ---- either a menu or a context menu option, to unfold everything to level 0

--- End quote ---
"to level 0" is just a fancy way to say: unfold all / remove all folds?

If you have folded lines, then the fold gutter context menu has that entry.

--- End quote ---

Yes, I meant to completely fold, like using Alt+Shift+1.
I don't see this in the context menu. I right-click onto the + icon in front of a procedure and get the attached.

So when I right-click onto the icon in front of a folded procedure I get a content option to unfold all, but when I right-click onto the icon in front of an unfolded procedure I get no context option to fold all.

--- End quote ---
It looks like you got the image when you clicked on a [ - ], not on a [ + ] ? Because the first line in the context menu has the [ - ] too.

You need to have at least one folded line in the file, in order to see the entry. If there is no folded line the entry is not in the menu (I.e there is no disabled entry, the entry is dropped entirely).

If you do have at least on fold, then you should get "unfold" all, anywhere you right click the fold part of the gutter.


--- Quote ---I run fpcupdeluxe another time to update trunk despite there are no new commits, and now it works again. Strange.

--- End quote ---
Ends well, all's well.

Martin_fr:
Btw, bit off topic, but useful for editing large code....

I used to do a lot of folding. Nowadays, I don't, I use a 2nd (or even 3rd) editor window.
Of course that depends on your monitor size.

The IDE can have the same unit open in 2 or 3 or more Windows. Each window scrolled to a diff location in the file. All windows are synchronized.

Look at the context menu of the editor tabs. "Clone to window"

Btw "Lock Page" will prevent the IDE from scrolling the view in that window, when you use code navigation. That is the IDE will rather switch to another window with that unit open, and only if no other option then it will scroll the locked view.
Useful, if you have the class declaration open in one window, and edit the implementation in the other window. Lock the window with the declaration.


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version