Removing a tab (i.e. 4 spaces) on backspace now

master
Jordi Boggiano 14 years ago
parent d049139bd0
commit 399ee95027
  1. 1
      README.mdown
  2. 12
      php-console.js

@ -35,6 +35,7 @@ Changelog
- Added a status bar with char/line display
- Added a toggle button to expand/collapse all krumo sub-trees at once
- Cross-browser compatibility enhancements
- Removing a tab (i.e. 4 spaces) on backspace now
- 1.0.0
- Initial Public Release

@ -62,6 +62,18 @@ $(function() {
e.preventDefault();
}
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();

Loading…
Cancel
Save