Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Denite extension not working #1874

Closed
petobens opened this issue Feb 10, 2019 · 7 comments
Closed

Denite extension not working #1874

petobens opened this issue Feb 10, 2019 · 7 comments

Comments

@petobens
Copy link
Contributor

I've recently noticed that the denite extension doesn't seem to work. With the following minimal vimrc:

set nocompatible

let $DOTVIM = expand('$HOME/.config/nvim')

set runtimepath+=$DOTVIM/bundle/repos/github.com/vim-airline/vim-airline
set runtimepath+=$DOTVIM/bundle/repos/github.com/Shougo/denite.nvim
filetype plugin indent on

If I run :Denite file I simply get:
screenshot_2019-02-10_12 22 44

However AirlineExtensions shows denite to be loaded. I'm not sure this is a problem with airline or with denite though (cc @Shougo).

For the record I'm using nvim v0.4.0-252-gb3ce0019a

@chrisbra
Copy link
Member

chrisbra commented Feb 10, 2019 via email

@petobens
Copy link
Contributor Author

Yep, that's the strange thing. I actually tried reverting a few commits on both Airline and Denite side but cannot seem to make it work again...

@Shougo
Copy link

Shougo commented Feb 11, 2019

@petobens You should use git bisect instead.

@Shougo
Copy link

Shougo commented Feb 11, 2019

I have reproduced, but I don't know vim-airline implementation.
statusline option seems reset to empty.

@Shougo
Copy link

Shougo commented Feb 11, 2019

I get the reason. denite extension is broken.
denite#get_status_mode() may return empty string.

diff --git a/autoload/airline/extensions/denite.vim b/autoload/airline/extensions/denite.vim
index e3c1f3b..b637439 100644
--- a/autoload/airline/extensions/denite.vim
+++ b/autoload/airline/extensions/denite.vim
@@ -15,7 +15,7 @@ function! airline#extensions#denite#check_denite_mode(bufnr)
     return ''
   endif
   let mode = split(denite#get_status_mode(), ' ')
-  let mode = tolower(mode[1])
+  let mode = tolower(get(mode, 1, ''))
   if !exists('b:denite_mode_cache') || mode != b:denite_mode_cache
     call airline#highlighter#highlight([mode], a:bufnr)
     let b:denite_mode_cache = mode

@petobens
Copy link
Contributor Author

@Shougo that works! Thank you :). Can you do a PR?

@Shougo
Copy link

Shougo commented Feb 11, 2019

You can send the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants