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
a430563a
Commit
a430563a
authored
8 years ago
by
Marijn Haverbeke
Browse files
Options
Downloads
Patches
Plain Diff
Remove unneccesary local functions in moveOnce
parent
33577621
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
src/edit/methods.js
+12
-8
12 additions, 8 deletions
src/edit/methods.js
with
12 additions
and
8 deletions
src/edit/methods.js
+
12
−
8
View file @
a430563a
...
...
@@ -475,17 +475,21 @@ function findPosH(doc, pos, dir, unit, visually) {
return
lineObj
=
getLine
(
doc
,
l
)
}
function
moveOnce
(
boundToLine
)
{
let
myMoveVisually
=
(
line
,
start
,
dir
)
=>
moveVisually
(
doc
.
cm
,
line
,
start
,
dir
)
let
myMoveLogically
=
(
line
,
start
,
dir
)
=>
{
let
ch
=
moveLogically
(
line
,
start
,
dir
)
return
ch
==
null
?
null
:
new
Pos
(
pos
.
line
,
ch
,
dir
<
0
?
"
after
"
:
"
before
"
)
let
next
if
(
visually
)
{
next
=
moveVisually
(
doc
.
cm
,
lineObj
,
pos
,
dir
)
}
else
{
let
ch
=
moveLogically
(
lineObj
,
pos
,
dir
)
next
=
ch
==
null
?
null
:
new
Pos
(
pos
.
line
,
ch
,
dir
<
0
?
"
after
"
:
"
before
"
)
}
let
next
=
(
visually
?
myMoveVisually
:
myMoveLogically
)(
lineObj
,
pos
,
dir
)
if
(
next
==
null
)
{
if
(
!
boundToLine
&&
findNextLine
())
{
if
(
!
boundToLine
&&
findNextLine
())
pos
=
endOfLine
(
visually
,
doc
.
cm
,
lineObj
,
pos
.
line
,
dir
)
}
else
return
false
}
else
pos
=
next
else
return
false
}
else
{
pos
=
next
}
return
true
}
...
...
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