Giter Site home page Giter Site logo

Comments (5)

ReneFroger avatar ReneFroger commented on June 30, 2024

Why would you do that? Splitting windows are usually used for viewing different buffers, not same buffer.

from golden-ratio.

skeate avatar skeate commented on June 30, 2024

The only purpose for the gif is to demonstrate what I'm talking about. It happens also with different buffers.

from golden-ratio.

idbrii avatar idbrii commented on June 30, 2024

I think what you're describing is:

A is visible.
Position cursor on z.
Window switch.
Golden ratio autocmd resizes windows to make first window smaller. Since doing so makes z not visible so view shifts to make z (previous cursor position) visible.
You want A to remain visible. Is that right?

If you disable golden ratio, do the same thing, but use a 10 wincmd + to increase size of second window, what happens?

from golden-ratio.

skeate avatar skeate commented on June 30, 2024

Golden ratio autocmd resizes windows to make first window smaller. Since doing so makes z not visible so view shifts to make z (previous cursor position) visible.
You want A to remain visible. Is that right?

No. z should remain visible in this case; the problem is the switch back.

Apparently my gif is actually just confusing things, rather than helping to make it clear. 😢

  1. Open two windows, the left of which has a long-ish line. Specifically, long enough that with golden-ratio, the shrunken size is longer than the window is wide, but short enough that the expanded size can fit the whole thing.
  2. Go to the end of that long line (should still see beginning of line in window)
  3. Switch to right window. The left window shrinks, cutting off the first part of the line.
  4. Switch to the left window. The text doesn't move; you can't see the beginning of the line, even though there's room for it.

All this said, I've had the autocmd in my vimrc since originally posting the issue, and I actually forgot this was ever a problem. Haven't run into any issues with it.

from golden-ratio.

idbrii avatar idbrii commented on June 30, 2024

I think this is native vim behavior.

If you turn off golden-ratio and use vert resize 30 before switching windows, the beginning of the line will no longer be visible (even with sidescrolloff=0). If you do use vert resize 30 after switching windows, the beginning of the line will be visible until you switch to that window (then vim will adjust the window to show your cursor).

And (what I think is your actual problem), using vert resize 80 after switching to the small window doesn't make the beginning of the line visible even though there's room for it.

Since it's an enhancment and not a bug and it's not pressing for you, I'm closing. Thanks for following up!

from golden-ratio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.