Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#730 change the default comment marker from "~ " to " `"?

pending
nobody
General (289)
5
2011-09-07
2011-07-12
Josh
No

Hello, when setting geany to remove whitespace at the end of each line and toggling comments with the default comment marker "~ ", sometimes these spaces get removed if there is nothing on that line. After which you must manually delete the comments. Changing the default comment marker to " `" avoids this problem, but still allows you to read your code fine. A trivial patch is attached that changes this default.

Discussion

1 2 > >> (Page 1 of 2)
  • Josh
    Josh
    2011-07-12

    changes the default comment marker from "~ " to " `"

     
  • Nick Treleaven
    Nick Treleaven
    2011-09-07

    Not sure we want this change as the space helps in reading commented out code. A better fix would be to make geany recognise toggled empty lines with stripped trailing space.

     
  • Nick Treleaven
    Nick Treleaven
    2011-09-07

    • status: open --> pending
     
  • Nick Treleaven
    Nick Treleaven
    2011-09-07

    > the space helps in reading commented out code

    Here I meant a space immediately before the commented out code.

     
  • Josh
    Josh
    2011-09-07

    I know, I thought about that when I found the bug. That's why I chose ' `' to replace it, because '`' is small so you can still read your code. I guess we could have geany just not comment lines consisting only of whitespace, that'd work

     
  • Josh
    Josh
    2011-09-15

    so apparently not commenting empty/whitespace-only lines is already possible in `editor_do_comment` (line 3165 of editor.c). The option is called `allow_empty_lines`, and is set to TRUE in 2 of the 3 function calls. Setting it to TRUE in the third gives us the desired behavior (empty lines not commented), but also makes the selection jump to the next time each time 'toggle comment' is invoked if the next line is whitespace. Should we remove the `allow_empty_lines` option and then make sure geany doesn't change the selection when toggling comments? This seems sensible to me, though I haven't tested multi-line comments without that option.

     
  • Josh
    Josh
    2011-09-30

    stops blank lines from being commented when single line comments are used

     
  • Josh
    Josh
    2011-09-30

    That patch (just attached) should do it. If blank lines aren't commented, there's no way for their whitespace to be stripped upon saving :)

     
1 2 > >> (Page 1 of 2)