willothy / flatten.nvim

Open files and command output from wezterm, kitty, and neovim terminals in your current neovim instance
https://luarocks.org/modules/willothy/flatten.nvim
MIT License
473 stars 13 forks source link

feat: if a VimLeave autocmd is set then block #98

Open IndianBoy42 opened 3 months ago

IndianBoy42 commented 3 months ago

and apply that VimLeave autocmd to the nested nvim

IndianBoy42 commented 3 months ago

Context: fish's command to edit the current commandline in place adds an argument of the form +autocmd VimLeave * .... to write the cursor position to a file that fish can look at so it leaves the cursor at the same place when we return to the shell. First I saw this was causing errors because there were actually newlines in the middle which nvim_exec does not handle nicely. Its fairly well known that to have multiline commands in vimscript you need to precede the continuation lines with \, apparently not so when passing commands on the command line but anyway. After investigation I though it would be smart for flatten to assume this means the nested editor should block and add that autocmd to the nested session.

willothy commented 3 months ago

Hey, thanks for the PR! I am super busy right now so might not have a lot of time to review, but you've contributed before so I trust your judgement here.

Ping me when this is ready and I'll take a quick look and merge :)

IndianBoy42 commented 3 months ago

I'll do a bit more test driving and see if anything weird happens