See: https://www.lua.org/pil/1.3.html You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2566
-- Commit Summary --
* filetypes.lua: Change block comment
-- File Changes --
M data/filedefs/filetypes.lua (2)
-- Patch Links --
https://github.com/geany/geany/pull/2566.patch https://github.com/geany/geany/pull/2566.diff
According to the link, end comment is `]]` not `]]--` so the original was wrong anyway. The modification is what is touted by the Lua manual as idiomatic usage rather than the actual end comment but its more correct than the original.
Will commit soon unless many Luaists object that it will break their existing files full of `]]--`.
`]]--` or `--]]` don't make sense, because: - `]]--`: comment will end with `]]` and `--` will be beginning of other (single) comment, in C/C++ it would be:: ```c /* Block comment */// Single comment ``` Such "coding style" looks like crap...
- `--]]`: comment will end with `]]` and `--` will be just a part of this block comment: maybe it looks more beautiful, I am not sure, but it doesn't make any practical sense.
Maybe just replace on correct option ```ini comment_close=]] ``` ?
@Skif-off the reference provided by the OP to the Lua manual explains the reasoning behind the `--]]` idiom.
This setting is only used by the comment functions to comment/uncomment code, which is exactly the situation the reference above talks about, its not used anywhere it is actually important that it be "right".
I would say that, since nobody else complained it can be merged, since your only reason seems to be you don't like the "style"?
PS Thanks for pinging, this had been forgotten.
Hm... in this case `--]]` looks more useful.
P.S. "Uncomment code" works strange with block comment.
P.S. "Uncomment code" works strange with block comment.
Hmm yeah, doesn't seem to work for any language (at least doesn't work for C AFAICT), so its separate issue, not Lua. Not really sure what it is supposed to do, but I suspect it favours single line comments if the setting exists, and sort of ignores multi line comments or just gets plain confused.
@codebrainz approved this pull request.
Works fine for me when commenting and uncommenting line(s), when I set `comment_single` to nothing.
Merged #2566 into master.
github-comments@lists.geany.org