Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a0af313e
Commit
a0af313e
authored
Mar 29, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small cleanups in codemirror.
parent
0fad30e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
static/js/CodeMirror/codemirror.js
+4
-3
No files found.
static/js/CodeMirror/codemirror.js
View file @
a0af313e
...
...
@@ -617,6 +617,7 @@ var CodeMirror = (function() {
function
updateLines
(
from
,
to
,
newText
,
selFrom
,
selTo
)
{
if
(
suppressEdits
)
return
;
//This block ensures that widget lines don't have any text inserted on the same line.
if
(
from
.
ch
>
0
&&
(
newText
[
0
]
!=
''
||
newText
.
length
==
1
)
&&
getLine
(
from
.
line
).
widgetFunction
)
{
newText
.
unshift
(
''
);
var
widgetLine
=
getLine
(
from
.
line
);
...
...
@@ -980,7 +981,7 @@ var CodeMirror = (function() {
maxWidth
=
scroller
.
clientWidth
;
var
curNode
=
lineDiv
.
firstChild
,
heightChanged
=
false
;
doc
.
iter
(
showingFrom
,
showingTo
,
function
(
line
)
{
if
(
!
line
.
hidden
&&
!
line
.
widgetFunction
)
{
if
(
!
line
.
hidden
)
{
var
height
=
Math
.
round
(
curNode
.
offsetHeight
/
th
)
||
1
;
if
(
line
.
widgetFunction
)
height
=
line
.
widgetFunction
.
size
(
line
.
text
).
height
/
textHeight
();
if
(
line
.
height
!=
height
)
{
...
...
@@ -1053,7 +1054,6 @@ var CodeMirror = (function() {
// This pass fills in the lines that actually changed.
var
nextIntact
=
intact
.
shift
(),
curNode
=
lineDiv
.
firstChild
,
j
=
from
;
var
scratch
=
document
.
createElement
(
"div"
);
var
text_height
=
textHeight
();
//Remove this once heights are in pixels instead of lines
doc
.
iter
(
from
,
to
,
function
(
line
)
{
if
(
nextIntact
&&
nextIntact
.
to
==
j
)
nextIntact
=
intact
.
shift
();
if
(
!
nextIntact
||
nextIntact
.
from
>
j
)
{
...
...
@@ -2143,7 +2143,7 @@ var CodeMirror = (function() {
};
return
instance
;
};
// Utility functions for working with state. Exported because modes
// sometimes need to do this.
function
copyState
(
mode
,
state
)
{
...
...
@@ -2493,6 +2493,7 @@ var CodeMirror = (function() {
if
(
!
style
)
return
null
;
return
"cm-"
+
style
.
replace
(
/ +/g
,
" cm-"
);
}
if
(
!
allText
&&
endAt
==
null
)
span
(
" "
);
else
if
(
!
marked
||
!
marked
.
length
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment