Repository navigation
Add terminal handler for :Start actions - #250
Conversation
|
Since the job branch is not supported on NeoVim just yet, I thought I'd open this PR without support for NeoVim aswell. I've been using this without any real concerns for the past few weeks. |
|
Should this PR be pointing towards the |
b797c44 to
17bbf88
Compare
|
Hey @teoljungberg - I've been using your POC from #213 locally for a couple months and hacking on it intermittently. I think you can just use function! dispatch#terminal#activate(pid) abort
" ...
let swb = &l:switchbuf
try
let &l:switchbuf = 'useopen,usetab'
silent exec 'tab sbuffer' buf_id
finally
let &l:switchbuf = swb
endtry
" ...
endfunctionAlso, a small nit: One other thing I noticed: background invocation doesn't seem to work in this code. silent exec 'tab sbuffer ' . buf_id
if !a:request.background | wincmd p | endifThat seems to unconditionally drop the editor into a new tab, and if !a:request.background
silent exec 'tab sbuffer' buf_id
endif |
17bbf88 to
c8c6f3e
Compare
|
Hi @ejones Thanks for the comments, it would have been easier to address them inline - but I'll do my best to do so here.
That's a neat trick, I'm into it as it! I updated to use it in e3b372a. I also fixed the
The idea is to spawn a tab for But you are absolutely right about the behavior - it didn't work as expected. It seems like Thanks for testing, and the feedback! |
|
@teoljungberg no problem! Yeah that makes sense about creating an unfocused tab, didn't realize that at first. |
|
@teoljungberg |
|
Is there anything you want me to revise to get this ready to be merged after the job branch has been merged? I saw in #193 (comment) that the job support is getting near completion. I remember you commenting in a twitter thread that the use of the name for the tab would be fragile. Any feedback on having a better implementation in place would be greatly appreciated! |
7aeb97f to
3e50152
Compare
|
Actually, that raises the question of what happens when you have a title collision. If you do the same |
|
Good point! I So you're absolutely right it's a collision. Any ideas on how we can resolve it? Saving the buffer number somehow and then switching to that? |
|
I updated my implementation to save the id of the buffer in the request, but I get a feeling that it's tacking too much onto the request. Let me know what you think @tpope. |
|
Look into using |
|
I'm not sure what |
|
Do a |
|
Got it, I couldn't access the function from the current context so I copied it in. But Is this preferred over saving the buffer id either on the request, or as a buffer variable in the window and find it by that? |
|
Oh dang, a real catch 22. I'd say ditch |
|
I updated to use your suggested approach to find the buffer in 9274db2. |
|
Rebase this on |
8d6a90d to
ff1ea65
Compare
|
Rebased and ready for testing. |
|
Is there a better Vim built-in for switching out of the newly created terminal tab than |
You mean rather than the |
|
No I mean interactively. How the hell am I supposed to switch out of this terminal tab? |
|
I think this is just about ready. Add this snippet to the docs above "Windows" (same order as |
|
And lastly the documentation snippet was added in cc85c00 |
|
🎉 Once the dust has settled, I'm going to start ripping out low priority adapters like iTerm and X11, and see who complains. |
|
Have you noticed any rumblings around this @tpope ? Or should we start ripping out / disabling the low priority adapters? |
|
Not in a rush, but I guess we can go ahead with the first removal. |
This PR adds support for using vim's
:terminalfor:Startand:Spawnactions.Left to do: