I prefer line comments at their natural indentation level, and not at column 1 of the selected lines.
I could not find a solution for this in `Geany`.
Is this really the case, or there exists a clever workaround? I would greatly appreciate any advice.
I think you are looking for the option `comment_use_indent` in filetype configurations.
This is to be configured per filetype in the `settings` section. The filetype configurations can be edited via `Tools->Configuration Files->Filetype Configuration`.
See also https://geany.org/manual/#filetype-configuration.
Thank you very much for pointing me to the `comment_use_indent` option!
I tried it, and for simple line comments it works indeed. However, this behavior is not exactly what I am looking for. [ Also, I am somewhat surprised that this is a per filetype option. ]
A common use case is the following. A code block has several indented lines to be treated together, but not so many that block comments would be the way to go, and in such a case a block of line comments is also visually superior.
Now the problem occurs with one or more levels of indentation. Here is some example code by setting `comment_use_indent=true`.
This is what I would like to achieve: ``` uncommented code
# for i=1:n # if x[i]==value # hit = true # break # end # end ``` And this is what I get: ``` uncommented code
# for i=1:n # if x[i]==value # hit = true # break # end # end ```
- Would you be so kind to consider this as a feature request?
eht16 left a comment (geany/geany#4235)
The latter case can be achieved with `comment_use_indent=false`.
If you got it right, you want basically `comment_use_indent=true` for single comments and `comment_use_indent=false` for multi line comments?
I guess this can be implemented via a new filetype setting like "multiline_comment_use_indent=true" or something like this.
goszlanyi left a comment (geany/geany#4235)
No. Unfortunately, `comment_use_indent=false` provides this: ``` uncommented code uncommented code # for i=1:n # if x[i]==value # hit = true # break # end # end uncommented code uncommented code ``` i.e. part of the original indenting is lost.
I still would like to achieve this: ``` uncommented code uncommented code # for i=1:n # if x[i]==value # hit = true # break # end # end uncommented code uncommented code ``` So yes, what I am asking for is a new feature. A feature that is the default in several other editors.
github-comments@lists.geany.org