fix bug with get-token in modes that don't do tokenization

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2009-06-10 16:18:51 -04:00
parent 7e36a08844
commit c56299b992
1 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,10 @@ class DumpAggregateTokenData(Method):
class GetToken(Method):
'''View type and data of the "current" token'''
def _execute(self, w, **vargs):
if w.mode.name in w.buffer.highlights:
w.set_error('No Token Data')
return
token = w.get_token()
if token is None:
w.set_error('No Token')