Coder Social home page Coder Social logo

Comments (9)

skywind3000 avatar skywind3000 commented on May 18, 2024

I have trigger a :redrawstatus! after job finished, does this command has no effect on airline ?
how to trigger a airline redraw ??

from asyncrun.vim.

skywind3000 avatar skywind3000 commented on May 18, 2024

Found some information:
you should call ':AirlineRefresh' twice:

vim-airline/vim-airline#539

maybe you could add these line below to your .vimrc:

function! RefreshUI()
  if exists(':AirlineRefresh')
    AirlineRefresh
    AirlineRefresh
  else
    " Clear & redraw the screen, then redraw all statuslines.
    redraw!
    redrawstatus!
  endif
endfunction

let g:asyncrun_exit = 'call RefreshUI()'

from asyncrun.vim.

deathmaz avatar deathmaz commented on May 18, 2024

Thank's for quick response!
Tried RefreshUI() but the result is the same.
Are you sure that the problem is because airline didn't redraw?
As you may see here https://asciinema.org/a/a4ksqp8enp5tx29uyoczy7f7q when i'm running
:AsyncRun npm install non-existed-package in to bottom right corner the status changes to running and then success

from asyncrun.vim.

skywind3000 avatar skywind3000 commented on May 18, 2024

what is the value of g:asyncrun_code after finished ?

:echo g:asyncrun_code

from asyncrun.vim.

deathmaz avatar deathmaz commented on May 18, 2024

It returns 0

from asyncrun.vim.

skywind3000 avatar skywind3000 commented on May 18, 2024

I think I know what's wrong, you are using neovim.
and exit code in neovim has not been handled in the right way.

fixed.
please update

from asyncrun.vim.

deathmaz avatar deathmaz commented on May 18, 2024

It works!
Thank you very much for your effort 👍

from asyncrun.vim.

skywind3000 avatar skywind3000 commented on May 18, 2024

welcome, do my best to make it a better competitor to vim-dispatch now
could you please give me your airline config,
I am going to write a wiki page to guide people how to config airline to display asyncrun status

from asyncrun.vim.

deathmaz avatar deathmaz commented on May 18, 2024

Sure, this is the only line that i added to make the asyncrun status visible in airline

let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}'])

In this way it will be shown in the error section of ariline
Also i should mention that airline has multiple sections and i guess the status could be placed in any of them

Here an excerpt from airline's help page:

  variable names                default contents
  ----------------------------------------------------------------------------
  let g:airline_section_a       (mode, crypt, paste, spell, iminsert)
  let g:airline_section_b       (hunks, branch)
  let g:airline_section_c       (bufferline or filename)
  let g:airline_section_gutter  (readonly, csv)
  let g:airline_section_x       (tagbar, filetype, virtualenv)
  let g:airline_section_y       (fileencoding, fileformat)
  let g:airline_section_z       (percentage, line number, column number)
  let g:airline_section_error   (ycm_error_count, syntastic, eclim)
  let g:airline_section_warning (ycm_warning_count, whitespace)

  " here is an example of how you could replace the branch indicator with
  " the current working directory, followed by the filename.
  let g:airline_section_b = '%{getcwd()}'
  let g:airline_section_c = '%t'

from asyncrun.vim.

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.