I'm trying to figure out where the comment block style is defined in Geany for C files.
By this I mean when I select a block of text and hit ctrl-e, each line in the block of text
is pre-pended (at it's indentation level) by a //~
A problem comes from the extra space. On blank lines I get //~
but I also have trim-trailing white-space enabled when I save the files, so I get the following sequence.
void aprinter(uint8_t * buf) {
uint16_t length = sizeof(*buf) / sizeof(buf[0]);
printf("len: %d;\n", length);
uint16_t i;
for (i = 0; i < length; i++) {
printf("buf[%d]: 0x%02x;\n", i, buf[i]);
}
}
I want to comment out the guts of this function so I select it and hit ctrl-e
void aprinter(uint8_t * buf) {
//~ uint16_t length = sizeof(*buf) / sizeof(buf[0]);
//~
//~ printf("len: %d;\n", length);
//~
//~ uint16_t i;
//~ for (i = 0; i < length; i++) {
//~ printf("buf[%d]: 0x%02x;\n", i, buf[i]);
//~ }
}
I save the code in this state and later come back to uncomment the lines, ctrl-e again gives me this
void aprinter(uint8_t * buf) {
uint16_t length = sizeof(*buf) / sizeof(buf[0]);
//~ //~
printf("len: %d;\n", length);
//~ //~
uint16_t i;
for (i = 0; i < length; i++) {
printf("buf[%d]: 0x%02x;\n", i, buf[i]);
}
}
I'd really like to get Geany to use the same syntax as eclipse (prepend //
), since I flip back and forth between the two and have no way to uncomment blocks in one that were created by the other.
I'd be happy to just remove the trailing space however, to get rid of these bogus //~ //~
lines.
Another ugly feature of the geany code block comments is that if you have a block of commented code inside a larger block that you are now commenting out, it will uncomment the internal block.
I grep'd the configuration file paths (/usr/share/geany and ~/.config/geany) and didn't find //~
EDIT:
after all of that searching I just stumbled onto the 'comment toggle marker' option under
Edit -> Preferences -> Editor -> Features
I would still be interested in a way to have the comments added to the beginning of the line rather than at the indent level.
Best Answer
I'm trying to figure out where the comment block style is defined in Geany for C files.
...
Source Filetype definition files
I would still be interested in a way to have the comments added to the beginning of the line rather than at the indent level.
Use
comment_use_indent=false