parsonsmatt / intero-neovim

A neovim plugin for Intero, forked from ghcmod-vim
218 stars 28 forks source link

Don't set the buffer name #121

Open stellarhoof opened 6 years ago

stellarhoof commented 6 years ago

It makes it hard to detect the terminal. E.g. au BufEnter term:// .... It forces us to the workaround au BufEnter * if exists("b:term_title") .... Besides, it's useful to know which command was used to invoke the REPL. I had to look at the source for this.

rdnetto commented 6 years ago

The main reason we set the buffer name is for readability/aesthetics - if you're using a plugin which shows the name of each buffer, Intero is much more user friendly than term://.... Also, we definitely don't want any user configuration to depend on the exact command used, since we're likely to change that.

Would having the buffer ID be help achieve your goal? We already expose that in a global variable, so that might be a good starting point.

owickstrom commented 6 years ago

Regarding knowing the command that starts the REPL, I think the plugin deliberately hides that from the REPL buffer output. Could be printed instead?

stellarhoof commented 6 years ago

@rdnetto User-friendliness is subjective. For example I prefer explicitness. Seeing what kind of buffer its opening and what command was used is better than just seeing Intero. I can't think of any use cases where I would programmatically parse the command used out of the terminal title, but what I do need is to be able to match the buffer type for autocommands. I don't have any use for the buffer ID so far.

@owickstrom Better yet, provide an option to the user to hide it? I personally don't mind doing au User InteroStarted setlocal statusline=Intero, if InteroStarted was provided.

An autocommand would be ideal, but also notice you don't have to change the buffer name to change the statusline.