Open f1r35pirit opened 2 months ago
does this work correctly without stabs? this seems to be more an issue with vim's internal cindent. have you tried playing with cinoptions
?
What do you suggest I put in cinoptions
for "tabs for indentation, spaces for alignment" to work correctly in all cases on c and c++ files?
My mistake, I thought that stabs didn't override =
but now I see that it does end up calling StabsFixAlign()
on the range. I can reproduce your example and it does seem like it should fill with spaces (after the first tab used for alignment). It has the same issue with ordinary <CR>
after an unfinished comment, which also would end up calling the same function as =
.
Looking at the code, I noticed that the =
remap is only used for normal mode. Are you using visual mode to select the line range? In any case, even with =<motion>
(such as =_
to do the single line under the cursor), it still doesn't work right. The function sets big
based on the last character in the line, which probably doesn't make sense for comments.
I tried for a while to fix it, but ran out of time. I think it can be fixed, but would take longer than I have at the moment. I might get to it at some point if nobody beats me to it, but not for a while.
When I use stabs
=
hotkey on this (properly aligned) code:I get this (indentation instead of alignment):
Where
»›››
is visualization of a TAB symbol in my ViM.Also, when I push Enter at the end of an open comment block, I get this:
Where
_
is the cursor position. That is, the cursor is positioned one position to the right from the above asterisk, and the asterisk is not repeated. I would expect the asterisk to be repeated, and the cursor put two positions to the right from it.