From 9da808470df7efe6e93d1cdafea904be2cf670a9 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Mon, 17 Mar 2014 16:23:45 -0400
Subject: [PATCH] Better indentation styles for treelist items

---
 program/js/tiny_mce/plugins/autolink/editor_plugin_src.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js b/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
index c05fbbc..5b61f7a 100644
--- a/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
+++ b/program/js/tiny_mce/plugins/autolink/editor_plugin_src.js
@@ -107,8 +107,8 @@
 			do
 			{
 				// Move the selection one character backwards.
-				r.setStart(endContainer, end - 2);
-				r.setEnd(endContainer, end - 1);
+				r.setStart(endContainer, end >= 2 ? end - 2 : 0);
+				r.setEnd(endContainer, end >= 1 ? end - 1 : 0);
 				end -= 1;
 
 				// Loop until one of the following is found: a blank space, &nbsp;, delimeter, (end-2) >= 0

--
Gitblit v1.9.1