cmp-calc icon indicating copy to clipboard operation
cmp-calc copied to clipboard

fix: unmatched parens backtracking + keep indent

Open litoj opened this issue 2 years ago • 1 comments

This PR provides better parsing, trying to backtrack to a state when all parenthesis were correctly matched if the first pass had been invalid. This helps in situations when there are calculations made outside a method or markdown numbered list:

4) 4+4 - now correctly parsed
4. 4+4 - already works
method(arg1, 4) 4+4 - now works, useful when calculating for myself on the same line

Also the expression is now being evaluated from the first non-space character, keeping original indent in tact.

litoj avatar Aug 18 '23 14:08 litoj

Is there something that could be improved upon to get this PR merged?

litoj avatar Aug 26 '23 17:08 litoj

Hi, I just wanted to give a heads up that I consider this PR finished, so I wanted to ask @hrsh7th if you would consider merging it.

litoj avatar Jan 21 '24 16:01 litoj

@hrsh7th ping

litoj avatar Apr 17 '24 12:04 litoj

thank you!

hrsh7th avatar May 18 '24 06:05 hrsh7th