Closed ivan-volnov closed 4 years ago
What do you mean by a toggle function?
I mean something like this:
if (IsHex("text under cursor")) {
Hex2dec();
else {
Dec2hex();
}
And then use just one key mapping.
Updated, please let me know if it's working for you.
Thank you!
Well, it works, but in a bit strange way.
Firstly it doesn't respect position of the cursor, so it applies to whole string. And it doesn't detect numbers well.
For example:
WHERE id = 3511
WHERE id = 0xDB7
WH14R14 i13 = 3511
WH14R14 i13 = 0xDB7
Every single line is result of every call of the toggle function.
Oh sorry, you're right. I removed a check for 0x
in good faith but it see that it backfired greatly.
I'll restore 0x requirement for hex number detection and will try to improve word detection in the following weeks.
Updated, please let me know if it's good enough. Anyway I think it'd be good to track the line replacements in a separate issue since this affects also the existing functions.
Much better, thank you!
It would be great to have a toggle function for the converter.