From c6c60f6d26c7be8fdcf7a68f15e4b7d5b9dd1b84 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Wed, 11 Nov 2015 10:54:32 -0200 Subject: [PATCH] Fix get length of last line to fold everything right Signed-off-by: Bruno Bottazzini --- client/js/controllers/editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/js/controllers/editor.js b/client/js/controllers/editor.js index cfaddb5..3179637 100644 --- a/client/js/controllers/editor.js +++ b/client/js/controllers/editor.js @@ -164,8 +164,9 @@ count++; } } - var len = editor.session.getLine(count); - editor.session.selection.addRange(new Range(0, 0, count, 256)); + var len = editor.session.getLine(count).length; + console.log(len); + editor.session.selection.addRange(new Range(0, 0, count, len)); editor.session.toggleFold(false); editor.session.selection.clearSelection(); }