~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to src/nvim/buffer_defs.h

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20160418214219-1e6d4o1fwqarzk46
Tags: 0.1.3-1
* New upstream release.  (Closes: #820562)
* debian/control:
  + Remove unnecessary luarocks Build-Depends
  + Add libkvm-dev Build-Depends for kfreebsd-*
  + Add python(3)-neovim to Recommends.  (Closes: #812737)
  + Declare compiance with policy 3.9.8, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include "nvim/profile.h"
29
29
// for String
30
30
#include "nvim/api/private/defs.h"
 
31
// for Map(K, V)
 
32
#include "nvim/map.h"
31
33
 
32
34
#define MODIFIABLE(buf) (!buf->terminal && buf->b_p_ma)
33
35
 
59
61
#define VALID_BOTLINE_AP 0x40   /* w_botine is approximated */
60
62
#define VALID_TOPLINE   0x80    /* w_topline is valid (for cursor position) */
61
63
 
62
 
/* flags for b_flags */
63
 
#define BF_RECOVERED    0x01    /* buffer has been recovered */
64
 
#define BF_CHECK_RO     0x02    /* need to check readonly when loading file
65
 
                                   into buffer (set by ":e", may be reset by
66
 
                                   ":buf" */
67
 
#define BF_NEVERLOADED  0x04    /* file has never been loaded into buffer,
68
 
                                   many variables still need to be set */
69
 
#define BF_NOTEDITED    0x08    /* Set when file name is changed after
70
 
                                   starting to edit, reset when file is
71
 
                                   written out. */
72
 
#define BF_NEW          0x10    /* file didn't exist when editing started */
73
 
#define BF_NEW_W        0x20    /* Warned for BF_NEW and file created */
74
 
#define BF_READERR      0x40    /* got errors while reading the file */
75
 
#define BF_DUMMY        0x80    /* dummy buffer, only used internally */
76
 
#define BF_PRESERVED    0x100   /* ":preserve" was used */
 
64
// flags for b_flags
 
65
#define BF_RECOVERED    0x01    // buffer has been recovered
 
66
#define BF_CHECK_RO     0x02    // need to check readonly when loading file
 
67
                                // into buffer (set by ":e", may be reset by
 
68
                                // ":buf")
 
69
#define BF_NEVERLOADED  0x04    // file has never been loaded into buffer,
 
70
                                // many variables still need to be set
 
71
#define BF_NOTEDITED    0x08    // Set when file name is changed after
 
72
                                // starting to edit, reset when file is
 
73
                                // written out.
 
74
#define BF_NEW          0x10    // file didn't exist when editing started
 
75
#define BF_NEW_W        0x20    // Warned for BF_NEW and file created
 
76
#define BF_READERR      0x40    // got errors while reading the file
 
77
#define BF_DUMMY        0x80    // dummy buffer, only used internally
 
78
#define BF_PRESERVED    0x100   // ":preserve" was used
77
79
 
78
80
/* Mask to check for flags that prevent normal writing */
79
81
#define BF_WRITE_MASK   (BF_NOTEDITED + BF_NEW + BF_READERR)
101
103
// for signlist_T
102
104
#include "nvim/sign_defs.h"
103
105
 
 
106
// for bufhl_*_T
 
107
#include "nvim/bufhl_defs.h"
 
108
 
 
109
typedef Map(linenr_T, bufhl_vec_T) bufhl_info_T;
 
110
 
104
111
// for FileID
105
112
#include "nvim/os/fs_defs.h"
106
113
 
526
533
 
527
534
  /*
528
535
   * Character table, only used in charset.c for 'iskeyword'
529
 
   * 32 bytes of 8 bits: 1 bit per character 0-255.
 
536
   * bitset with 4*64=256 bits: 1 bit per character 0-255.
530
537
   */
531
 
  char_u b_chartab[32];
 
538
  uint64_t b_chartab[4];
532
539
 
533
540
  /* Table used for mappings local to a buffer. */
534
541
  mapblock_T  *(b_maphash[256]);
592
599
 
593
600
  int b_p_scriptID[BV_COUNT];           /* SIDs for buffer-local options */
594
601
 
595
 
  int b_p_ai;                   /* 'autoindent' */
596
 
  int b_p_ai_nopaste;           /* b_p_ai saved for paste mode */
597
 
  char_u      *b_p_bkc;         ///< 'backupcopy'
598
 
  unsigned int b_bkc_flags;     ///< flags for 'backupcopy'
599
 
  int b_p_ci;                   /* 'copyindent' */
600
 
  int b_p_bin;                  /* 'binary' */
601
 
  int b_p_bomb;                 /* 'bomb' */
602
 
  char_u      *b_p_bh;          /* 'bufhidden' */
603
 
  char_u      *b_p_bt;          /* 'buftype' */
604
 
  int b_p_bl;                   /* 'buflisted' */
605
 
  int b_p_cin;                  /* 'cindent' */
606
 
  char_u      *b_p_cino;        /* 'cinoptions' */
607
 
  char_u      *b_p_cink;        /* 'cinkeys' */
608
 
  char_u      *b_p_cinw;        /* 'cinwords' */
609
 
  char_u      *b_p_com;         /* 'comments' */
610
 
  char_u      *b_p_cms;         /* 'commentstring' */
611
 
  char_u      *b_p_cpt;         /* 'complete' */
612
 
  char_u      *b_p_cfu;         /* 'completefunc' */
613
 
  char_u      *b_p_ofu;         /* 'omnifunc' */
614
 
  int b_p_eol;                  /* 'endofline' */
615
 
  int b_p_fixeol;               /* 'fixendofline' */
616
 
  int b_p_et;                   /* 'expandtab' */
617
 
  int b_p_et_nobin;             /* b_p_et saved for binary mode */
618
 
  char_u      *b_p_fenc;        /* 'fileencoding' */
619
 
  char_u      *b_p_ff;          /* 'fileformat' */
620
 
  char_u      *b_p_ft;          /* 'filetype' */
621
 
  char_u      *b_p_fo;          /* 'formatoptions' */
622
 
  char_u      *b_p_flp;         /* 'formatlistpat' */
623
 
  int b_p_inf;                  /* 'infercase' */
624
 
  char_u      *b_p_isk;         /* 'iskeyword' */
625
 
  char_u      *b_p_def;         /* 'define' local value */
626
 
  char_u      *b_p_inc;         /* 'include' */
627
 
  char_u      *b_p_inex;        /* 'includeexpr' */
628
 
  uint32_t b_p_inex_flags;      /* flags for 'includeexpr' */
629
 
  char_u      *b_p_inde;        /* 'indentexpr' */
630
 
  uint32_t b_p_inde_flags;        /* flags for 'indentexpr' */
631
 
  char_u      *b_p_indk;        /* 'indentkeys' */
632
 
  char_u      *b_p_fex;         /* 'formatexpr' */
633
 
  uint32_t b_p_fex_flags;       /* flags for 'formatexpr' */
634
 
  char_u      *b_p_kp;          /* 'keywordprg' */
635
 
  int b_p_lisp;                 /* 'lisp' */
636
 
  char_u      *b_p_mps;         /* 'matchpairs' */
637
 
  int b_p_ml;                   /* 'modeline' */
638
 
  int b_p_ml_nobin;             /* b_p_ml saved for binary mode */
639
 
  int b_p_ma;                   /* 'modifiable' */
640
 
  char_u      *b_p_nf;          /* 'nrformats' */
641
 
  int b_p_pi;                   /* 'preserveindent' */
642
 
  char_u      *b_p_qe;          /* 'quoteescape' */
643
 
  int b_p_ro;                   /* 'readonly' */
644
 
  long b_p_sw;                  /* 'shiftwidth' */
645
 
  int b_p_si;                   /* 'smartindent' */
646
 
  long b_p_sts;                 /* 'softtabstop' */
647
 
  long b_p_sts_nopaste;         /* b_p_sts saved for paste mode */
648
 
  char_u      *b_p_sua;         /* 'suffixesadd' */
649
 
  bool b_p_swf;                 /* 'swapfile' */
650
 
  long b_p_smc;                 /* 'synmaxcol' */
651
 
  char_u      *b_p_syn;         /* 'syntax' */
652
 
  long b_p_ts;                  /* 'tabstop' */
653
 
  long b_p_tw;                  /* 'textwidth' */
654
 
  long b_p_tw_nobin;            /* b_p_tw saved for binary mode */
655
 
  long b_p_tw_nopaste;          /* b_p_tw saved for paste mode */
656
 
  long b_p_wm;                  /* 'wrapmargin' */
657
 
  long b_p_wm_nobin;            /* b_p_wm saved for binary mode */
658
 
  long b_p_wm_nopaste;          /* b_p_wm saved for paste mode */
659
 
  char_u      *b_p_keymap;      /* 'keymap' */
 
602
  int b_p_ai;                   ///< 'autoindent'
 
603
  int b_p_ai_nopaste;           ///< b_p_ai saved for paste mode
 
604
  char_u *b_p_bkc;              ///< 'backupco
 
605
  unsigned int b_bkc_flags;     ///< flags for 'backupco
 
606
  int b_p_ci;                   ///< 'copyindent'
 
607
  int b_p_bin;                  ///< 'binary'
 
608
  int b_p_bomb;                 ///< 'bomb'
 
609
  char_u *b_p_bh;               ///< 'bufhidden'
 
610
  char_u *b_p_bt;               ///< 'buftype'
 
611
  int b_p_bl;                   ///< 'buflisted'
 
612
  int b_p_cin;                  ///< 'cindent'
 
613
  char_u *b_p_cino;             ///< 'cinoptions'
 
614
  char_u *b_p_cink;             ///< 'cinkeys'
 
615
  char_u *b_p_cinw;             ///< 'cinwords'
 
616
  char_u *b_p_com;              ///< 'comments'
 
617
  char_u *b_p_cms;              ///< 'commentstring'
 
618
  char_u *b_p_cpt;              ///< 'complete'
 
619
  char_u *b_p_cfu;              ///< 'completefunc'
 
620
  char_u *b_p_ofu;              ///< 'omnifunc'
 
621
  int b_p_eol;                  ///< 'endofline'
 
622
  int b_p_fixeol;               ///< 'fixendofline'
 
623
  int b_p_et;                   ///< 'expandtab'
 
624
  int b_p_et_nobin;             ///< b_p_et saved for binary mode
 
625
  int b_p_et_nopaste;           ///< b_p_et saved for paste mode
 
626
  char_u *b_p_fenc;             ///< 'fileencoding'
 
627
  char_u *b_p_ff;               ///< 'fileformat'
 
628
  char_u *b_p_ft;               ///< 'filetype'
 
629
  char_u *b_p_fo;               ///< 'formatoptions'
 
630
  char_u *b_p_flp;              ///< 'formatlistpat'
 
631
  int b_p_inf;                  ///< 'infercase'
 
632
  char_u *b_p_isk;              ///< 'iskeyword'
 
633
  char_u *b_p_def;              ///< 'define' local value
 
634
  char_u *b_p_inc;              ///< 'include'
 
635
  char_u *b_p_inex;             ///< 'includeexpr'
 
636
  uint32_t b_p_inex_flags;      ///< flags for 'includeexpr'
 
637
  char_u *b_p_inde;             ///< 'indentexpr'
 
638
  uint32_t b_p_inde_flags;      ///< flags for 'indentexpr'
 
639
  char_u *b_p_indk;             ///< 'indentkeys'
 
640
  char_u *b_p_fex;              ///< 'formatexpr'
 
641
  uint32_t b_p_fex_flags;       ///< flags for 'formatexpr'
 
642
  char_u *b_p_kp;               ///< 'keywordprg'
 
643
  int b_p_lisp;                 ///< 'lisp'
 
644
  char_u *b_p_mps;              ///< 'matchpairs'
 
645
  int b_p_ml;                   ///< 'modeline'
 
646
  int b_p_ml_nobin;             ///< b_p_ml saved for binary mode
 
647
  int b_p_ma;                   ///< 'modifiable'
 
648
  char_u *b_p_nf;               ///< 'nrformats'
 
649
  int b_p_pi;                   ///< 'preserveindent'
 
650
  char_u *b_p_qe;               ///< 'quoteescape'
 
651
  int b_p_ro;                   ///< 'readonly'
 
652
  long b_p_sw;                  ///< 'shiftwidth'
 
653
  int b_p_si;                   ///< 'smartindent'
 
654
  long b_p_sts;                 ///< 'softtabstop'
 
655
  long b_p_sts_nopaste;         ///< b_p_sts saved for paste mode
 
656
  char_u *b_p_sua;              ///< 'suffixesadd'
 
657
  bool b_p_swf;                 ///< 'swapfile'
 
658
  long b_p_smc;                 ///< 'synmaxcol'
 
659
  char_u *b_p_syn;              ///< 'syntax'
 
660
  long b_p_ts;                  ///< 'tabstop'
 
661
  long b_p_tw;                  ///< 'textwidth'
 
662
  long b_p_tw_nobin;            ///< b_p_tw saved for binary mode
 
663
  long b_p_tw_nopaste;          ///< b_p_tw saved for paste mode
 
664
  long b_p_wm;                  ///< 'wrapmargin'
 
665
  long b_p_wm_nobin;            ///< b_p_wm saved for binary mode
 
666
  long b_p_wm_nopaste;          ///< b_p_wm saved for paste mode
 
667
  char_u *b_p_keymap;           ///< 'keymap'
660
668
 
661
669
  /* local values for options which are normally global */
662
670
  char_u      *b_p_gp;          /* 'grepprg' local value */
753
761
  dict_T *additional_data;      // Additional data from shada file if any.
754
762
 
755
763
  int b_mapped_ctrl_c;          // modes where CTRL-C is mapped
 
764
 
 
765
  bufhl_info_T *b_bufhl_info;   // buffer stored highlights
756
766
};
757
767
 
758
768
/*
904
914
typedef struct matchitem matchitem_T;
905
915
struct matchitem {
906
916
  matchitem_T *next;
907
 
  int id;                   /* match ID */
908
 
  int priority;             /* match priority */
909
 
  char_u      *pattern;     /* pattern to highlight */
910
 
  int hlg_id;               /* highlight group ID */
911
 
  regmmatch_T match;        /* regexp program for pattern */
912
 
  posmatch_T pos;           // position matches
913
 
  match_T hl;               /* struct for doing the actual highlighting */
 
917
  int id;                   ///< match ID
 
918
  int priority;             ///< match priority
 
919
  char_u *pattern;          ///< pattern to highlight
 
920
  int hlg_id;               ///< highlight group ID
 
921
  regmmatch_T match;        ///< regexp program for pattern
 
922
  posmatch_T pos;           ///< position matches
 
923
  match_T hl;               ///< struct for doing the actual highlighting
 
924
  int conceal_char;         ///< cchar for Conceal highlighting
914
925
};
915
926
 
916
927
/*