Removing a tab (i.e. 4 spaces) on backspace now
This commit is contained in:
@@ -35,6 +35,7 @@ Changelog
|
|||||||
- Added a status bar with char/line display
|
- Added a status bar with char/line display
|
||||||
- Added a toggle button to expand/collapse all krumo sub-trees at once
|
- Added a toggle button to expand/collapse all krumo sub-trees at once
|
||||||
- Cross-browser compatibility enhancements
|
- Cross-browser compatibility enhancements
|
||||||
|
- Removing a tab (i.e. 4 spaces) on backspace now
|
||||||
- 1.0.0
|
- 1.0.0
|
||||||
- Initial Public Release
|
- Initial Public Release
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,18 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
// deindent automatically on backspace
|
||||||
|
caret = $(this).getCaret();
|
||||||
|
part = $(this).val().substr(0, caret);
|
||||||
|
if (part.match(/\n( {4,})$/)) {
|
||||||
|
$(this).val(function(idx, val) {
|
||||||
|
return val.substring(0, caret - 4) + val.substring(caret);
|
||||||
|
});
|
||||||
|
$(this).setCaret(caret - 4);
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStatusBar();
|
updateStatusBar();
|
||||||
|
|||||||
Reference in New Issue
Block a user