ledger / vim-ledger

Vim plugin for Ledger
GNU General Public License v2.0
372 stars 55 forks source link

Small improvements to the syntax highlighting: #63

Closed rohieb closed 6 years ago

rohieb commented 6 years ago

For the block comments, I've read section 14.2.1 of the documentation very carefully three times now and something like this should be counted as a comment:

comment
This is a comment.
It can span multiple lines.
end

However, in my case with ledger 3.1.2-20160801, if I actually put this snippet into my journal, this leads to all statements after that comment being ignored by ledger. I'm not sure if this is actually a bug in ledger, so if someone could shed light at this, I'd be happy to fix the highlighting if I understood the docs wrong.

kljohann commented 6 years ago

Very nice, thank you. Regarding the block comment syntax: If you look at http://ledger-cli.org/3.0/doc/ledger3.html#index-block-comments it says:

Block comments can be made by use comment ... end comment.

; This is a single line comment,
#  and this,
%   and this,
|    and this,
*     and this.

comment
    This is a block comment with
    multiple lines
end comment

So I guess every comment block has to end with end comment on a line by its own. I'm not sure what directive would be used to end test blocks, though. As they are not part of ledger files as produced by a typical user I think we could get away with not supporting those.

rohieb commented 6 years ago

Ah thanks for the hint. comment … end comment and test … end test work alike, I've included both of them now.

kljohann commented 6 years ago

Merged, thank you! :)