Closed liaujianjie closed 10 years ago
@RaymondLim Cannot reproduce unresponsiveness on 64bit Ubuntu 14.04. (on master ece9bbf2f204f61d18aadb8260e8f9ffb3c7a1c9).
I do see a 'Unable to load live preview page' dialog; but this happens after the index.html of the Getting Started
project has rendered, although the Brackets' console says this (full stack trace below), but I'm not sure what this means - other than that would probably be the file that Brackets' errors on.
GET http://127.0.0.1:9222/json Inspector.js:266
getDebuggableWindows Inspector.js:266
connectToURL Inspector.js:348
_openInterstitialPage LiveDevelopment.js:1125
_doLaunchAfterServerReady LiveDevelopment.js:1242
(anonymous function) LiveDevelopment.js:1343
j jquery-2.1.0.min.js:2
k.fireWith jquery-2.1.0.min.js:2
e.(anonymous function) jquery-2.1.0.min.js:2
(anonymous function) jquery-2.1.0.min.js:2
j jquery-2.1.0.min.js:2
k.fireWith jquery-2.1.0.min.js:2
e.(anonymous function) jquery-2.1.0.min.js:2
onSuccess StaticServer.js:124
(anonymous function) StaticServer.js:149
j jquery-2.1.0.min.js:2
k.fireWith jquery-2.1.0.min.js:2
NodeConnection._receive
@Mark-Simulacrum That's a rather common error message, which is probably not part of the issue. Apparently nobody knows what it means :D See #8611.
@Mark-Simulacrum I found a more reproducible recipe that works for me on Win. Could you try it?
i.html
and i.css
, with the contents:<html>
<head>
<link rel="stylesheet" href="i.css" type="text/css">
</head>
<body>
Some text.
</body>
</html>
/* body {
background-color: black;
color: white;
} */
i.html
and waiti.css
*/
on line 4, then press Backspace againResult: The editor becomes unresponsive
git bisect
points to @RaymondLim's c954fb4462e4fea23e53e0452eedd3a9b54ecdae.
@MarcelGerber Yes, your test case does allow me to reproduce the hang. Will test the PR branch soon.
@Mark-Simulacrum @MarcelGerber Since you both repro'ed this earlier, would one of you mind confirming the fix before we close it? (I tested it a bit during PR review, but this was a nasty enough bug that it never hurts to get some extra eyes on it). Thanks!
@peterflynn @RaymondLim I'm sorry to say, but using the files from above recipe, the bug got even worse. Latest master (03ab969) on Win 8.1
i.html
and i.css
, with the contents:<html>
<head>
<link rel="stylesheet" href="i.css" type="text/css">
</head>
<body>
Some text.
</body>
</html>
/* body {
background-color: black;
color: white;
} */
i.html
and waiti.css
*/
Result: The editor becomes unresponsive
Ugh, sorry -- my fault. My last suggestion for simplifying the loop was not quite right. The stopping condition needs to exactly match how TokenUtils decides whether to stop & return false or not.
@RaymondLim thee potential ways to fix that:
while (!(ctx.pos.line <= 0 && (ctx.pos.ch <= 0 || ctx.token.start <= 0)))
@RaymondLim I can post a fix using approach 2 above -- just proofed it out.
Looks good now.
Closing as fixed. @LiauJianJie let us know if you still see problems.
In release 43 (OSX Mavericks), the editor becomes unresponsive when you click on a multi-line comment (that comments out a valid class/id) in CSS while having the live preview running. I tried replicating the bug without plugins and it still occurs.