Fixes #566
This fixes the problem with the 'enter' handler. @laughinghan's test now works. Note that I have not yet added a test, because I don't know how I should do this.
diff --git a/src/services/keystroke.js b/src/services/keystroke.js
index f3ec668..6ec672a 100644
--- a/src/services/keystroke.js
+++ b/src/services/keystroke.js
@@ -129,6 +129,9 @@
while (cursor[L]) ctrlr.selectLeft();
break;
+ case 'Enter':
+ return ctrlr.handle('enter');
+
default:
return;
}
diff --git a/src/services/textarea.js b/src/services/textarea.js
index dd2d2de..d178cbf 100644
--- a/src/services/textarea.js
+++ b/src/services/textarea.js
@@ -86,7 +86,6 @@
this.focusBlurEvents();
};
_.typedText = function(ch) {
- if (ch === '\n') return this.handle('enter');
var cursor = this.notify().cursor;
cursor.parent.write(cursor, ch);
this.scrollHoriz();