mIRC Home    About    Download    Register    News    Help

Print Thread
#210558 19/03/09 08:16 PM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
The comments in the script editor are formatted the same way as the code itself. The comments should be exempt from this.

for example this:
Code:
/*
                     some more here

*/


turns into this when the editor is closed or if a bracket check is done. the other comments (; comment here) do not do this.
Code:
/*
some more here

*/

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Single-line comments (starting with the ;-char) are indented as well. And I don't regard it as a bug, but an important feature: it maintains readability of the code.
Two examples:
Code:
some code {
  -- some code --
  -- some code --

  ; a single-line comment about the following
  some condition {
    some condition {
      -- some code --
      -- some code --

      /*
      a multi-line comment 
      about the following part
      */
      -- some more code --
      -- some more code --
      -- some more code --
    }
  }
}
or
Code:
some condition {
  another condition {
    -- some code --
    -- some code --

    /* 
    some "disabled" condition {
      -- some "disabled" code --
      -- some "disabled" code --
    }
    */

    -- some code --
    -- some code --
  }
}
(you'd have to un-comment the "disabled" part after modifications, just to get the correct allignment)

If you want to keep the indentation - why not use a char at the "start" of the line? like
Code:
/*
List:
-      item1
-      item2
*/

Last edited by Horstl; 19/03/09 09:32 PM.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
if you're looking for a workaround, use the tab character (ctrl+i in the editor) instead of soft spaces.

this isn't really a bug since there is no expectation that comments maintain any specific indentation formatting-- in fact, given that mIRC will already automatically indent all your other code, the opposite expectation (that mIRC *will* mess with your comments) seems far more likely.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard