Fixes #2080 You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2082
-- Commit Summary --
* editor: Add auto-indent in mult-iline comments
-- File Changes --
M src/editor.c (127)
-- Patch Links --
https://github.com/geany/geany/pull/2082.patch https://github.com/geany/geany/pull/2082.diff
You have assumed that everyone wants this feature, but, given that you are the first to raise it AFAICT, and the first to contribute a patch (thanks) its likely that its not universally wanted. Therefore it should be protected by a setting.
Also it needs to be documented in the manual.
Therefore it should be protected by a setting.
I wonder how to add such a setting in the GUI without confusing the user. The problem is that this feature depends both on "Automatic continuation of multi-line comments" and "Auto-indent". I can think of two variants. The first one is a dependent checkbox in "Completions" tab. Something like:
![2019-02-07-114213_1600x900_scrot](https://user-images.githubusercontent.com/10910745/52402864-065e8c80-2ace-11...)
The second is an option in "Various settings", but that still needs a meaningful variable name.
The dependent checkbox method is used in other places in the Geany preferences and seems to me the best solution.
We don't want to add things to various unless they are really really rarely needed, since as you noted, the only information on them is the variable name.
I'm not sure it makes sense to add a general GUI setting for something so entirely language dependent. Ideally Geany itself wouldn't be doing anything language specific and it would be left to a plugin that provides language-specific features, like one of the formatting or addon plugins.
I think my pull request is an enhancement of the existing feature rather than an addition of a new one.
Automatic continuation is already a language-dependent feature, because not all languages have continuation characters in block comments (for example, Lua and `{}` comments in Pascal). I don't mind if it's moved it to a plugin, but that's out of the scope of this pull request.
@danpla @codebrainz totally agree with both of you, special comment handling is language specific and shouldn't be in Geany core, but it is, and has been for ages, so unless "somebody"[1] wants to make a pull request removing it to a plugin[2] then this is just a change to existing functionality.
And since its a change to existing functionality, which already has a setting in prefs, @danpla has just suggested adding a sub-setting to that existing setting. Although that prefs page is busy, there is space for another line (at least on my font size). So it seems a reasonable solution.
@danpla havn't actually looked at your code
[1] "somebody" in quotes is an olde time convention in Geany meaning "somebody, not necessarily you, but definitely won't be me", blame @eht16 :grin:
[2] an alternative would of course be to make the in-core functionality language agnostic by using the existing and perhaps additional comment settings in filetype files, but "somebody" has to do it
I added checkboxes both in global and project settings. Please test.
Closed #2082.
github-comments@lists.geany.org