Don't preload when player hasn't finished typing this or self.

This commit is contained in:
Nick Winter 2014-10-14 10:39:13 -07:00
parent d79d40b98c
commit b7fe9398d5

View file

@ -476,8 +476,9 @@ module.exports = class SpellView extends CocoView
currentLine = _.string.rtrim(@aceDoc.$lines[cursorPosition.row].replace(/[ \t]*\/\/[^"']*/g, '')) # trim // unless inside "
endOfLine = cursorPosition.column >= currentLine.length # just typed a semicolon or brace, for example
beginningOfLine = not currentLine.substr(0, cursorPosition.column).trim().length # uncommenting code, for example
incompleteThis = /^(s|se|sel|self|t|th|thi|this)$/.test currentLine.trim()
#console.log 'finished?', valid, endOfLine, beginningOfLine, cursorPosition, currentLine.length, aether, new Date() - 0, currentLine
if valid and (endOfLine or beginningOfLine)
if valid and (endOfLine or beginningOfLine) and not incompleteThis
if @autocastDelay > 60000
@preload()
else