Go to the Prism Live web site, scroll down to the JS, and select something more than one line. For example, select setCaret() here
setCaret(pos) {
this.selectionStart = this.selectionEnd = pos;
}
moveCaret(chars) {
if (chars) {
this.setCaret(this.selectionEnd + chars);
}
}
(Not that this is where the problem may be; it's just what I happened to be staring at when I noticed this bug.)
Press Ctrl+/, and it comments out like it should:
/*setCaret(pos) {
this.selectionStart = this.selectionEnd = pos;
}*/
moveCaret(chars) {
if (chars) {
this.setCaret(this.selectionEnd + chars);
}
}
Notice the selection includes the /* */ markers. With those still selected press Ctrl+/ again and it just adds more comments (and creating a syntax error with the second end comment):
/*/*setCaret(pos) {
this.selectionStart = this.selectionEnd = pos;
}*/*/
moveCaret(chars) {
if (chars) {
this.setCaret(this.selectionEnd + chars);
}
}
It only un-comments if the /* */ are not selected. I change selection to this (| are the selection boundaries):
/*/*|setCaret(pos) {
this.selectionStart = this.selectionEnd = pos;
}|*/*/
moveCaret(chars) {
if (chars) {
this.setCaret(this.selectionEnd + chars);
}
}
Press Ctrl+/ and I get this:
/*se|tCaret(pos) {
this.selectionStart = this.selectionEnd = pos;
}*/|
moveCaret(chars) {
if (chars) {
this.setCaret(this.selectionEnd + chars);
}
}
Then without changing the selection hit Ctrl+/ again, and the selection range is messed up even more:
setC|aret(pos) {
this.selectionStart = this.selectionEnd = pos;
}
m|oveCaret(chars) {
if (chars) {
this.setCaret(this.selectionEnd + chars);
}
}
Go to the Prism Live web site, scroll down to the JS, and select something more than one line. For example, select
setCaret()here(Not that this is where the problem may be; it's just what I happened to be staring at when I noticed this bug.)
Press Ctrl+/, and it comments out like it should:
Notice the selection includes the
/* */markers. With those still selected press Ctrl+/ again and it just adds more comments (and creating a syntax error with the second end comment):It only un-comments if the
/* */are not selected. I change selection to this (|are the selection boundaries):Press Ctrl+/ and I get this:
Then without changing the selection hit Ctrl+/ again, and the selection range is messed up even more: