HowMuch icon indicating copy to clipboard operation
HowMuch copied to clipboard

Decimals without zero don't work

Open eduardoarandah opened this issue 4 years ago • 7 comments

Command AutoCalcAppendWithEq doesnt work with:

.5 + .5

but work fine with

0.5 + 0.5

eduardoarandah avatar Sep 12 '19 22:09 eduardoarandah

cannot be reproduced.
visual selected .5 + .5 and press <leader>?=, the text turns into .5 + .5 = 1

sk1418 avatar Sep 13 '19 11:09 sk1418

for me doesn't work with any engine

 <Leader>v?
 <Leader>b?
 <Leader>p?

What can I do to debug?

VIM 8.1 windows 32bits with python, python3

eduardoarandah avatar Sep 13 '19 18:09 eduardoarandah

sorry it is hard for me to test under Windows system since I don't have one. I guess the .5 + .5 expression cannot be evaluated on your system. This express is valid for vim, that is, vim engine won't work. However it should go with bc and python. What you can try is, add some echo to see how it worked for bc engine: https://github.com/sk1418/HowMuch/blob/master/autoload/HowMuch.vim#L285 And do the same for py engine: https://github.com/sk1418/HowMuch/blob/master/autoload/HowMuch.vim#L301

If you confirmed it as a bug and can fix it, a pull request is highly welcomed.

open the howmuch.vim under

sk1418 avatar Sep 13 '19 20:09 sk1418

didn't work with python.

I put some echo expr but they don't show in command line. then put some echo "ok" and they show but quickly dissapear.

I'd like to help but I'm a newbie for vim script/debugging jeje

have any material on vim lang?

eduardoarandah avatar Sep 13 '19 22:09 eduardoarandah

didn't work with python.

I put some echo expr but they don't show in command line. then put some echo "ok" and they show but quickly dissapear.

I'd like to help but I'm a newbie for vim script/debugging jeje

have any material on vim lang?

:h echom

and

 :h a:var

sk1418 avatar Sep 13 '19 22:09 sk1418

Sorry, I have vim with python3 so python engine didn't detect it, so it wasn't a python error (same for bc) so this returned error (didn't see the message about not having python though)

  if !has('python')
    echoerr HowMuch#errMsg('vim was not compiled with +python!')
    return 'Err'
  endif

for vim engine, I get this

imagen

imagen

but this works:

imagen

imagen

If you don't get the same result, there's something strange with my vim version.

imagen

eduardoarandah avatar Sep 13 '19 22:09 eduardoarandah

What I wrote before:

This expression is valid for vim

In fact I meant "This expression is NOT valid for vim" or "invalid", sorry for the confusing.

sk1418 avatar Sep 13 '19 23:09 sk1418