Xide Comment with Control + B

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
SHirsch
Posts: 286
Joined: Tue Jan 30, 2018 8:23 am
Location: Germany

Xide Comment with Control + B

Post by SHirsch »

Hi Chris,

a small bug (or feature?) with comment function.
In code there are some comment lines ( with // ). When I now select all code (ALT + A) and then press CONTROL + B all code lines begin with // (which is fine). But comment lines starting with // get no additional // in front. When I now decomment with CONTROL + B the original comment lines are no comment lines any more.

Sample:

Code: Select all

CLASS Foo
//Comment line
    PROTECT xxx AS STRING
    //Protect yyy as INT
CONSTRUCTOR()
RETURN
END CLASS
now press ALT + A then CONTROL + B, you get:

Code: Select all

//CLASS Foo
//Comment line
//    PROTECT xxx AS STRING
    //Protect yyy as INT
//CONSTRUCTOR()
//RETURN
//END CLASS
Then press CONTROL + B again, you get:

Code: Select all

CLASS Foo
Comment line
    PROTECT xxx AS STRING
    PROTECT yyy AS INT
CONSTRUCTOR()
RETURN
END CLASS
In VO all lines get //. And comment lines then have multiple //.

Regards,
Stefan
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Xide Comment with Control + B

Post by Chris »

Hi Stefan,

Yes, this is actually a feature, for some reason I had thought it makes more sense like that. But now that you mention it, I agree it most probably doesn't, so I will change it to work as you suggest and as VO works, thanks for the suggestion. Unless someone else has an objection, in which case I will just make the different behavior optional :)

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Xide Comment with Control + B

Post by wriedmann »

Hi Chris,

sometimes the current behavior is very useful. So maybe Ctrl+Shift+B (and a corresponding menu option) for the current behavior would be desirable.

(I miss this in VO too).

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4898
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Xide Comment with Control + B

Post by Chris »

Hi Wolfgang,

CTRL+SHIFT+B is used for doing block comments (/*....*/ instead of //). So I will just make the new behavior optional (in Preferences).

Chris
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Xide Comment with Control + B

Post by wriedmann »

Hi Chris,

ok, thank you very much!

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply