Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CodeMirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Moritz Aurel Pascal Schubotz
CodeMirror
Commits
15912c3f
Commit
15912c3f
authored
7 years ago
by
Adrian Heine
Committed by
Marijn Haverbeke
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[mode/simple addon] Improve fix for #4970, adapt docs.
parent
faadade2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addon/mode/simple.js
+1
-1
1 addition, 1 deletion
addon/mode/simple.js
demo/simplemode.html
+6
-7
6 additions, 7 deletions
demo/simplemode.html
with
7 additions
and
8 deletions
addon/mode/simple.js
+
1
−
1
View file @
15912c3f
...
...
@@ -136,7 +136,7 @@
state
.
indent
.
pop
();
var
token
=
rule
.
token
if
(
token
&&
token
.
apply
)
token
=
token
(
matches
)
if
(
matches
.
length
>
2
&&
typeof
rule
.
token
!=
"
string
"
)
{
if
(
matches
.
length
>
2
&&
rule
.
token
&&
typeof
rule
.
token
!=
"
string
"
)
{
state
.
pending
=
[];
for
(
var
j
=
2
;
j
<
matches
.
length
;
j
++
)
if
(
matches
[
j
])
...
...
This diff is collapsed.
Click to expand it.
demo/simplemode.html
+
6
−
7
View file @
15912c3f
...
...
@@ -65,15 +65,14 @@ highlighted by the mode shown in it).</p>
<dd>
The regular expression that matches the token. May be a string
or a regex object. When a regex, the
<code>
ignoreCase
</code>
flag
will be taken into account when matching the token. This regex
should only capture groups when the
<code>
token
</code>
property is
an array.
</dd>
has to capture groups when the
<code>
token
</code>
property is
an array. If it captures groups, it must capture
<em>
all
</em>
of the string
(since JS provides no way to find out where a group matched).
</dd>
<dt><code><strong>
token
</strong></code>
: string | array
<
string
>
| null
</dt>
<dd>
An optional token style. Multiple styles can be specified by
separating them with dots or spaces. When the
<code>
regex
</code>
for
this rule captures groups, it must capture
<em>
all
</em>
of the
string (since JS provides no way to find out where a group matched),
and this property must hold an array of token styles that has one
style for each matched group.
</dd>
separating them with dots or spaces. When this property holds an array of token styles,
the
<code>
regex
</code>
for this rule must capture a group for each array item.
</dd>
<dt><code><strong>
sol
</strong></code>
: boolean
</dt>
<dd>
When true, this token will only match at the start of the line.
(The
<code>
^
</code>
regexp marker doesn't work as you'd expect in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment