Closed jam1015 closed 5 months ago
Hi @jam1015
Thanks for pitching in. I made a few recommendations.
I'm willing to merge this if you tell me that you're willing to support it (if-and-when bugs come in).
Let me know
Thank you so much for your feedback. I have made the changes you suggested. I also added some section breaks to the advanced configuration documentation. This made sense because I created the vim-style bindings section there to link to from the main README so it made sense to add other sections. I also added more clear language on the b:slime_cell_delimiter
variable. I commit to maintaining the features I add here and to fix bugs that arise. As I mentioned in the intro, I have another branch ready to PR if you accept this one.
It's looking good ^
I'll dust off neovim and do a test run tonight — then I'll merge this in.
It works as far as I can tell — but I don't use neovim/terminal often myself.
But I'm a bit baffled by how it works: (as a non-user)
I think that's how it worked before. Maybe terminal users don't run into this problem?
What about channels … how do they work? 🤔
Hi @jam1015, thanks for your great works, there is a polite reminder, the b:terminal_job_pid
is deprecated and will be removed in future. Should instead use jobpid()
as follow the official suggestion
Intro
I know that PRs are supposed to be monolithic. This PR is fairly monolithic as it has one major change to the actual plugin, and seveal minor changes.
They are (in rough order of importance)
README
neovim
targetREADME
, including changes to reflect the new features in point 1.end
withendif
in appropriate places.The Changes
Going point by point:
Improving Terminal Tracking
In the current release, the last open terminal is kept track of with
This works, but forgets about previously opened terminals if multiple are opened. This PR takes the approach:
Where
SlimeAddChannel
andSlimeClearChannel
respectively add or remove channels from a variable stored asg:slime_last_channel
Here are the those functions:
These functions use helper functions that should be self-explanatory.
get-filter-bufinfo
gets the info about all currently open buffers and filters to only include info on open terminal buffers.I update the
slime#targets#neovim#config()
function:Notable is that the user can now configure to input the terminal's PID rather than the Neovim internal job id. This change is documented in the Neovim target
README
.Adding Details on vim-style Mappings
When I was learning vim I was looking through and exploring all the different send-to-repl plugins. This one seemed great, but I wasn't a fan of the
CTRL-c
key chords. I chose vim because I like the operator-motion style of doinag things. So I tried other send-to-repl plugins before reading the documentation of this one in more depth to see that the vim-style mappings do exist, they're just not advertised in theREADME
.So I made these additions:
Vim-like mappings
To use vim-style mappings:
Of course these mappings are just examples; you can set them according to your preference.
Hopefully this will let new users see these features from the moment they discover this plugin.
Expanding
neovim
target documentationAdds documentation of option to use
pid
rather than neovim's internaljobid
.In addition to using
&channel
suggests that the user convigure their statusline to show the terminalpid
andjobid
.Using
endif
instead ofend
(i think)
end
works because it is a unique prefix ofendif
.endif
is preferred and is what is showed in the documentation. There are almost certainly more places in this plugin I could make this change but only did it in places where I'm interested.Closing Thoughts
I made these changes because I think that the
vim
andneovim
targets for this plugin deserve special consideration because the user always has them available, no matter the environment they are using vim/neovim in.I tested these changes on the current neovim release and the dev branch, v 10.0.0 using a minimal config. These tests are important because with Neovim 10.0.0 terminal buffers are automatically closed when the terminal closes
If you accept these changes, I have another PR ready to go that makes the user experience even better.