Closed christoph-heiss closed 3 years ago
I like it!
Just pushed a new spin of this PR, addressing all your suggestions.
This PR got definitely bigger than I expected!
Anyway, to properly support having the line comment prefix in the preferences, overridable by the user, I had to first move all our defaults from constant to a external yaml file. I've done that similiar to how src/input/key_map/
does it, I hope that is fine.
But I also like this solution way more than having a hashmap in-code.
[Closes #100]
Hi!
This implements the
buffer::toggle_line_comment
for normal and select_line mode. It either:I'm really used to that functionality to quickly comment in/out something, so I though I'd implement this. This works only for languages which have single-line comments. We could extend that to block comments, but I don't think that is much of a priority (at least for me).
I made a small gif on how this functionality looks.
~~How a comment starts is defined in a Hashmap, based on the syntax scope of the buffer. I already added quite a few languages, I tried to pick the most likely-to-be-used. We can extend that list easily in the future as needed. Question: Should there be a way for users to define their own entries in their preferences file? Could be useful I guess. 😅~~
Also, for now I assigned the command to [. I can of course happily change that if you want.