junegunn / goyo.vim

:tulip: Distraction-free writing in Vim
MIT License
4.49k stars 115 forks source link

Conflict with BufAdd and BufNewFile autocommands in my .vimrc #261

Open Whyglobaleyes opened 2 years ago

Whyglobaleyes commented 2 years ago

Prior to submitting a new issue make sure to complete these steps:


There's a conflict between Goyo and the config line above (error msg below). Goyo works perfectly when I comment the line in my .vimrc .

I found that auto-command somewhere and it puts every new buffer into a new tab which I really like.

Can anyone suggest how to keep the new tab behaviour but avoid applying it to Goyo please - or something similar I was thinking of wrapping Goyo into a function that disables the new tab behaviour but I don't know how to do that. Thanks in advance for any help.


"[No Name]" --No lines in buffer--
Error detected while processing function goyo#execute[7]..<SNR>72_goyo_on:
line   87:
"[No Name]" --No lines in buffer--
line   88:
"[No Name]" --No lines in buffer--
line   89:
"[No Name]" --No lines in buffer--
line   90:
E121: Undefined variable: t:goyo_pads
Error detected while processing function goyo#execute[7]..<SNR>72_goyo_on[92]..<SNR>72_resize_pads:
line    5:
E121: Undefined variable: t:goyo_dim
E116: Invalid arguments for function s:const(t:goyo_dim.width, 2, &columns)
line    6:
E121: Undefined variable: t:goyo_dim
E116: Invalid arguments for function s:const(t:goyo_dim.height, 2, &lines)
line    8:
E121: Undefined variable: t:goyo_dim
E116: Invalid arguments for function max([0, (&lines - t:goyo_dim.height) / 2 - 1])
line    9:
E121: Undefined variable: t:goyo_dim
E116: Invalid arguments for function s:const(t:goyo_dim.yoff, - vmargin, vmargin)
line   10:
E121: Undefined variable: vmargin
line   11:
E121: Undefined variable: vmargin
line   12:
E121: Undefined variable: t:goyo_pads
E116: Invalid arguments for function <SNR>72_setup_pad
line   13:
E121: Undefined variable: t:goyo_pads
E116: Invalid arguments for function <SNR>72_setup_pad
line   16:
E121: Undefined variable: t:goyo_dim
line   17:
E121: Undefined variable: width
E116: Invalid arguments for function max([0, (&columns - width) / 2 - 1])
line   18:
E121: Undefined variable: t:goyo_dim
E116: Invalid arguments for function s:const(t:goyo_dim.xoff, - hmargin, hmargin)
line   19:
E121: Undefined variable: t:goyo_pads
E116: Invalid arguments for function <SNR>72_setup_pad
line   20:
E121: Undefined variable: t:goyo_pads
E116: Invalid arguments for function <SNR>72_setup_pad
Press ENTER or type command to continue