rasulomaroff / reactive.nvim

Reactivity. Right in your neovim.
Apache License 2.0
183 stars 1 forks source link

operator pending "to" function inserts blank lines on ct_ (change to character) if that function includes a print statement #3

Closed hbak closed 7 months ago

hbak commented 7 months ago

was playing around with operator-pending mode to and from functions.

local reactive = require('reactive')
reactive.add_preset({
  name = 'presetone',
  modes = {
    no = {
      to = function()
        print('[reactive_config] operator pending to')
      end,

      from = function()
        print('[reactive_config] operator pending from')
      end
    }
  }
})
reactive.setup({})

with this basic test setup, doing "ct" or "cf" results in the insertion of 1 or more blank lines.

Thanks for making this plugin!

rasulomaroff commented 7 months ago

Hi there! Not really sure how this issue is referred to the plugin itself since it doesn't print anything in the console.

Maybe I got you wrong? Could you please clarify?

hbak commented 7 months ago

apologies, I just tested again on a minimal config and it wasn't happening -- the issue must be a collision with another plugin. What I was thinking was a bug was that with the above config, when I have a print statement inside of the "to" handler and do a "ct_", blank lines are inserted into the buffer.