Merge pull request #1925 from ggoodman/patch-1
Prevent repeat firing of render callback
This commit is contained in:
commit
4949e18f00
1 changed files with 2 additions and 2 deletions
|
|
@ -100,7 +100,7 @@ var highlight = function(el, opts, callback) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) {
|
highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) {
|
||||||
var waiting = 0;
|
var waiting = 1;
|
||||||
var modeCache = EditSession.prototype.$modes;
|
var modeCache = EditSession.prototype.$modes;
|
||||||
|
|
||||||
// if either the theme or the mode were specified as objects
|
// if either the theme or the mode were specified as objects
|
||||||
|
|
@ -127,7 +127,7 @@ highlight.render = function(input, mode, theme, lineStart, disableGutter, callba
|
||||||
var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter);
|
var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter);
|
||||||
return callback ? callback(result) : result;
|
return callback ? callback(result) : result;
|
||||||
}
|
}
|
||||||
return waiting || done();
|
return --waiting || done();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue