Shop OBEX P1 Docs P2 Docs Learn Events
IDE Annoyance: Block Indentation — Parallax Forums

IDE Annoyance: Block Indentation

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2008-06-18 15:26 in Propeller 1
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

Comments

  • LeonLeon Posts: 7,620
    edited 2008-06-17 20:07
    I just tried it, and you are right. What's happening is that the cursor is always on the next line after the highlighted items, and the line with the cursor is added to the selection when indenting. I've never noticed it because I use the mouse to select blocks of text. I suspect that a lot of people do the same.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • TimmooreTimmoore Posts: 1,031
    edited 2008-06-17 20:22
    Try this using the ide. Click somewhere in the source, then using the mouse change the display from full source to condensed (any of the others works as well). Then use the keyboard cursor down key, the cursor doesn't move. Nor do any other cursor key. Nor can you use Alt-F to get to the menu or any other menu. You have to use the mouse to select somewhere in the text before the keys work again but F9 works.
  • Jeff MartinJeff Martin Posts: 757
    edited 2008-06-18 00:04
    Hi,
    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
    291 x 235 - 4K
    797 x 300 - 10K
  • TimmooreTimmoore Posts: 1,031
    edited 2008-06-18 00:18
    Thanks Jeff, you might want to look for other similar cases. I seem to get into that state, i.e. can't use Alt-F or other menu keys, a lot and I dont use the those radio buttons that much. I can't work out how else I get into that state though, if I do I will let you know.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-18 00:20
    Jeff,

    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
  • TimmooreTimmoore Posts: 1,031
    edited 2008-06-18 01:26
    Jeff, just found the way I normally do it. Load multiple files into the ide. Change files by using the mouse on the filename tab. Alf-F etc do not work.
  • Jeff MartinJeff Martin Posts: 757
    edited 2008-06-18 15:26
    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.
Sign In or Register to comment.