Skip to content
Snippets Groups Projects
Commit a430563a authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

Remove unneccesary local functions in moveOnce

parent 33577621
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment