Tabby icon indicating copy to clipboard operation
Tabby copied to clipboard

Selection can grow or shrink slightly

Open alanhogan opened this issue 13 years ago • 2 comments

The selection can grow or shrink slightly with each indent/outdent operation.

Observed in Chrome 10 and Firefox 4, probably happens in other browsers as well.

alanhogan avatar Apr 04 '11 22:04 alanhogan

Here is the patch, just apply it (this patch applies behaviour the same as phpStorm does when indenting a selection with Tab or Shift+Tab):

         // selections will always add/remove tabs from the start of the line
         else {
+            while (ss < o.value.length && o.value.charAt(ss).match(/[ \t]/)) ss++;

             // split the textarea up into lines and figure out which lines are included in the selection

dimikot avatar Apr 04 '12 19:04 dimikot

Hey, that definitely helps. I still get somewhat unexpected behavior when the selection starts with a newline, however.

Applying this because it’s definitely much better. Thank you very much.

alanhogan avatar Apr 04 '12 21:04 alanhogan