IDE Annoyance: Block Indentation
Phil Pilgrim (PhiPi)
Posts: 23,514
There's a minor, but very annoying, bug (feature?) in the IDE's text editor. If I want to indent a block of text, I position my cursor at the beginning of the first line I want to indent, then type Shift-DownArrow to select the lines to be indented. When I hit Tab, though, the lines I've selected get indented, plus the line immediately below them. Moreover, after the indentation takes place, only the first character of each indented line remains selected. This runs contrary to the behavior of every other editor I've ever used. The only stuff that should get indented is what's selected, and the selection should not change as a result of the indent operation.
Jeff, is this something that could be fixed in the next release of the IDE? Please?
Thank you!
-Phil
Jeff, is this something that could be fixed in the next release of the IDE? Please?
Thank you!
-Phil
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
That was done on purpose... the feature was intended to allow the entire line of any line that was fully or partially selected to be indented or outdented.· This allows you to more quickly select lines where you want to indent or outdent from the logical left edge of the text of those lines (see first attachment examples).· Also, since indenting and outdenting a block of text in this manner seemed so unique (every other editor I've seen will replace the selection with the Tab character if I tried this), I made it change the selection to highlight the column of characters that is being aligned to a tab position as an indication that something special happened.· Successive Tab key (or Shift+Tab key) presses will indent/outdent in the same way.
Pages 72 and 73 of the manual indicates this.
As far as the line the cusor rests on... I honestly don't remember if I did that on purpose or if it just happened and I didn't notice.· Either way, I'll look into that and I agree that's not intuitive at all.
The selection change was very intentional, however.· It was partly to make people realize that no "replacement of characters" was done, but rather a block indent/outdent operation was performed, and at the same time to indicate which characters were used as the "aligning" edge.· It's not obvious from the example you mentioned, but if you have something like what's shown in Ex1 (second attachment examples)·where the·comments were intentionally indented to different levels to convey related sub-steps, then·then ALT+Mouse selected the comments as shown in Ex2, and pressed Tab, the result is that which is shown in Ex3.· This was done to make it easier to select such things (left-side whitespace is ignored) and the selection change indicates where the logical left edge was determined to be.
Timmoore,
I just tried your example and figured out what is happening, it appears to only happen if, after clicking Condensed (or any·other radio button up there) you leave the mouse pointing at one of those radio buttons.· I think those·radio button controls are capturing the mouse·and·somehow preventing keyboard input from registering on the edit control.· I'll look into that one as well.
Thanks guys.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.
Post Edited (Jeff Martin (Parallax)) : 6/18/2008 12:16:49 AM GMT
Thanks for taking the time to explain the selection change rationale. It makes sense now; and I'd be okay with it, if only the line below the selected text didn't get indented/outdented. (The PBASIC editor does this properly, BTW.)
-Phil
You're welcome.· I agree, I'll see if I can fix that cursor thing.
Timmoore,
Thanks for the info, I'll note that as well.· With that in mind, it seems that it must be some other thing (not just the radio buttons) causing the problem; that gives me something to help narrow it down with.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.