adigitoleo / vim-mellow-statusline

A simple ASCII statusline for (neo)vim, best served with the mellow colorscheme
BSD Zero Clause License
8 stars 0 forks source link

Faster refresh for selected components? #4

Closed adigitoleo closed 6 months ago

adigitoleo commented 3 years ago

Not sure if it is possible without way too much code. Since the fastest refresh is currently triggered by CursorHold, it is kind of slow... (default 'updatetime' is 4 seconds). Would need to check how lightline et al do this...

Somehow, diagnostic components seem to refresh faster. Need to figure out the call stack...

adigitoleo commented 3 years ago

Example use case: adding clock to the statusbar

let g:mellow_custom_parts = [
            \ [function('strftime', ['%H:%M']), '%2*', 1, 0],
            \]

Time only updates when leaving/entering the buffer, and maybe after a few other triggers? Could make it refresh every 'updatetime' by setting g:time and using that instead, and clearing the variable with a CursorHold autocommand. That's essentially how the mixed indent warning works right now.