Skip to content
Snippets Groups Projects
Commit 3c743051 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

do not use "editor cleverness" on selected text

This patch disables all keyhandling (as used for automatic list indention)
when some text is selected. This fixes unexpected behavior when selecting
some text at the start of a list item and hitting backspace.
parent 912f066b
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,7 @@ function keyHandler(e){
e.keyCode != 32) return;
var field = e.target;
var selection = getSelection(field);
if(selection.getLength()) return; //there was text selected, keep standard behavior
var search = "\n"+field.value.substr(0,selection.start);
var linestart = Math.max(search.lastIndexOf("\n"),
search.lastIndexOf("\r")); //IE workaround
......
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