Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6784305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:58:28+00:00 2026-05-26T16:58:28+00:00

I found AsyncCommand on StackOverflow , and found it is a terrific tool! I

  • 0

I found AsyncCommand on StackOverflow, and found it is a terrific tool! I am trying to get it work with errormarker plugin, but encountered some problem.

i don’t know exactly what the problem is. I traced errormarker’s script, and found error use following script to hook QuickFixCmdPost to event, and set markers to lines of source files.

augroup errormarker
    autocmd QuickFixCmdPost make call <SID>SetErrorMarkers()
augroup END

According to the :help, the second argument(make) is the pattern of the file(for example: *.html). I don’t what is a make file pattern, I tried

autocmd QuickFixCmdPost AsyncMake call <SID>SetErrorMarkers()

It does not work(sure). But I don’t know what else I can do. I do googled “AsyncCommand errormarker” but get nothing.

Is there are any comment? Any suggestion is appreciated. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:58:29+00:00Added an answer on May 26, 2026 at 4:58 pm

    I found a solution.

    The solution works, but ugly.

    The key is to call errormarker‘s SetErrorMarkers() function at the right time automatically.

    I tried Peter Rincker’s solution, but it turns out the AsyncCommandQuickFixCmdPost fired too early. The quickfix list is not set yet. So SetErrorMarkers() does nothing.

    I read some AsyncCommand‘s manual and traced some code, the AsyncMake is actually a wrapper, which invoke

    asynccommand#run(cmd, handler)
    

    with

    asynccommand#run("make", asynchandler#qf)
    // where asynchandler#qf is the handler to read quick fix list back.
    

    So, since asynchandler#qf can be called at the right time, I traced the call point of the asynchandler#qf, and find the function asynccommand#done in file asynccommand.vim line 92 call the asynchandler#qf.

    function! asynccommand#done(temp_file_name)
      " Called on completion of the task
      let r = s:receivers[a:temp_file_name] "handlers are registered in s:receivers
      if type(r.dict) == type({})
        call call(r.func, [a:temp_file_name], r.dict)
      else
        call call(r.func, [a:temp_file_name])
      endif
      unlet s:receivers[a:temp_file_name]
      delete a:temp_file_name
    endfunction
    

    Got you!

    Let’s add some code at line 101 to invoke the SetErrorMarkers() function

      ...
      unlet s:receivers[a:temp_file_name]
      if exists("*ExposeSetErrorMarkers")
        call ExposeSetErrorMarkers()
      endif
      delete a:temp_file_name
      ...
    

    Notice the function we called here is ExposeSetErrorMarkers() not SetErrorMarkers(). Because the SetErrorMarkers() is a script local function, can not be called from outside of the script. so I add a delegate function ExposeSetErrorMarkers() in errormarker.vim to expose that function.

    function! ExposeSetErrorMarkers()
        call s:SetErrorMarkers()
    endfunction
    

    Moreover, I add some auto commands to my .vimrc

    au BufWritePost *cpp AsyncMake
    au BufWritePost *cc  AsyncMake
    au BufWritePost *h   AsyncMake
    

    to invoke AsyncMake automatically every time I save my source file.

    It works! Ugly, though 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Found some similar questions but no answers that work. Right now I am doing
I found this tutorial on using WIA in c++, but I don't understand how
Found this code that breaks out CSV fields if contains double-quotes But I don't
Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
I found What are mvp and mvc and what is the difference but it
Found a really nice code for Accordion nav and am trying implement on our
Found a bunch of other threads about comboboxes in WPF datagrid, but none that
Found more than 10 tutorials to cursors but I can't understand that. My question
Found this method of having DIV as custom google maps infoWindow. It works, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.