What is the best way to distinguish the current buffer is location list or quickfix list?

前端 未结 4 1920

I have an autocmd, if ft is qf, it is gonna call some functions to modify the quickfix list by get/setqflist()

I know there ar

4条回答
  •  甜味超标
    2021-01-02 05:38

    Just for new comers: as of now, there is getwininfo() which returns dicts containing key quickfix which can be used for the check. Also note the loclist key.

    Since getwininfo returns a list of dict, you may use:

    getwininfo(win_getid())[0]['quickfix']
    

    which is 1 when it is a quickfix or location list window. And

    getwininfo(win_getid())[0]['loclist']
    

    which is 1 only when it is a location list.

提交回复
热议问题