tidalcycles / vim-tidal

Vim plugin for TidalCycles
MIT License
222 stars 56 forks source link

`g:tidal_paste_file` is ignored for neovim/vim8 (using builtin terminal) #92

Open cleary opened 8 months ago

cleary commented 8 months ago

I wanted to write my evals to a text file (using neovim), and found this handy feature had already been implemented... except it didn't work

Dug through the code, found it was implemented for tmux:

function! s:TmuxSend(config, text)
...
      call s:WritePasteFile(a:text)

But that is not called for neovim:

  function! s:TerminalSend(config, text)
    call s:TerminalOpen()
    if has('nvim')
      call jobsend(s:tidal_term_ghci, a:text . "\<CR>")
    elseif has('terminal')
      call term_sendkeys(s:tidal_term_ghci, a:text . "\<CR>")
    endif
  endfunction

Simply adding the line gets it working, but obviously that needs some var checking etc, so logging it as an issue rather than a pull request

  function! s:TerminalSend(config, text)
    call s:TerminalOpen()
    if has('nvim')
      call jobsend(s:tidal_term_ghci, a:text . "\<CR>")
+     call s:WritePasteFile(a:text)
    elseif has('terminal')
      call term_sendkeys(s:tidal_term_ghci, a:text . "\<CR>")
    endif
  endfunction