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

Keep alternative buffer when switching to __SQLResult__ (already implemented?) #36

Closed
borisbrodski opened this issue Apr 13, 2018 · 5 comments

Comments

@borisbrodski
Copy link

Please, keep altbuffer (Ctrl+6) when switching to __SQLResult__.

Since the __SQLResult__ always a bottom split buffer, pressing Ctrl+6 in the upper split buffer (SQL or text) should not show the same __SQLResult__ no more time.

Consider following workflow:

  • I have two SQL files: file1.sql and file2.sql, both connected to the database
  • I switch multiple times between file1.sql and file2.sql in the upper split with Ctrl+6
  • I run a query in file1.sql
  • Then go to __SQLResult__ with Ctrl+Wj to check the results
  • Then go back to file1.sql with Ctrl+Wk
  • Now, I would like to switch to file2.sql with Ctrl+6, but this brings __SQLResult__ in the upper split.

I looks, like it could be done using execute 'keepalt' a:cmd ... (Credit: tpope/vim-vinegar#25)

This would help a lot. Thank you!

@borisbrodski
Copy link
Author

Sorry, just retested it, and it somehow works!!
Did you by chance implemented it in the last update?

@borisbrodski borisbrodski changed the title Keep alternative buffer when switching to __SQLResult__ Keep alternative buffer when switching to __SQLResult__ (already implemented?) Apr 13, 2018
@cosminadrianpopescu
Copy link
Owner

no, i haven't done anything yet. i will look into it.

@cosminadrianpopescu
Copy link
Owner

cosminadrianpopescu commented Apr 18, 2018

To be sure I've implemented the keepalt when switching to the results buffer automatically from code. Please note that if you switch to the results buffer with <C-W>j, then of course you will not have a keepalt.

@borisbrodski
Copy link
Author

Thank you! How should I switch to the result buffer in order to preserve the alt-buffer?

@cosminadrianpopescu
Copy link
Owner

You have to make yourself a shortcut.

When you execute a query, there is an automatic switch to the results buffer and back. This is where I've added the keepalt. But when you switch by yourself (<C-W>j is a standard vim shortcut), then you need to do the keepalt your self.

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