junegunn / goyo.vim

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

relative line numbers #21

Closed ghost closed 10 years ago

ghost commented 10 years ago

This plugin disables absolute line numbers by default, but leaves relative line numbers unchanged. In The spirit of the plugin would suggest disabling both of them together or none of them.

junegunn commented 10 years ago

The plugin does disable both number and relateivenumber as you can see in the following lines of code: https://github.com/junegunn/goyo.vim/blob/master/plugin/goyo.vim#L168-L171

Are you referring to something else?

ghost commented 10 years ago

No, that's it. It does not affect anything over here though.I thought it was because of the plugin

Plugin 'https://github.com/myusuf3/numbers.vim'

that disables the relative line numbering when leaving the window or losing focus. But even whithout it, relative and absolute line numbers are still there.

junegunn commented 10 years ago

Could you try :verbose set number? and :verbose set relativenumber? in Goyo window?

This is what I get:

:verbose set number?
nonumber
        Last set from ~/.vim/plugged/goyo.vim/plugin/goyo.vim

:verbose set relativenumber?
norelativenumber
        Last set from ~/.vim/plugged/goyo.vim/plugin/goyo.vim
ghost commented 10 years ago

I increased cmdheight, but they just return "number" respectively "relativenumber". Upon returning, outside of Goyo window, they return your text above.

junegunn commented 10 years ago

It's highly likely that it's the problem of other plugin or your configuration. Please try it again with a minimal config, without any other plugin but Goyo.

ghost commented 10 years ago

I disabled every plugin but Goyo and the problem persists. number and relativenumber are both set. :verbose set number? and :verbose set relativenumber? give the same output.

junegunn commented 10 years ago

That's strange. I've never experienced the problem in any platform and the code for unsetting nu/rnu in Goyo is so straightforward that it's hard to go wrong. Could you share your configuration file?

ghost commented 10 years ago

I am fine relativenumber and number even in Goyo mode though. I uploaded my config file at

https://github.com/EPNGH/vim-dotfiles/blob/master/_vimrc

junegunn commented 10 years ago

I tried with your configuration (some files are missing though), but worked fine. The best way to find out where the options are set is to use aforementioned :verbose command. Since you said that you're not seeing the output correctly. Try the following code to store the output in a variable:

:redir => output
:verbose set number?
:verbose set relativenumber?
:redir END

Then exit Goyo window, and echo output to see the result.