Unindent completely

Started by JJK, January 19, 2009, 08:50:54 AM

Previous topic - Next topic

JJK

Hello Alex. First, cheers for 1.40. And here is my request :
When unindenting, we can only unindent until the external ends of the selected scope has reached the left margin. Then we can no more unindent the internal portion of text.
For example if I select the next text,
     For i=1 to 5
          print i
     Next i
I am able to unindent until
For i=1 to 5
     print i
Next i
but not until

For i=1 to 5
print i
Next i
It is perhaps by design, yet it would be useful in some cases. UltraEdit, EditPlus or Pspad are able to do that.
Currently I resolve the issue by replacing \t by nothing. But not elegant.


Stefan

#1
Hi JJK,
i think this it's the correct behaviour.
If an coder rapidly clicks on "Decrease Indent" too much ... he would be sulkily if hes code lose its indent totally.

-

How about an general function like

"Delete
( ) white space: [   \s\t]
(o) string [              ;  ]
( ) empty lines
[X]in front of line;
[ ] at EOL;
[ ] inside line;
(o)delete all;  ( )reduce to one"



EDIT: I don't know if i make myself clear?
I suggest maybe this function could be multifunctional and allow the user to enter any string he want to delete?
Not white spaces only, but any sign or string, like remove any "; " in front of an line, or any ".bak" at the end.
If we can use RegEx here, i don't would regret it :D
(i have modified my dummy dialog-box above)
-

And/or maybe holding an accelerator key while clicking on "Decrease Indent" to
not decrease the indent but remove all white space in front of the line at onces.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

JJK

Hi Stefan
I vote for both. Even in MsOffice VBA's IDE we can decrease indent until margin. It is often useful to redo bad indents (even sometimes spaces instead of real indents, coded by bad coders, isn't it ?).
QuoteIf an coder rapidly clicks on "Decrease Indent" too much ... he would be sulkily if hes code lose its indent totally.
In this case, simply undo by Ctrl-Z.
Perhaps a warning in the status bar would be useful when reaching the left margin.

But I like also your proposal of general function. Obtained how ? By future scripting ?

Stefan

Quote from: JJK on January 19, 2009, 09:52:30 AM
Hi Stefan
I vote for both.
I too :D

QuoteEven in MsOffice VBA's IDE we can decrease indent until margin.
Ah, i see.... you're right here.

QuoteIn this case, simply undo by Ctrl-Z.
yes, ok

Quote
Perhaps a warning in the status bar would be useful when reaching the left margin.
How locks to there if you focus the code? :D
i think not that this is needed, since you rather have an lock at the code then at the status bar.
But maybe an peep?

Quote
But I like also your proposal of general function. Obtained how ? By future scripting ?
No, i hope by Alex, since this should be an default option for an editor (IMHO) :D

CU
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Hi guys,

such behavior to indent till no spaces left (not only till minimum indent) was in HE in some early versions, but then I have removed it. Dont know why... I can bring it back, and JJK is right it can be always undone with Ctrl+Z, so  no problem if somebody un-indents too much.

About the special function for this... Sorry, I am not a fan of such mega functions, doing everything... You could not predict which functionality would need every user and cover all cases. Or it would be very buggy or too complex to use.
At the and this function would not be used very often and people would prefer to do several search replace or just edit manually then learn it. This is my opinion. If somebody would need it repeatedly, I think best would be do built script for this, and have possibility to put a menu entrz for it or shortcut. Sorry, that scripting is not available yet.

Also about modifier keys when calling command. I did a mistake introducing this in some functions...
Why? It is fine when you call command from menu, but what would happen if you would assign a shortcut to it? Then using of modifier keys would mean another shortcut, and command just would not be called... So, only one way I see, create different commands for every combination of modifier keys.

With indenting, I would do the correction for behavior in beta 1.41.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

Quote from: alex on January 19, 2009, 04:08:38 PM

About the special function for this... Sorry, I am not a fan of such mega functions, doing everything...
To bad :D, imho such standard helpers belongs to an good editor. (i want to push :D)

Quote
Also about modifier keys when calling command.
Why? It is fine when you call command from menu,
but what would happen if you would assign a shortcut to it?
I don't want to push you...Just to talk about... i would thought there are two commands available ,
one with and one without accelerator,
like  .decreaseIndent and .decreaseIndentAcc

If i click on the button  then .decreaseIndent would be executed
If i hold an accelerator key AND click the button ...then decreaseIndentAcc would be executed
And that way it's no problem to add shortcuts.... because that are two commands
(they may share the same code but with an IF...Else..statment more ?)

Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

QuoteTo bad , imho such standard helpers belongs to an good editor. (i want to push )
:) with a big "unindent" function, lets see. I really prefer to do such things with a scripting.

QuoteI don't want to push you...Just to talk about... i would thought there are two commands available ,
one with and one without accelerator
Yes, I think this is correct way. Just wrote that, because have noticed this mistake in my implementation (for example in HTML paste, would not change it know, but can happen then somewhen).

And with problem reported by JJK I think I would have behavior requested by him as default, without accelerator. He is right, you can just use undo, in case of mistake. If you think this is necessary, I can have a xml flag to control this.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

>I really prefer to do such things with a scripting
Then it must be OK for me too, (but i had to push since it's my point of view, my opinion, my use of other editors)
Maybe we will have such feature as kind of "add-in" to download later if scripting is implemented :D


> without accelerator.
> If you think this is necessary,
No no, i talked just in generally, not for this special feature.
I think i don't matter what way around this works (when i have to press Acc and when not)
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Stefan

Quote from: alex on January 19, 2009, 05:13:43 PM
I really prefer to do such things with a scripting.
I forgot, did you plan to add GUI options to scripting, so we can build such dialogs like i suggest above? (i know it's to early)
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-