-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variables are not saved #49
Comments
forgot to mention: rofi-calc 1.7 and rofi 1.5.4 |
The thing is that every single line is its own qalc call and it doesn't have any context. In fact it might lead to some unexpected behavior if we kept variables around. One might then expect all calls in the history to be available in the context but again I think that might lead to odd results. Honestly not sure what the best course of action is here. This wasn't really intended for multi line math stuff. I suppose you could use ; to put multiple assignments or statements on the same line beside one another to get access to multiple variables but it's probably not as tidy. |
I'm curious what you have in mind
Does rofi-calc call the executable qalc ? I thought it used libqalculate.so... In this case I understand it's hard to keep state. |
Well, let's say at some point in your history you defined
Yeah, it just calls out to qalc. I'm not opposed to this idea of context but we have to be smarter about it. If you have any proposal I'm all ears. |
What I had in mind is a middle ground: variables are kept until we quit rofi But I'm not sure it's worth the hassle. |
Might be cool and somewhat convenient I suppose. I'd make it an option in rofi-calc and have it on by default. Would you like to take a stab at implementing this? |
Not really, sorry. |
Would this be easier to implement if variables were simply stored in the history and this persistent variable behavior was tied to having persistent history disabled (the setting that clears the history when rofi is closed)? This would allow for users that required persistent variables to make use of it and would stop it from getting cluttered later down the line, but it does restrict the use case slightly by making all calculations conform to the same temporary history rules. I'm not sure how much easier this would be to implement than simply creating the functionality separately but thought it could be worth mentioning. |
Steps to reproduce:
foo := 1
then enter then empty the prompt and typefoo + 1
Expected result
2
Actual result
error foo is not a valid variable/unit/... (translated from my locale)
Notes
Works in qalculate-gtk
I understand that persistence across rofi-calc runs may be hard, but I would expect variable to stay as long as I don't close rofi-calc.
The text was updated successfully, but these errors were encountered: