rogual / neovim-dot-app

Mac OS X GUI for Neovim
1.13k stars 62 forks source link

Can not select text of output messages #237

Open ngortheone opened 8 years ago

ngortheone commented 8 years ago

Steps to reproduce

for example

:hi

A buffer with current color scheme will be shown. Try to copy something from it. Works in macvim but does not work here.

rogual commented 8 years ago

Duplicate of https://github.com/rogual/neovim-dot-app/issues/216. Leaving this open because OP of that issue was happy with a workaround & it was closed.

rogual commented 8 years ago

Copying my response here for quick reference:

Two ways of doing this:

(1) Get the change made in neovim itself, then no changes needed here.

(2) Add a separate kind of mouse selection to Neovim.app. When used, mouse commands are not sent to Neovim but processed directly in Neovim.app. Keep a record of which character cells are selected. Make the copy command behave differently when in this mode. This also requires keeping a buffer containing all the text currently on the screen, which we don't do right now.

rogual commented 8 years ago

Editing title for accuracy — the text in question is message text, not buffer text.

mikew commented 8 years ago

This is what I've been using, based on the referenced issue but gives a proper :OutputToTab command with tab completion.

function! OutputToTab(...)
  tabnew
  redir @a
  exec 'silent ' . join(a:000, ' ')
  redir END
  normal "apdd
endfunction

command! -nargs=+ -complete=command OutputToTab call OutputToTab(<f-args>)