Permalink
Browse files

Oops, last commit broke proper tabstop generation

  • Loading branch information...
1 parent 362ae38 commit 24f00143b92394a45090bfa6ddd9331f9d6f067f @sergeche committed Oct 2, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 editor.js
View
@@ -121,12 +121,24 @@ function require(name) {
}
function pyPreprocessText(value) {
+ var base = 1000;
+ var zeroBase = 0;
return require('tabStops').processText(value, {
+ tabstop: function(data) {
+ var group = parseInt(data.group, 10);
+ if (group === 0)
+ group = ++zeroBase;
+ else
+ group += base;
+
+ return '${' + group + (data.placeholder ? ':' + data.placeholder : '') + '}';
+
+ },
escape: function(ch) {
if (ch == '$') {
return '\\$';
}
-
+
return ch;
}
});

0 comments on commit 24f0014

Please sign in to comment.