You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time a tab event occurs on a line with an account, the monetary symbol appears at the end (in my case, it's the US dollar sign: "$"). By itself, it's nothing major, and can be convenient. However, when using Yasnippet, every line seems to act as if the tab is pressed. For the main line (with the transaction name and date), this does not seem to be a problem.
Additionally, every account line will cause the monetary symbol to swap (the symbol is added to lines that don't have it, and removed from lines that do have it). Again, no big deal, in the snippet, I just place the symbol on those lines that I do not want the symbol to appear, and all is fine.
However, the problem happens when I have a line that, in the yasnippet, ends with a placeholder and a monetary symbol. When the symbol is removed, it is replaced with nothing, and Yasnippet complains because it can't find the placeholder anymore, because the search regex ends with [:space:], and that space was removed.
I'm thinking that it might be helpful to, when removing a monetary symbol using a tab event, at least put a space in its place, to ensure such regular expressions don't fail.
The text was updated successfully, but these errors were encountered:
I think it might be useful to add a configuration option to toggle the monetary symbol's tab swap, and then make the following lines optional:
(defun hledger-indent-account-line ()
"Called when the line to indent is an account listing line."
(cond
((hledger-acc-line-has-rupeep) (hledger-delete-rupee-sign)) ; Make optional
((hledger-expecting-rupeep) (hledger-insert-rupee)) ; Make optional
(t (indent-line-to tab-width))))
Every time a tab event occurs on a line with an account, the monetary symbol appears at the end (in my case, it's the US dollar sign: "$"). By itself, it's nothing major, and can be convenient. However, when using Yasnippet, every line seems to act as if the tab is pressed. For the main line (with the transaction name and date), this does not seem to be a problem.
Additionally, every account line will cause the monetary symbol to swap (the symbol is added to lines that don't have it, and removed from lines that do have it). Again, no big deal, in the snippet, I just place the symbol on those lines that I do not want the symbol to appear, and all is fine.
However, the problem happens when I have a line that, in the yasnippet, ends with a placeholder and a monetary symbol. When the symbol is removed, it is replaced with nothing, and Yasnippet complains because it can't find the placeholder anymore, because the search regex ends with [:space:], and that space was removed.
I'm thinking that it might be helpful to, when removing a monetary symbol using a tab event, at least put a space in its place, to ensure such regular expressions don't fail.
The text was updated successfully, but these errors were encountered: