wojciech-kulik / xcodebuild.nvim

Neovim plugin to Build, Debug, and Test applications created for Apple devices (iOS, macOS, watchOS, etc.)
MIT License
696 stars 18 forks source link

Buffer randomly jumping while the app is running #148

Closed Almaz5200 closed 5 months ago

Almaz5200 commented 5 months ago

It started happening recently, whenever I've got the app running, even without debugger attached, buffer starts randomly jumping whenever I scroll. I've made a video to demonstrate. Note, that I do not press any buttons other than j and k in this clip, it jumps on it's own

https://www.youtube.com/watch?v=I7m2ZcLON9c

wojciech-kulik commented 5 months ago

Does it happen only if the app is running? Probably it’s because of logs being printed. Can you check with opened dapui so that you see logs?

Almaz5200 commented 5 months ago

Yep, only if the app is running Seems like you're right. I can see logs, and those jumps happen at exactly the same time as the log prints. Do you think anything can be done about it? I don't thing this is specific to my setup since I've completely redone my Neovim config from scratch a few days ago and it's still here

wojciech-kulik commented 5 months ago

I will check this

wojciech-kulik commented 5 months ago

In the meantime, could you also try a different Neovim version? If you use 0.10 try with 0.9.5 or vice-versa

Almaz5200 commented 5 months ago

Ok, I'll check it out and get back to you Disabling console_logs helped, and I only use logs via tail in a separate tmux pane anyway :)

Almaz5200 commented 5 months ago

It doesn't happen on 0.9.5, so it looks like it has started after I've updated

wojciech-kulik commented 5 months ago

Most likely it's a bug in Neovim v0.10. They had many issues with the cursor. However, I will check it anyway, maybe I will find some workaround

wojciech-kulik commented 5 months ago

I investigated this issue and it turns out that the problem is with the latest nvim-dap-ui release. They autoscroll the buffer whenever lines are changed. But they call vim.cmd without checking if this buffer is actually active. Therefore the command is sent to the current window instead of dapui console window: https://github.com/rcarriga/nvim-dap-ui/blob/334cf3038c4756e6ab999cbac67c847fb654c190/lua/dapui/elements/console.lua#L38-L43

I created PR in nvim-dap-ui repository to fix that.

Temporary workaround would be to disable console logs or to redirect them somewhere else:

console_logs = {
  enabled = true,
  filter_line = function(line)
    -- redirect logs wherever you like
    print(line)
    return false
  end,
},
Almaz5200 commented 5 months ago

Got it, thank you for a quick investigation! Hope they will review it soon :)

wojciech-kulik commented 5 months ago

@Almaz5200 the PR is merged. Please update nvim-dap-ui to resolve this issue :)

Almaz5200 commented 5 months ago

Thank you!