[Improvements] Folding, copy paste, drag'n drop
-
@wonkawilly said in [Improvements] Folding, copy paste, drag’n drop:
How to reproduce the bad behavior:
Make a generic content that is possible to fold and fold it clicking on the - (folding point): the section folds… than select the row and cut|copy/past or drag’n drop it elsewhere: only the first row is processed if you don’t select an empty row after the folded section.
If you have other text you cannot select correctly.It will do the described poor behavior if you click the line number margin to select.
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).
Also when a section is folded and you try to move them by using the keyboard (Ctrl+Shift+up|down arrow) is expected that the whole section moves before or after the previous or next folded section at once. But instead is un-folded and moves line by line. This too is an ugly behavior that IMHO needs correction making a folded section move all at once and jump the others folded section all at once: each folded section has to act as a block.
This perhaps is a valid point, with the obvious workaround of cut -> move caret -> paste.
I used to like “move line up” / “move line down” functionality, but I have stopped using them for two reasons: It puts a lot of information in the undo buffer, so if I’m undoing or redoing, I find myself getting confused about what the “real” operation was, and also because it can do unintended changes to “change history”, which I have come to rely on.
-
@Alan-Kilborn ,
Originally, I answered with the link to the FAQ on how to suggest Features, but if this is about a discussion, then my vote is that the user should just unfold and cut/copy/paste the complete text they want. That way there is no magic needed, nor will they be confused why everything wasn’t pasted.Some things, in my POV is that some people are just being excessively lazy either in planning out their layouts whether that be code or chapters of a book, and expecting the software to make their needing to change something, the responsibility of the application to make their mistakes easier to repair.
I’m a touch typist, having been using a manual typewriter, going to an electric typewriter, to using software word processors and code editors, and it amazes me, how someone could have ever survived using the tools I did, prior to software tools. But, therein lies the answer to their problem…now they just have to learn how to code the solution to their problems themselves, rather than rely on other people and tools to do it for them. I guess I’m just old to think such things. :-)
-
@Lycan-Thrope Somethime you might have to move huge sections of text or code with the huge risk let in place some orphan row.
Folding have been invented not only to hide rows but even to facilitate working with very long text with easiness.
Look for example at MS Word or Libre office Write that are able to move whole chapters ad sub chapters around into a structured document just moving a row: the title of the chapter that you want to move.
This is a powerful editing tool to have into a text editor.Ps
Also about asking for new features and improvements into
https://github.com/notepad-plus-plus/notepad-plus-plus
I can’t because I get the message:"You can’t perform that action at this time. "
-
@Alan-Kilborn said in [Improvements] Folding, copy paste, drag’n drop:
It will do the described poor behavior if you click the line number margin to select.
Tried: doesn’t work; just the first line of the folded block gets moved
An Animated screenshot follows:
-
@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!