Page 2 of 3

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Thu Apr 30, 2026 11:51 am
by ewild
DV
https://github.com/d0vgan/AkelPad-Smart ... _About.bas
Carlos Sánchez name on GitHub looks OK; however, locally, in the source code downloaded from GitHub via standard interface, the AkelPad-Smart-Math-feature-powerful-calculator.zip\AkelPad-Smart-Math-feature-powerful-calculator\SmartMath_About.bas file is being detected in ANSI encoding, and as a result, the name (namely, á letter) appears corrupted in that file, and consequently in the plugin's About dialog.
The same happens with the original AkelPad-Smart-Math-main.zip\AkelPad-Smart-Math-main\SmartMath_About.bas, and even with one in the released sources AkelPad-Smart-Math-1st_release.zip\AkelPad-Smart-Math-1st_release\SmartMath_About.bas, so the issue is rooted in here.
Meanwhile, the About dialog from their SmartMath release version looks OK, so, apparently, having Windows-1252 ANSI on their machine, they may never notice the issue as we can see it.
Locally, when I copy and paste "á" into SmartMath_About.bas and change its encoding to UTF-8 or Unicode (UTF-16 LE), that fixes the issue.
However, I'm not familiar with GitHub and have no idea how to make sure the SmartMath_About.bas file gets into the AkelPad-Smart-Math-feature-powerful-calculator.zip archive in a valid encoding, but definitely, something has to be done with that.
I don't know, maybe just resaving SmartMath_About.bas with "á" in correct encoding (at least UTF-8) on your machine would resolve the problem with that file in the sources?
Best regards.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Fri May 01, 2026 4:49 pm
by DV
All right, guys, exciting news.

1. The math parser (the heart of the plugin) is ready.

2. The corresponding documentation has been updated:
https://github.com/d0vgan/AkelPad-Smart ... _SYNTAX.md

3. The plugin's README has been updated:
https://github.com/d0vgan/AkelPad-Smart ... /README.md

4. The plugin's configuration is now stored either in Registry or in ini-file, depending on AkelPad's current setup.

5. SmartMath syntax theme is applied by means of "smartmath.coder":
https://github.com/d0vgan/AkelPad-Smart ... math.coder

6. The Unicode character in the About dialog has been corrected.

7. Now calculations are started and the syntax theme is applied only when the very first line contains `# SmartMath`or `# smartmath`.
You may not like this, so let's discuss.
Just one word to defend this behavior: when `SmartMath::ToggleSmartMath` is called in a document without this mark, it is automatically added.
And, well, actually one more word for this behavior :) If you have a document without this mark, the calculations are automatically started once you either copied or typed `#smartmath`.

Image

TODO:
Reduce the number of unnecessary GUI repaintings. (this must be done manually - AI fails to help here).

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Fri May 01, 2026 6:12 pm
by Diamen
feature/powerful-calculator
hang very often or enter key not work.
enter not work again not work after plugin disable.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Fri May 01, 2026 8:24 pm
by DV
Diamen wrote: Fri May 01, 2026 6:12 pm feature/powerful-calculator
hang very often or enter key not work.
enter not work again not work after plugin disable.
Please try the very latest updates.
Should be fixed now.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Fri May 01, 2026 8:39 pm
by DV
With the latest version, I've just tried a generic text file with a size of 12 MB and 42000 text lines.
SmartMath was thinking like 20 seconds and ended up with adding the "# SmartMart" mark and showing error messages on each line (because a generic text file obviously does not contain math expressions).
After that, I was able to scroll up and down with dealys around 5-10 seconds.
Which makes me think we probably need to add an option to specify maximum file size supported by SmartMath.

But what I want to highlight for this 12 MB file:
- the parsing speed looks good enough
- the syntax theme is applied
- no hanging
- no crash

