forked from CudaText-addons/cuda_hilite_occurrences
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opt.py
150 lines (143 loc) · 5.33 KB
/
opt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
from cudax_lib import get_translation
_ = get_translation(__file__) # I18N
MIN_LEN = 1
MAX_LINES = 3000
MAX_LINE_LEN = 800000
MAX_COLUMNS = 500
MAX_TIME = 40
AVG_LEN = 100
SEL_ALLOW = True # Highlight all occurrences of selected text.
SEL_ALLOW_WHITE_SPACE = False # Highlight spaces there located in begin or end of selection
SEL_CASE_SENSITIVE = False
SEL_WORDS_ONLY = False # Highlight character only if it contains in CHARS.
SEL_WHOLE_WORDS = False # Whole word only. Used only if bool(SEL_WORDS_ONLY) == True.
MARK_IGNORE_MIN_LEN = False
VISIBLE_FALLBACK = True
CARET_ALLOW = True # Highlight all occurrences of word under caret.
CARET_CASE_SENSITIVE = True
CARET_WHOLE_WORDS = True # Whole word only.
LEXERS_ALLOWED = ''
LEXERS_DISABLED = ''
THEME_CURRENT = ''
THEME_OTHER = ''
ALLOWED_ITEMS = ['IncludeBG1', 'IncludeBG2', 'IncludeBG3', 'IncludeBG4', 'SectionBG1', 'SectionBG2', 'SectionBG3', 'SectionBG4', 'BracketBG', 'CurBlockBG', 'LightBG1', 'LightBG2', 'LightBG3', 'LightBG4', 'LightBG5']
META_OPT = [
{ "opt": "min_len",
"cmt": [_("Minimal length of fragment to handle")],
"def": MIN_LEN,
"frm": "int",
"chp": ""
},
{ "opt": "max_lines",
"cmt": [_("Maximal number of lines in document, when plugin is still active")],
"def": MAX_LINES,
"frm": "int",
"chp": ""
},
{ "opt": "max_line_len",
"cmt": [_("Maximal length of lines, which will be handled by plugin (plugin will skip longer lines)")],
"def": MAX_LINE_LEN,
"frm": "int",
"chp": ""
},
{ "opt": "max_time",
"cmt": [_("Maximal time in milliseconds, to count chars in the document")],
"def": MAX_TIME,
"frm": "int",
"chp": ""
},
{ "opt": "avg_len",
"cmt": [_("Average length of line. If document has lot of longer lines, it will fallback to highlight only visible matches.")],
"def": AVG_LEN,
"frm": "int",
"chp": ""
},
{ "opt": "sel_allow",
"cmt": [_("Plugin handles current selection (on selection changing)")],
"def": SEL_ALLOW,
"frm": "bool",
"chp": ""
},
{ "opt": "sel_allow_spaces",
"cmt": [_("Use also whitespace in selection, otherwise trim it")],
"def": SEL_ALLOW_WHITE_SPACE,
"frm": "bool",
"chp": ""
},
{ "opt": "sel_case_sens",
"cmt": [_("Search for selection is case-sensitive")],
"def": SEL_CASE_SENSITIVE,
"frm": "bool",
"chp": ""
},
{ "opt": "sel_words_only",
"cmt": [_("Plugin handles selection only when it is whole word")],
"def": SEL_WORDS_ONLY,
"frm": "bool",
"chp": ""
},
{ "opt": "sel_whole_words",
"cmt": [_("Search for selection finds whole words only")],
"def": SEL_WHOLE_WORDS,
"frm": "bool",
"chp": ""
},
{ "opt": "mark_ignore_min_len",
"cmt": [_("Mark occurrences of selected text ignores 'min_len' option")],
"def": MARK_IGNORE_MIN_LEN,
"frm": "bool",
"chp": ""
},
{ "opt": "visible_fallback",
"cmt": [_("When text is over max_lines - fallback to highlighting only in visible text")],
"def": VISIBLE_FALLBACK,
"frm": "bool",
"chp": ""
},
{ "opt": "caret_allow",
"cmt": [_("Plugin handles word under caret (on caret moving)")],
"def": CARET_ALLOW,
"frm": "bool",
"chp": ""
},
{ "opt": "caret_case_sens",
"cmt": [_("Search for word under caret is case-sensitive")],
"def": CARET_CASE_SENSITIVE,
"frm": "bool",
"chp": ""
},
{ "opt": "caret_whole_words",
"cmt": [_("Search for word under caret finds whole words only")],
"def": CARET_WHOLE_WORDS,
"frm": "bool",
"chp": ""
},
{ "opt": "theme_item_current",
"cmt": [_("Element of syntax-theme, which color is used for word under caret")],
"def": "BracketBG",
"frm": "strs",
"lst": ALLOWED_ITEMS,
"chp": ""
},
{ "opt": "theme_item_other",
"cmt": [_("Element of syntax-theme, which color is used for other found matches")],
"def": "BracketBG",
"frm": "strs",
"lst": ALLOWED_ITEMS,
"chp": ""
},
{ "opt": "lexers_allowed",
"cmt": [_("If not empty, then plugin is active only for mentioned lexers. Comma-separated list."),
_("None-lexer must be written as '-'.")],
"def": LEXERS_ALLOWED,
"frm": "str",
"chp": ""
},
{ "opt": "lexers_disabled",
"cmt": [_("If not empty, then plugin is disabled for mentioned lexers. Comma-separated list."),
_("Has higher priority than option 'lexers_allowed'.")],
"def": LEXERS_DISABLED,
"frm": "str",
"chp": ""
},
]