Comments (14)
@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.
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.
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.
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.
@w0rp Yeah, I'll check it when I will be at home.
from ale.
@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.
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.
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.
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.
Thanks! Sorry for bothering with not ale specific problems
from ale.
This could go in an FAQ. I'll probably put it in one eventually. Thanks for the info!
from ale.
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)
from ale.
Great, thank you!
from ale.
I just ran into something similar and this fixed it for me
from ale.
Related Issues (20)
- There is no fixer named `cpplint`. HOT 1
- Asymptote support
- Disable latex check in asy environments
- Omnicompletion triggers linting
- Use hamllint as a fixer
- Fixers + nvim + split windows causes jumps
- Multiple node processes with large RAM usage on opening file HOT 2
- Statusline info cache doesn't refresh correctly with integrating with third-party sources like coc.nvim HOT 1
- Support hurlfmt as fixer and linter
- Add support for include-what-you-use
- Add support for basedpyright
- rust ALEGoToDefinition does not trigger any action HOT 1
- ALE linting .tsx as .ts files when using Biome
- [Biome] Linter not usable
- Should/could ALE pass --no-fix argument to ruff when linting (to override project configuration)? HOT 5
- ALEHover text not appearing in floating preview HOT 1
- Cannot use ALE in MacVim when the file is opened via the right-click context menu or the File > Open dialog in MacVim HOT 1
- error loading shared lib: libicui18n.so.73 HOT 1
- json linting with jq doesn't report errors correctly
- On Windows 11, shell=pwsh/powershell continues breaking ALE lint HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ale.