Using the context token to work out the mode, rather than what we had before, which meant that we couldn't comment out a line when using the compressed JS. Anyway, Closes #63 :)

This commit is contained in:
remy 2011-06-21 14:01:57 +01:00
parent fe2a6727fd
commit a0c964a454

View File

@ -65,10 +65,10 @@ function keycontrol(panel, event) {
var cur = panel.getCursor(false),
token = panel.getTokenAt(cur),
type = token && token.state && token.state.token ? token.state.token.name : 'javascript',
type = token && token.state && token.state.htmlState && token.state.htmlState.context && token.state.htmlState.context.tagName ? token.state.htmlState.context.tagName : 'javascript',
line = panel.getLine(cur.line);
if (type == 'css') {
if (type == 'style') {
if (line.match(/\s*\/\*/) !== null) {
// already contains comment - remove
panel.setLine(cur.line, line.replace(/\/\*\s?/, '').replace(/\s?\*\//, ''));