Data Structures | Macros | Typedefs | Enumerations | Functions
quickfix.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <string.h>
#include "nvim/vim.h"
#include "nvim/ascii.h"
#include "nvim/quickfix.h"
#include "nvim/buffer.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/mark.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/message.h"
#include "nvim/misc1.h"
#include "nvim/memory.h"
#include "nvim/move.h"
#include "nvim/normal.h"
#include "nvim/option.h"
#include "nvim/os_unix.h"
#include "nvim/path.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/strings.h"
#include "nvim/ui.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
#include "nvim/os/input.h"
#include "nvim/api/private/helpers.h"

Data Structures

struct  dir_stack_T
 
struct  qfline_S
 
struct  qf_list_S
 
struct  qf_info_S
 
struct  efm_S
 
struct  qfstate_T
 
struct  qffields_T
 
struct  fmtpattern
 

Macros

#define LISTCOUNT   10
 
#define FMT_PATTERNS   10 /* maximum number of % recognized */
 
#define IS_QF_WINDOW(wp)   (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL)
 
#define IS_LL_WINDOW(wp)   (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL)
 
#define GET_LOC_LIST(wp)   (IS_LL_WINDOW(wp) ? wp->w_llist_ref : wp->w_llist)
 

Typedefs

typedef struct qfline_S qfline_T
 
typedef struct qf_list_S qf_list_T
 
typedef struct efm_S efm_T
 

Enumerations

enum  {
  QF_FAIL = 0, QF_OK = 1, QF_END_OF_INPUT = 2, QF_NOMEM = 3,
  QF_IGNORE_LINE = 4
}
 
enum  {
  QF_GETLIST_NONE = 0x0, QF_GETLIST_TITLE = 0x1, QF_GETLIST_ITEMS = 0x2, QF_GETLIST_NR = 0x4,
  QF_GETLIST_WINID = 0x8, QF_GETLIST_CONTEXT = 0x10, QF_GETLIST_ID = 0x20, QF_GETLIST_ALL = 0xFF
}
 Flags used by getqflist()/getloclist() to determine which fields to return. More...
 

Functions

int qf_init (win_T *wp, char_u *efile, char_u *errorformat, int newlist, char_u *qf_title, char_u *enc)
 
void qf_free_all (win_T *wp)
 
void copy_loclist (win_T *from, win_T *to)
 
void qf_jump (qf_info_T *qi, int dir, int errornr, int forceit)
 
void qf_list (exarg_T *eap)
 
void qf_age (exarg_T *eap)
 
void qf_history (exarg_T *eap)
 
bool qf_mark_adjust (win_T *wp, linenr_T line1, linenr_T line2, long amount, long amount_after)
 
void ex_cwindow (exarg_T *eap)
 
void ex_cclose (exarg_T *eap)
 
void ex_copen (exarg_T *eap)
 
void ex_cbottom (exarg_T *eap)
 
linenr_T qf_current_entry (win_T *wp)
 
int bt_quickfix (const buf_T *const buf)
 
int bt_nofile (buf_T *buf)
 
int bt_dontwrite (buf_T *buf)
 
int bt_dontwrite_msg (buf_T *buf)
 
int buf_hide (buf_T *buf)
 
int grep_internal (cmdidx_T cmdidx)
 
void ex_make (exarg_T *eap)
 
size_t qf_get_size (exarg_T *eap) FUNC_ATTR_NONNULL_ALL
 Returns the number of valid entries in the current quickfix/location list. More...
 
size_t qf_get_cur_idx (exarg_T *eap) FUNC_ATTR_NONNULL_ALL
 
int qf_get_cur_valid_idx (exarg_T *eap) FUNC_ATTR_NONNULL_ALL
 
void ex_cc (exarg_T *eap)
 
void ex_cnext (exarg_T *eap)
 
void ex_cfile (exarg_T *eap)
 
void ex_vimgrep (exarg_T *eap)
 
int get_errorlist (const qf_info_T *qi_arg, win_T *wp, int qf_idx, list_T *list)
 
int get_errorlist_properties (win_T *wp, dict_T *what, dict_T *retdict)
 
int set_errorlist (win_T *wp, list_T *list, int action, char_u *title, dict_T *what)
 
bool set_ref_in_quickfix (int copyID)
 
void ex_cbuffer (exarg_T *eap)
 
void ex_cexpr (exarg_T *eap)
 
void ex_helpgrep (exarg_T *eap)
 

