Uploaded image for project: 'GMAT'
  1. GMAT
  2. GMT-2979

Script editor comment/indent commands don't work in a standard way

    Details

      Description

      This is an impression-of-quality issue.

      The script editor has two sets of commands: Comment/Uncomment and Indent/Unindent. Many other text editors have these commands, but ours operate differently and in a more limited way.

      Commenting

      • When you click in a line and click Comment or Uncomment, nothing happens. Other editors will comment or uncomment the line that the cursor is in.
      • When you select a block of text, other editors don't care where the selection begins or ends (i.e. it can begin in the middle of a line). GMAT inserts the comment symbol at the beginning of the selection, not at the beginning of the line containing the selection.
      • To uncomment something, the comment symbol must be the first character in the selection. This is very restrictive; other editors uncomment any lines touched by the selection.

      Indenting

      • Tab doesn't work (see GMT-1854)
      • "Indent more"/"Indent less" with multiple lines selected works fine
      • With just a partial line selected, the indent commands delete the selected text (probably could be another bug)
      • With just a cursor and no selection, "Indent more" acts as if you had pressed tab.
      • With just a cursor and no selection, "Indent less" just moves the cursor back to the last indent boundary.
      • In all cases, MATLAB treats Indent/Unindent as line-mode commands, not cursor-location commands.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            shughes Steven Hughes added a comment -

            CCB: P1 R2013a. No single item is P1 but there are so many quirks and inconveniences this is P1.

            Show
            shughes Steven Hughes added a comment - CCB: P1 R2013a. No single item is P1 but there are so many quirks and inconveniences this is P1.
            Hide
            jjkparker Joel Parker added a comment -

            How did you fix this? Did you end up doing anything with Scintilla, or doing everything manually on top of it?

            Show
            jjkparker Joel Parker added a comment - How did you fix this? Did you end up doing anything with Scintilla, or doing everything manually on top of it?
            Hide
            tgrubb Thomas Grubb added a comment -

            The hooks I needed were already there. The functions were generally working as designed. For example, the "With just a partial line selected, the indent commands delete the selected text" is specifically mentioned in the wxWidgets documentation. I just needed to vary the initial conditions so that it fit with our needs.

            Show
            tgrubb Thomas Grubb added a comment - The hooks I needed were already there. The functions were generally working as designed. For example, the "With just a partial line selected, the indent commands delete the selected text" is specifically mentioned in the wxWidgets documentation. I just needed to vary the initial conditions so that it fit with our needs.
            Hide
            jjkparker Joel Parker added a comment - - edited

            Looks great so far! One tweak: can you append "% " (notice the space) when commenting, instead of just "%"? This is how MATLAB and Notepad++ behave, and it looks cleaner to my eyes.

            Show
            jjkparker Joel Parker added a comment - - edited Looks great so far! One tweak: can you append "% " (notice the space) when commenting, instead of just "%"? This is how MATLAB and Notepad++ behave, and it looks cleaner to my eyes.
            Hide
            jjkparker Joel Parker added a comment -

            Ok, looks like doing a two-character comment block might take a bit more thought (what if you delete one character manually, then use the auto-uncomment?). Steve and I say if it works fine with a trivial amount of effort, do it. Otherwise, assign it back to me.

            Show
            jjkparker Joel Parker added a comment - Ok, looks like doing a two-character comment block might take a bit more thought (what if you delete one character manually, then use the auto-uncomment?). Steve and I say if it works fine with a trivial amount of effort, do it. Otherwise, assign it back to me.
            Hide
            jjkparker Joel Parker added a comment - - edited

            Actually, I don't believe the current implementation is finished. If someone does this (notice it's indented from the left):

                %mycode
            

            then uses Uncomment, it doesn't work.

            Again, if it's not much more effort to insert/remove "% ", let's do that.

            Show
            jjkparker Joel Parker added a comment - - edited Actually, I don't believe the current implementation is finished. If someone does this (notice it's indented from the left): %mycode then uses Uncomment, it doesn't work. Again, if it's not much more effort to insert/remove "% ", let's do that.
            Hide
            jjkparker Joel Parker added a comment -

            Looks great in the 2012-08-28 build!

            Show
            jjkparker Joel Parker added a comment - Looks great in the 2012-08-28 build!
            Hide
            jjkparker Joel Parker added a comment -

            This is documented in the Script Editor spec.

            Show
            jjkparker Joel Parker added a comment - This is documented in the Script Editor spec.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: