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

two splits on same file problem #24

Closed
will opened this issue Oct 29, 2015 · 10 comments
Closed

two splits on same file problem #24

will opened this issue Oct 29, 2015 · 10 comments
Assignees
Labels

Comments

@will
Copy link

will commented Oct 29, 2015

When I have my window split into two viewports on the same file, and then save in one viewport, the other viewport jumps to the beginning of the file, losing my place.

I think this is because of the auto formatting, but I'm not sure.

Please let me know if you need any more information.

@rhysd rhysd added the bug label Oct 31, 2015
@rhysd rhysd self-assigned this Oct 31, 2015
@rhysd
Copy link
Member

rhysd commented Oct 31, 2015

Thank you for the report. I could reproduce it.

  1. Open Vim with Crystal code
  2. Move to end with G.
  3. :vsplit
  4. :CrystalFormat

This is because vim-crystal replaces whole current buffer as below:

  1. Get whole current buffer
  2. Format by crystal tool format
  3. Remove entire current buffer
  4. Paste formatted code

I must preserve the cursor positions of all buffers.

@rhysd
Copy link
Member

rhysd commented Oct 31, 2015

@will

This issue is fixed at least in my environment.
Could you also check it?

@will
Copy link
Author

will commented Nov 1, 2015

Thanks for looking at this. I can't check for a day or so, but will as soon as I can.

@rhysd
Copy link
Member

rhysd commented Nov 1, 2015

It's OK when you have a time to check.

@will
Copy link
Author

will commented Nov 5, 2015

Sorry for taking so long, it's a little better thank you, but still the other pane moves on longer files

:e spec/pg/connection_spec.cr
:sp

move so top split starts at line 14, ends at 43, and cursor is on 40
move so bottom split start at line 75, ends at 104, and cursor on 105
:w on bottom split

bottom split stays put, but top split moves so is top at line 1 and bottom at line 30. When I move to the top split, the split moves so the cursor is still on line 40, by making the top line 11 and the bottom 40.

@rhysd
Copy link
Member

rhysd commented Nov 6, 2015

Ah, OK, I'll check it later. Thank you for the detail.

@rhysd
Copy link
Member

rhysd commented Nov 11, 2015

Sorry for making you wait. I tried. It seems that cursor position is preserved but the screen position is not...
I'll try to fix it.

@rhysd
Copy link
Member

rhysd commented Nov 11, 2015

@will

At aebaadb, I confirmed that screen position is also fixed. Could you check it?

@will
Copy link
Author

will commented Nov 11, 2015

Great! thank you!

@will will closed this as completed Nov 11, 2015
@rhysd
Copy link
Member

rhysd commented Nov 11, 2015

👍

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

2 participants