Closed IkaSek closed 6 months ago
now i'm no lua expert, but what i did here is
if tonumber(user_input) ~= nil and 0 <= tonumber(user_input) and tonumber(user_input) <= 9 or not tonumber(user_input) == nil then
local oldCount = self.count:get()
local newCount = tonumber(oldCount .. string.char(user_input))
self.count:set(newCount)
end
Can you share the mode which produced this error?
This looks like a regression. From what I can tell the problem occurs because of this.
getchar
will not always return a number (for example, pressing the left arrow key will return a string with the same value as "<Left>"
), so when you press any key that produces a string, it will be compared against a number and will error out.
I will try to submit a fix later today
Seems like it really is that easy: https://github.com/Iron-E/nvim-libmodal/pull/38 I tested it with my own plugin and it works perfectly again
This can be closed now I believe. Can you still produce the error on master @IkaSek?
let me be honest, i'm a noob. i don't understand the source code, is it something wrong i'm doing?