Previously I was concentrated on the math parser itself (the internal component responsible for calculations).
Now I'm concentrating on the user interactions and different use cases.
Closer and closer to the final version that eventually can be merged into the main branch.
I've already checked that it works in Windows XP SP3 under VirtualBox, by the way :)

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Fri May 01, 2026 10:10 pm
by Diamen
Please try the very latest updates. Should be fixed now.
Tryed now but problem persist.
When I write the first number under # SmartMath it hang, if write a alphabetic character it write red error normally.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 8:53 am
by DV
Diamen wrote: Fri May 01, 2026 10:10 pm When I write the first number under # SmartMath it hang, if write a alphabetic character it write red error normally.
In AkelPad, please go to Options - Settings - Registry and set "Save settings" to "INI-file". Click OK, close AkelPad and the pack the entire content of the AkelPad folder into a zip-archive.
Alternatively, if you don't want to share the entire AkelPad folder, you may do the following:
1. create an empty folder,
2. copy AkelPad.exe there,
3. copy AkelFiles\Plugs\SmartMath.dll there,
4. start AkelPad,
5. go to Options - Settings - Registry and set "Save settings" to "INI-file",
6. click OK, close AkelPad,
7. restart AkelPad and try to reproduce the bug with SmartMath.
If it can be reproduced, it will be enough to pack the content of this folder into a zip-archive.
Then please upload this archive to any file uploading host that can be accessed from anywhere.

Also, what version of FreeBasic are you using to compile SmartMath?

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 10:06 am
by Diamen
FreeBasic 1.10.1
It not hang when save settings in registry.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 12:43 pm
by DV
Diamen wrote: Sat May 02, 2026 10:06 am FreeBasic 1.10.1
It not hang when save settings in registry.
Files to test.
Thank you for the information.
My implementation of loading and saving the configuaration values was buggy. That's why the results formatter received incorrect configuration.
Fixed in the last commit.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 12:46 pm
by Diamen
It not hang now.
ty.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 1:13 pm
by Diamen
10.5 * 7
result
7'3,5

10/3
result
3',33
[Options]
Decimals=2
Color=65535
ThousandsSeparator=1
LogParsedLines=0
DecimalSeparatorChar=.
ThousandsSeparatorChar='
ArrayOutputSeparatorChar=,
not problem with:
[Options]
Decimals=2
Color=65520
ThousandsSeparator=1
LogParsedLines=0
DecimalSeparatorChar=,
ThousandsSeparatorChar=.
ArrayOutputSeparatorChar=;

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 6:26 pm
by DV
Diamen wrote: Sat May 02, 2026 1:13 pm 10.5 * 7 -> 7'3,5
10/3 -> 3',33
This is an interesting problem caused by locale settings where ',' is used as a decimal separator on the OS level.
Fixed with the latest changes.
Covered with regression tests for both the results formatting and results copying by double-click.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 6:29 pm
by ewild
Diamen wrote: Sat May 02, 2026 1:13 pm ...

Code: Select all

[Options]
Decimals=2
Color=65535
...
not problem with:

Code: Select all

[Options]
Decimals=2
Color=65520
...
DV
So, the SmartMath.ini now has [Options] as its main section instead of [Settings], as I asked in this topic.
Then, it should be put that way in the documentation as well, where it is still named as [Settings]:
https://github.com/d0vgan/AkelPad-Smart ... ni-options

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 7:34 pm
by DV
ewild wrote: Sat May 02, 2026 6:29 pmSo, the SmartMath.ini now has [Options] as its main section instead of [Settings]
thanks, corrected.

Re: SmartMath Plugin - Real-time Calculations in AkelPad

Posted: Sat May 02, 2026 7:52 pm
by Diamen

Code: Select all

fbc -dll -gen gcc -arch x86_64 -x "SmartMath.dll" -strip -O 2 -Wc -Os "SmartMath.bas" "SmartMath_Config.bas" "SmartMath_Format.bas" "SmartMath_CopyNormalize.bas" "SmartMath_About.bas" "SmartMath_Menu.bas" "MathParser.bas"
to reduce dll size.