mirror of
https://github.com/jsbin/jsbin.git
synced 2026-02-01 16:46:05 +00:00
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:
parent
fe2a6727fd
commit
a0c964a454
@ -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?\*\//, ''));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user