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

Fix for scrolloff vim setting #86

Open
froloffw7 opened this issue Oct 20, 2021 · 2 comments
Open

Fix for scrolloff vim setting #86

froloffw7 opened this issue Oct 20, 2021 · 2 comments

Comments

@froloffw7
Copy link

froloffw7 commented Oct 20, 2021

When scrolloff vim variable set, the cursor control codes 'H' and 'L' doesn't move cursor to the top and bottom lines of the screen. I suggest small minimap.py fix for this case

# Save scrolloff value and set it to 0
+ so = vim.eval("&scrolloff")
+ vim.command(":set scrolloff=0")
  vim.command("normal! H")
  topline = src.cursor[0]
  vim.command("normal! L")
  bottomline = src.cursor[0]

...

# Restore scrolloff
  src.cursor = cursor
+ vim.command(":set scrolloff=%s" % so)

@severin-lemaignan
Copy link
Owner

hi! thanks for the suggestion. Can you make a PR, please, and I'll merge it?

@froloffw7
Copy link
Author

froloffw7 commented Oct 22, 2021

This is the changed file.

minimap.py.gz

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

No branches or pull requests

2 participants