Hello! prefix = true in config results in the following error:
Failed to run `config` for leap-spooky.nvim
vim/keymap.lua:39: lhs: expected string, got boolean
# stacktrace:
- vim/shared.lua:842 _in_ **validate**
- vim/keymap.lua:39 _in_ **set**
- /leap-spooky.nvim/lua/leap-spooky.lua:129 _in_ **setup**
Since 0ecd057 it appears that line the lhs assignment was being assigned to true if kwargs.prefix == true, due to the way the operands were distributed. This PR changes the lhs assignment to be closer to the previous expression. If this is correct and not an issue with my config, please make any preferred style changes. Thank you!
overview of changes
previous 808bd88
```lua
lhs = (kwargs.prefix and key .. textobj
or textobj:sub(1,1) .. key .. textobj:sub(2)),
```
current 0ecd057
```lua
lhs = (kwargs.prefix or not textobj:sub(1,1):match('[aiAI]')
and key .. textobj
or textobj:sub(1,1) .. key .. textobj:sub(2)),
```
proposed
```lua
lhs = (
(kwargs.prefix or not textobj:sub(1,1):match('[aiAI]'))
and key .. textobj
or textobj:sub(1,1) .. key .. textobj:sub(2)
),
```
Hello!
prefix = true
in config results in the following error:Since 0ecd057 it appears that line the lhs assignment was being assigned to
true
ifkwargs.prefix == true
, due to the way the operands were distributed. This PR changes the lhs assignment to be closer to the previous expression. If this is correct and not an issue with my config, please make any preferred style changes. Thank you!overview of changes
previous 808bd88 ```lua lhs = (kwargs.prefix and key .. textobj or textobj:sub(1,1) .. key .. textobj:sub(2)), ``` current 0ecd057 ```lua lhs = (kwargs.prefix or not textobj:sub(1,1):match('[aiAI]') and key .. textobj or textobj:sub(1,1) .. key .. textobj:sub(2)), ``` proposed ```lua lhs = ( (kwargs.prefix or not textobj:sub(1,1):match('[aiAI]')) and key .. textobj or textobj:sub(1,1) .. key .. textobj:sub(2) ), ```