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

bug: popup displayed off-screen when editing long lines in diff mode #841

Closed
4 tasks done
dlyongemallo opened this issue Sep 6, 2024 · 2 comments
Closed
4 tasks done
Labels
bug Something isn't working stale

Comments

@dlyongemallo
Copy link

Did you check docs and existing issues?

  • I have read all the which-key.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of which-key.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.10.0

Operating system/version

Ubuntu 22.04

Describe the bug

When editing a file with a long line in diff mode, the popup goes off the left side of the screen if the buffer is scrolled to the right (i.e., if the cursor is at a horizontal position larger than the screen width).

Steps To Reproduce

  1. Diff a file (nvim -d) with a line longer than the width of the display and ":nowrap" (e.g., 120 characters on a 80 character display).
  2. Go to the end of the line (or any position past 80).
  3. Activate the WhichKey popup (press ', ", or run :WhichKey).

Expected Behavior

Expected: popup is shown visably at bottom of display (aligned with left of display)

Actual: popup is shown aligned with left of text, so that it is partially or completely off-screen (depending on cursor positon)

Health

which-key: require("which-key.health").check()

- OK Most of these checks are for informational purposes only.
  WARNINGS should be treated as a warning, and don't necessarily indicate a problem with your config.
  Please |DON't| report these warnings as an issue.

Checking your config ~
- WARNING |mini.icons| is not installed
- OK |nvim-web-devicons| is installed

Checking for issues with your mappings ~
- OK No issues reported

checking for overlapping keymaps ~
- WARNING In mode `n`, <m> overlaps with <m3>, <m2>, <m;>, <m1>, <m0>, <m{>, <m,>, <m}>, <m9>, <m8>, <m7>, <m6>, <m5>, <m:>, <m[>, <m]>, <m4>:
  
- WARNING In mode `n`, <dm> overlaps with <dm->, <dm2>, <dm8>, <dm9>, <dm0>, <dm<Space>>, <dm7>, <dm6>, <dm5>, <dm3>, <dm1>, <dm=>, <dm4>:
  
- WARNING In mode `n`, <gb> overlaps with <gbc>:
  - <gb>: Comment toggle blockwise
  - <gbc>: Comment toggle current block
- WARNING In mode `n`, <gc> overlaps with <gco>, <gcO>, <gcc>, <gcA>:
  - <gc>: Comment toggle linewise
  - <gco>: Comment insert below
  - <gcO>: Comment insert above
  - <gcc>: Comment toggle current line
  - <gcA>: Comment insert end of line
- WARNING In mode `n`, <\t> overlaps with <\ts>, <\to>, <\tM>, <\tm>, <\tO>:
  - <\ts>: Neotest summary
  - <\to>: Show test output
  - <\tM>: Test current method (DAP)
  - <\tm>: Test current method
  - <\tO>: Show test output panel
- WARNING In mode `x`, <\t> overlaps with <\ts>, <\to>, <\tM>, <\tm>, <\tO>:
  - <\ts>: Neotest summary
  - <\to>: Show test output
  - <\tM>: Test current method (DAP)
  - <\tm>: Test current method
  - <\tO>: Show test output panel
- WARNING In mode `s`, <\t> overlaps with <\ts>, <\to>, <\tM>, <\tm>, <\tO>:
  - <\ts>: Neotest summary
  - <\to>: Show test output
  - <\tM>: Test current method (DAP)
  - <\tm>: Test current method
  - <\tO>: Show test output panel
- OK Overlapping keymaps are only reported for informational purposes.
  This doesn't necessarily mean there is a problem with your config.

Checking for duplicate mappings ~
- OK No duplicate mappings found

Log

Debug Started for v3.13.2
new Mode(n:1)
Trigger(add) Mode(n:1) ' " ` g` g' z= ] [ \ < <C-F> <Space> <C-W> g z <Plug>
on_key: $
on_key: :
ModeChanged(n:c)
  new Mode(c:1)
  Safe(true)
Trigger(add) Mode(c:1) <C-R>
on_key: w
on_key: <S-BS>
on_key: W
on_key: h
on_key: i
BufNew(3)
on_key: c
on_key: h
on_key: K
on_key: e
on_key: <Tab>
on_key: <CR>
ModeChanged(c:n)
  Unsafe(command-mode)
  suspend: Mode(n:1)
  Trigger(del) Mode(n:1) ] [ \ < <C-F> <Space> <C-W> g z ' " ` g` g' z= <Plug>
State(start): Mode(n:0) Node() { delay = 0, keys = "", mode = "n", waited = 1000 }
  update Mode(n:1)
  continue:  Mode(n:1)
  getchar
  Trigger(add) Mode(n:1) ' " ` g` g' z= ] [ \ < <C-F> <Space> <C-W> g z <Plug>
  on_key: :
  got: :
  suspend: Mode(n:1)
  Trigger(del) Mode(n:1) ] [ \ < <C-F> <Space> <C-W> g z ' " ` g` g' z= <Plug>
  feedkeys: Mode(n:1) :
on_key: :
ModeChanged(n:c)
  Safe(true)
Trigger(add) Mode(n:1) ' " ` g` g' z= ] [ \ < <C-F> <Space> <C-W> g z <Plug>
on_key: q
on_key: a
on_key: <CR>
ModeChanged(c:n)
  Unsafe(command-mode)
  suspend: Mode(n:1)
  Trigger(del) Mode(n:1) ] [ \ < <C-F> <Space> <C-W> g z ' " ` g` g' z= <Plug>
Trigger(add) Mode(n:1) ' " ` g` g' z= ] [ \ < <C-F> <Space> <C-W> g z <Plug>

Repro

-- using https://github.com/junegunn/vim-plug
local vim = vim
local Plug = vim.fn['plug#']

vim.call('plug#begin')
Plug('folke/which-key.nvim', {['tag'] = 'v3.13.2'})
vim.call('plug#end')
@dlyongemallo dlyongemallo added the bug Something isn't working label Sep 6, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 7, 2024
Copy link
Contributor

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant