From 3e32d5bf7e1cf83585cfba7184d45aa1b607210b Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 26 Jan 2015 18:38:51 +0400 Subject: [PATCH] workaround for vim cursor getting stuck on folded lines --- lib/ace/keyboard/vim.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ace/keyboard/vim.js b/lib/ace/keyboard/vim.js index 7312821f..0641897f 100644 --- a/lib/ace/keyboard/vim.js +++ b/lib/ace/keyboard/vim.js @@ -2396,6 +2396,15 @@ dom.importCssString(".normal-mode .ace_cursor{\ (line > last && cur.line == last)) { return; } + // /ace patch + var fold = cm.ace.session.getFoldAt(line, endCh); + if (fold) { + if (motionArgs.forward) + line = fold.end.row + 1; + else + line = fold.start.row - 1; + } + // /ace patche if (motionArgs.toFirstChar){ endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); vim.lastHPos = endCh;