Skip to content
This repository has been archived by the owner on Jun 24, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: do not mess with my cursor!
  • Loading branch information
Christian Kruse committed Sep 16, 2015
1 parent ebdba4e commit 7d9e22a
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions app/assets/javascripts/markdown/bootstrap-markdown.js
Expand Up @@ -741,34 +741,7 @@
case 16: // shift
case 17: // ctrl
case 18: // alt
break;

case 9: // tab
var nextTab;
if (nextTab = this.getNextTab(),nextTab !== null) {
// Get the nextTab if exists
var that = this;
setTimeout(function(){
that.setSelection(nextTab.start,nextTab.end);
},500);

blocked = true;
} else {
// The next tab memory contains nothing...
// check the cursor position to determine tab action
var cursor = this.getSelection();

if (cursor.start == cursor.end && cursor.end == this.getContent().length) {
// The cursor already reach the end of the content
blocked = false;
} else {
// Put the cursor to the end
this.setSelection(this.getContent().length,this.getContent().length);

blocked = true;
}
}

break;

case 13: // enter
Expand Down

0 comments on commit 7d9e22a

Please sign in to comment.