Super-Calculator icon indicating copy to clipboard operation
Super-Calculator copied to clipboard

Implementing Keep Expressions Mode

Open renanpallin opened this issue 7 years ago • 5 comments

A way to keep expressions in the result.

Default behavior: expression: 5 + 5 result: 10 Keep Expressions behavior: expression: 5 + 5 result: 5 + 5 = 10

I was going to develop a little plugin that allow me to do calculations in my sublime and search for something already created. Found your plugin, so I made the modifications to my need and decided to make a pull request. None of the behavior has altered when the "keep_expressions" flag is set to false (I let false as default), so is a very flexible feature.

Found a issue opened by @maksimize, so I believe that may help others =) The issue: https://github.com/Pephers/Super-Calculator/issues/11

Also, I think would be nice to keep the name of contributors in the README, I believe we all gonna like =)

By the way, great job with that plugin, Renan

renanpallin avatar Jan 09 '18 19:01 renanpallin

This is a good feature addition. I believe = as separator is also configurable. @Pephers Can you pls merge this if no conflict.

cibinmathew avatar Nov 08 '18 08:11 cibinmathew

Hi! Any updates of this feature?

Any questions, I'm here to answer =)

renanpallin avatar Jun 10 '19 12:06 renanpallin

Hi guys!

Is this ready to merge?

renanpallin avatar Jul 25 '20 03:07 renanpallin

@renanpallin It doesn't work on my Sublime Build 4143 (python 3.3) when tested with forked branch https://github.com/renanpallin/Super-Calculator

It fails while loading at this line
https://github.com/Pephers/Super-Calculator/compare/master...renanpallin:Super-Calculator:master#diff-9041c6e5e00c7bcf0b4397ea09ba9000f4091ae3af4f87dca29fad8662201ecaR127

return f'{expr} {expression_separator} {result}'

As python f-strings are supported only from python 3.6 and my sublime seems using default python 3.3 version Hence I need to modify above code to simple string concatenation below , then it works as expected

return "%s %s %s" % (expr, expression_separator, result) May be its good to fix this as well in this pull-request to support any Sublime with any python version.

anudeepg avatar Mar 01 '23 14:03 anudeepg

@anudeepg Thanks for the heads up, but unfortunately I don't have hopes they will aprove this anymore

renanpallin avatar Mar 25 '24 02:03 renanpallin