Monday, October 13, 2014

Re: Building the quickfix window from VimL



On Fri, Oct 10, 2014 at 5:15 PM, LCD 47 <lcd047@gmail.com> wrote:
On 10 October 2014, David Fishburn <dfishburn.vim@gmail.com> wrote:
> 7.4.1-466 Windows 7 32 bit
>
> I have a plugin with formats some code.
>
> But in order to format it, it has to parse it.  During the parsing, it
> can report errors.
>
> I want to basically open the quickfix window and give the usual output
> you would usually supply with a :make.
>
> So I create a new buffer.
> :setlocal filetype=qf
[...]

    Don't do that.  Use the existing quickfix mechanisms, instead of
emulating their functionality in your plugin.

    If your plugin produces the errors as tuples of (file, line number,
column number, error text, ...) then build a quickfix list, call
setqflist() (see ":help setqflist()" for details), and you're done, you
can run :copen to open the error window.


Fantastic, 

That does exactly what I needed and was only a few lines of code compared to the path I started down.

Thanks,
David 

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment