[Improvements] Folding, copy paste, drag'n drop
-
@wonkawilly ,
The tools you mention, again for clarification, are Word Processors and Notepad++ is not.You can code in a word processor if you want to, as long as it’s exported/saved to a .txt format file, since a word processor has meta data and structures that allow for the fancy manipulation you are asking about…and again, for clarification and education, Notepad++ is not a word processor, it is a text editor
The capabilities of NPP is by nature, the product of a library that allows for meta manipulation of text for the purpose of minor word processing capability to produce syntax highlighting, folding (that you are asking about) and is inherent in the library itself, not NPP…so maybe this feature is something that you could direct to the Scintilla project, to make it something it can do by default by calling a few routines in that library.
NPP can do a lot of things beyond just being a code editor, but at the end of the day, it only handles text, saves as text and does not save the structure of the document itself, in the document. That’s the basic difference between what we have, and what you want.
Those examples you give save their document format and structure in the doument itself, hence by nature, it is not a comparable capability that can be embedded in the text files that NPP works with. I can’t understand why people can not or will not understand and accept that NPP is a text editor and not a word processor, where all those neat features everyone wants belongs.
-
Hi, @wonkawilly, @lycan-thrope, @alan-kilborn and All,
But, @wonkawilly, it DOES copy / paste the folded
html
section !
-
Placed your caret to the very beginning of your folded line, whatever it is
-
Click on the
Shift + Down arrow
shortcut -
Click on the
Ctrl + C
shortcut -
Open a new tab (
Ctrl + V
) -
Paste the
HTML
stucture of the folded section (Ctrl + V
)
You may, as well, use the @alan-kilborn’s techique and drag n’ drop your folded section in a new tab, using the two panels feature !
But, whatever your choice, your new tab should contain the complete struture of the folded section selected !
Best Regards,
guy038
-
-
Hi, @wonkawilly and All,
Oh, I misunderstood your post :-(( Indeed, you seem upset that a click on the line number of the folded line does not copy all the structure, doesn’t it ?
Well, then simply use one of the two techniques, described in my previous post !
BR
guy038
-
@Alan-Kilborn said,
It will do the described poor behavior if you click the line number margin to select.
Then @wonkawilly said in [Improvements] Folding, copy paste, drag’n drop:
Tried: doesn’t work; just the first line of the folded block gets moved
He just told you clicking in the line margin to select will not work, and then you tell him you tried doing that and it didn’t work. This is unsurprising, as it’s exactly what he said wouldn’t work. But luckily for you, Alan went on to explain exactly how you can achieve your desired behavior:
And I quote @Alan-Kilborn here (emphasis added):
However, if you don’t use the line-margin selection technique, but rather use the mouse to select the folded lineblock’s single visible line (in its entirety), and then drag it to a new location, the block moves (and is expanded when dropped).
You also said,
I can’t because I get the message: "You can’t perform that action at this time. "
Yes, it is rather unfortunate for you that decisions you made when posting in the GitHub issues have lasting consequences. But that doesn’t change the fact that we in the Community Forum can do nothing here to implement feature improvements, and any suggestions made here can only serve to get you our opinions on your ideas, and our thoughts for workarounds; but nothing you say here will be taken by any of the developers as an official feature request.
-
@PeterJones ,
There is one exception to this, depending on if it’s an inhouse or UDL language. For instance, my UDL has an issue when thereturn
statement is used inside say ado case
structure, the folding short circuits including text after that return statement, as belonging to the function that is folded, and consequently, the remaining text after the firstreturn
will be outside the fold.However, copying that additional bit of text along with the folded function line, does indeed do as you describe, by copying and expanding the folded function, including the internal
do case
folded section as well. Below shows the needed copy and paste screenshots that I have to do, unless I can figure out how to allow a return statement inside of a function to not be counted when it is not the function’s truereturn
closing keyword: -
On a technicality, I still maintain that Alan and I are right, because Alan’s method grabs the entire folded section (27-46 in your example) – grabbing something outside the fold (lines 47 and 48 in your example) (whether it should have been part of the code block or not) was not part of the problem statement (“select the folded part”). If you want to grab more than just what’s inside the fold, you can extend the selection after starting to grab the whole block the way that Alan described.
To sum up: Double-clicking the margin will only select a single line, whether it’s the first line of a fold or not; selecting from the first character of a line then using shift+arrow to move to the next visible line will select the entirety of the fold; and you are responsible to extend beyond that yourself, if you want to select more than was folded.
-
@PeterJones ,
I think we just misunderstood each other…I’m agreeing with you, I’m just pointing out a flaw, more due to my UDL limitation, than the technique you’re talking about.
:-)
I agree with you, and have done it, it’s just the flaw with how the UDL works that causes it not to get theintended
end of the fold, so it does work as it’s supposed to, my UDL just leaves it short. -
OK the solution proposed works indeed: so the trick is basically to select one more paragraph / end of line / \r\n to make it work.
Thank you all. -
This post is deleted! -
This post is deleted!