Macro Definition Documentation

#define FMT_PATTERNS   10 /* maximum number of % recognized */
#define GET_LOC_LIST (   wp)    (IS_LL_WINDOW(wp) ? wp->w_llist_ref : wp->w_llist)
#define IS_LL_WINDOW (   wp)    (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL)
#define IS_QF_WINDOW (   wp)    (bt_quickfix(wp->w_buffer) && wp->w_llist_ref == NULL)
#define LISTCOUNT   10

Typedef Documentation

typedef struct efm_S efm_T
typedef struct qf_list_S qf_list_T

Quickfix/Location list definition

Usually the list contains one or more entries. But an empty list can be created using setqflist()/setloclist() with a title and/or user context information and entries can be added later using setqflist()/setloclist().

typedef struct qfline_S qfline_T

Enumeration Type Documentation

anonymous enum
Enumerator
QF_FAIL 
QF_OK 
QF_END_OF_INPUT 
QF_NOMEM 
QF_IGNORE_LINE 
anonymous enum

Flags used by getqflist()/getloclist() to determine which fields to return.

Enumerator
QF_GETLIST_NONE 
QF_GETLIST_TITLE 
QF_GETLIST_ITEMS 
QF_GETLIST_NR 
QF_GETLIST_WINID 
QF_GETLIST_CONTEXT 
QF_GETLIST_ID 
QF_GETLIST_ALL 

Function Documentation

int bt_dontwrite ( buf_T buf)
int bt_dontwrite_msg ( buf_T buf)
int bt_nofile ( buf_T buf)
int bt_quickfix ( const buf_T *const  buf)
int buf_hide ( buf_T buf)
void copy_loclist ( win_T from,
win_T to 
)
void ex_cbottom ( exarg_T eap)
void ex_cbuffer ( exarg_T eap)
void ex_cc ( exarg_T eap)
void ex_cclose ( exarg_T eap)
void ex_cexpr ( exarg_T eap)
void ex_cfile ( exarg_T eap)
void ex_cnext ( exarg_T eap)
void ex_copen ( exarg_T eap)
void ex_cwindow ( exarg_T eap)
void ex_helpgrep ( exarg_T eap)
void ex_make ( exarg_T eap)
void ex_vimgrep ( exarg_T eap)
int get_errorlist ( const qf_info_T qi_arg,
win_T wp,
int  qf_idx,
list_T list 
)

Add each quickfix error to list "list" as a dictionary. If qf_idx is -1, use the current list. Otherwise, use the specified list.

int get_errorlist_properties ( win_T wp,
dict_T what,
dict_T retdict 
)

Return quickfix/location list details (title) as a dictionary. 'what' contains the details to return. If 'list_idx' is -1, then current list is used. Otherwise the specified list is used.

int grep_internal ( cmdidx_T  cmdidx)
void qf_age ( exarg_T eap)
linenr_T qf_current_entry ( win_T wp)
void qf_free_all ( win_T wp)
size_t qf_get_cur_idx ( exarg_T eap)

Returns the current index of the quickfix/location list. Returns 0 if there is an error.

int qf_get_cur_valid_idx ( exarg_T eap)

Returns the current index in the quickfix/location list, counting only valid entries. Returns 1 if there are no valid entries.

size_t qf_get_size ( exarg_T eap)

Returns the number of valid entries in the current quickfix/location list.

void qf_history ( exarg_T eap)
int qf_init ( win_T wp,
char_u efile,
char_u errorformat,
int  newlist,
char_u qf_title,
char_u enc 
)

Read the errorfile "efile" into memory, line by line, building the error list. Set the error list's title to qf_title.

wp If non-NULL, make a location list efile If non-NULL, errorfile to parse errorformat 'errorformat' string used to parse the error lines newlist If true, create a new error list qf_title If non-NULL, title of the error list enc If non-NULL, encoding used to parse errors

Returns
-1 for error, number of errors for success.
void qf_jump ( qf_info_T qi,
int  dir,
int  errornr,
int  forceit 
)
void qf_list ( exarg_T eap)
bool qf_mark_adjust ( win_T wp,
linenr_T  line1,
linenr_T  line2,
long  amount,
long  amount_after 
)
int set_errorlist ( win_T wp,
list_T list,
int  action,
char_u title,
dict_T what 
)
bool set_ref_in_quickfix ( int  copyID)

Mark the context of the quickfix list and the location lists (if present) as "in use". So that garabage collection doesn't free the context.