Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matchup adding random characters on the beginning of the buffer. #325

Closed
zer09 opened this issue Oct 11, 2023 · 9 comments
Closed

Matchup adding random characters on the beginning of the buffer. #325

zer09 opened this issue Oct 11, 2023 · 9 comments
Labels

Comments

@zer09
Copy link

zer09 commented Oct 11, 2023

Explain the issue

When matchup_matchparen_offscreen method is set to popup, and you split the screen and go off screen and the paren matched, it will add some random character on the beginning of the file. Something like the image below.

Screenshot 2023-10-11 181323

  1. What vim version are you using?
NVIM v0.10.0-dev-1284+gf67517bba-dirty
Build type: Release
LuaJIT 2.1.1695653777
Run "nvim -V1 -v" for more info
With tree-sitter
  1. Steps to reproduce
    Open a file split the window, and scroll to the bottom until offscreen.
  2. Expected behavior
    It should not add random characters on the first line of the buffer.
  3. Observed behavior
    It add random characters on the first line of the buffer.

Minimal vimrc file

Please provide a minimal vimrc file that reproduces the issue. The
following should often suffice:

return {
	"andymass/vim-matchup",
	version = false,
	event = "VeryLazy",
	config = function()
		vim.g.matchup_matchparen_offscreen = {}
		vim.g.matchup_matchparen_deferred = 1
		vim.g.matchup_motion_override_Npercent = 0 -- enable vim default {count}%
	end,
}
@zer09 zer09 added the bug label Oct 11, 2023
@samtgarson
Copy link

I'm also getting this fairly frequently, and it's extremely frustrating 😅 it's a shame as the offscreen popup functionality is so useful most of the time.

It seems to be writing the contents of the bottom popup (including line number, sometimes repeated many times) to the top line of the file?

Screen Recording 2023-10-14 at 16 58 17

@kongjun18
Copy link

I also ran into this problem, but I couldn't reproduce it stably. I found that this BUG is caused by the text that should be written into the popup window being written into the buffer. The call chain is as follows.

Error detected while processing function <SNR>53_timer_callback[20]..7[153]..<SNR>53_do_offscreen[21]..<SNR>53_do_offscreen_popup_nvim[67]..<SNR>53_populate_floating_win[48]..<SNR>53_set_popup

I'm also getting this fairly frequently, and it's extremely frustrating 😅 it's a shame as the offscreen popup functionality is so useful most of the time.

It seems to be writing the contents of the bottom popup (including line number, sometimes repeated many times) to the top line of the file?

Screen Recording 2023-10-14 at 16 58 17 Screen Recording 2023-10-14 at 16 58 17

@sandeshghanta
Copy link

+1 to this issue, took a while to figure out which plugin was messing up my nvim buffers with same symptoms.

Currently have disabled plugin to bypass this issue.

@ray-x
Copy link

ray-x commented Nov 3, 2023

It took me a while to find out vim-matchup adding new line on top of my file. It exists in both neovim 0.9.x and 0.10. It might relate to cursor movement.

@andymass
Copy link
Owner

andymass commented Nov 3, 2023

Can anyone please provide a configuration and reproduction steps?

@ray-x
Copy link

ray-x commented Nov 3, 2023

I saw same behavior as @samtgarson. This may relate to relatively large lua file(>300 loc). But I couldn't reproduce it stably.
my setup

      vim.g.matchup_enabled = true
      vim.g.matchup_surround_enabled = true
      -- vim.g.matchup_transmute_enabled = 1
      vim.g.matchup_matchparen_deferred = true
      vim.g.matchup_matchparen_offscreen = { method = 'popup' }
      vim.cmd([[nnoremap <c-s-k> :<c-u>MatchupWhereAmI?<cr>]])

-- treesitter
    matchup = {
      enable = enable, -- mandatory, false will disable the whole extension
    },

@CMOISDEAD
Copy link

CMOISDEAD commented Dec 29, 2023

Actually I have the same problem, but it happens only if I have activated matchup_matchparen_offscreen method = popup and vim.g.matchup_matchparen_deferred = 1, it happens that if I move to the end of the file these numbers appear at the beginning of the file.
It is also necessary to have some kind of window split ie. Neotree open

@mehalter
Copy link
Contributor

mehalter commented Mar 1, 2024

I can also report that I'm still having this problem with both vim.g.matchup_matchparen_deferred = 1 and the offscreen method set to popup with a split open.

@mehalter
Copy link
Contributor

@andymass is there any way to get this issue re-opened since the problem still persists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants