Git Product home page Git Product logo

Comments (14)

KabbAmine avatar KabbAmine commented on May 22, 2024 3

@deathmaz Using airline helpers, it will look like:

call airline#parts#define_function('ALE', 'ALEGetStatusLine')
call airline#parts#define_condition('ALE', 'exists("*ALEGetStatusLine")')
let g:airline_section_error = airline#section#create_right(['ALE'])

@w0rp The code above should be included on the README (FAQ maybe?)

from ale.

KabbAmine avatar KabbAmine commented on May 22, 2024 2

If I remember well, there is a specific syntax for conditions in airline API, just check the doc.

There are plenty ways to solve your issue, choose the one you want:

  • Disable lazy loading for ale in plug config (By removing the for condition).
  • Create a function apart for airline:
function ALE() abort
    return exists('*ALEGetStatusLine') ? ALEGetStatusLine() : ''
endfunction
let g:airline_section_error = '%{ALE()}'
  • Use the airline's API (Check the doc).

from ale.

neersighted avatar neersighted commented on May 22, 2024 1

That would be my bug. I echoed where we need to return. The function was renamed to ale#statusline#Status() to facilitate autoloading, with the old name kept around for compatibilities sake. I have an open PR on the airline repo to add native ale support, which may interest you as well.

from ale.

w0rp avatar w0rp commented on May 22, 2024

I tried to repeat this myself with vim-airline, but I haven't had any luck so far. I did install airline for the first time in the process, which seems pretty cool.

@KabbAmine Do you want to have a look at this? I find the error there to be strange, as if something is deleting the function.

from ale.

KabbAmine avatar KabbAmine commented on May 22, 2024

@w0rp Yeah, I'll check it when I will be at home.

from ale.

KabbAmine avatar KabbAmine commented on May 22, 2024

@deathmaz Ok, tried with a minimal vimrc + ale + vim-airline and no issue so far.
Please do the same (Adapt the path):

vim -Nu <(cat << EOF
set rtp+=~/.vim/plugs/ale
set rtp+=~/.vim/plugs/vim-airline/
set rtp+=~/.vim/plugs/vim-airline-themes/

filetype plugin indent on
syntax enable

set laststatus=2
let g:airline_section_error = '%{ALEGetStatusLine()}'
EOF)

If the issue still occur, please provide a link to your configuration.

from ale.

deathmaz avatar deathmaz commented on May 22, 2024

I found the problem
The thing is that i'm usin vim-plug as my plugin manager and for ale i have these settings:
Plug 'w0rp/ale', { 'for': ['javascript', 'php', 'css', 'scss', 'sass'] }
So I enabled ale just for file types for which i have linters installed
Are those errors expected bahaviour if the plugin is disabled but i have this line in my config:
let g:airline_section_error = '%{ALEGetStatusLine()}' ?

from ale.

w0rp avatar w0rp commented on May 22, 2024

Ah, this is a configuration issue then. If you have only enabled ALE for those file types, the function won't exist for the other file types. You'll have to write an expression which checks if the function exists.

This might do the trick, but I haven't tested it:

let g:airline_section_error = '%{exists("ALEGetStatusLine") ? ALEGetStatusLine() : ""}'

from ale.

deathmaz avatar deathmaz commented on May 22, 2024

Thank you guys for helping me with this! 👍
@KabbAmine, this solution works great:

function ALE() abort
    return exists('*ALEGetStatusLine') ? ALEGetStatusLine() : ''
endfunction
let g:airline_section_error = '%{ALE()}'

from ale.

deathmaz avatar deathmaz commented on May 22, 2024

Thanks! Sorry for bothering with not ale specific problems

from ale.

w0rp avatar w0rp commented on May 22, 2024

This could go in an FAQ. I'll probably put it in one eventually. Thanks for the info!

from ale.

deathmaz avatar deathmaz commented on May 22, 2024

Hi guys, today at the work i updated ale and noticed that it stops to show errors in airline errors section
Currently i'm on my home laptop and i made a screenshot before ale update (left side) and after (right side, always shows 0)
_2016-10-11_21-55-11

from ale.

deathmaz avatar deathmaz commented on May 22, 2024

Great, thank you!

from ale.

robophil avatar robophil commented on May 22, 2024

I just ran into something similar and this fixed it for me

from ale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.