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
bc0a644e
Commit
bc0a644e
authored
9 years ago
by
Marijn Haverbeke
Browse files
Options
Downloads
Patches
Plain Diff
[closetag addon] Don't include trailing > if it is already present
Closes #3409
parent
ea3277bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addon/edit/closetag.js
+6
-3
6 additions, 3 deletions
addon/edit/closetag.js
with
6 additions
and
3 deletions
addon/edit/closetag.js
+
6
−
3
View file @
bc0a644e
...
...
@@ -108,19 +108,22 @@
// when completing in JS/CSS snippet in htmlmixed mode. Does not
// work for other XML embedded languages (there is no general
// way to go from a mixed mode to its current XML state).
var
replacement
;
if
(
inner
.
mode
.
name
!=
"
xml
"
)
{
if
(
cm
.
getMode
().
name
==
"
htmlmixed
"
&&
inner
.
mode
.
name
==
"
javascript
"
)
replacement
s
[
i
]
=
head
+
"
script
>
"
;
replacement
=
head
+
"
script
"
;
else
if
(
cm
.
getMode
().
name
==
"
htmlmixed
"
&&
inner
.
mode
.
name
==
"
css
"
)
replacement
s
[
i
]
=
head
+
"
style
>
"
;
replacement
=
head
+
"
style
"
;
else
return
CodeMirror
.
Pass
;
}
else
{
if
(
!
state
.
context
||
!
state
.
context
.
tagName
||
closingTagExists
(
cm
,
state
.
context
.
tagName
,
pos
,
state
))
return
CodeMirror
.
Pass
;
replacement
s
[
i
]
=
head
+
state
.
context
.
tagName
+
"
>
"
;
replacement
=
head
+
state
.
context
.
tagName
;
}
if
(
cm
.
getLine
(
pos
.
line
).
charAt
(
tok
.
end
)
!=
"
>
"
)
replacement
+=
"
>
"
;
replacements
[
i
]
=
replacement
;
}
cm
.
replaceSelections
(
replacements
);
ranges
=
cm
.
listSelections
();
...
...
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