brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] Problems with very long lines (e.g. data URIs) #2443

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by joelrbrandt Thursday Jan 17, 2013 at 01:55 GMT Originally opened as https://github.com/adobe/brackets/issues/2565


Very long lines do not display correctly in Brackets. Also, very long single-line strings do not paste properly into Brackets.

Steps to reproduce:

Create an html file in Brackets with this content:

<html>
    <head>
        <script src="data:text/javascript;base64,"></script>
    </head>
    <body>
    </body>
</html>
  1. Load the following file in another editor and copy its contents to the clipboard: http://f.cl.ly/items/1V1L0O0e1A1O2o2o0Q28/jqueryb64.txt (This is a base64 encoded version of jquery.1.7.min.js)
  2. Paste the contents immediately after the base64, and before the " in the script line
  3. Save the file.
  4. Open the file in a web browser.

Expected:

This should create an absurd but correctly functioning HTML file. When opened in a Web browser, the jQuery object should be defined (note that Chrome defines $ even if jQuery isn't present, so you must check for the actual jQuery object).

The file should also display properly in Brackets.

Actual:

There are several failure modes, and I can't exactly figure out when each occurs. Things I've seen:

core-ai-bot commented 3 years ago

Comment by joelrbrandt Thursday Jan 17, 2013 at 01:58 GMT


It's definitely easier to reproduce this with 100k-character strings. But I saw the bug occur at about 8k characters.

core-ai-bot commented 3 years ago

Comment by joelrbrandt Thursday Jan 17, 2013 at 02:05 GMT


On the cmv3 demo on http://codemirror.net the display problem reproduces, but the actual string seems to be pasted properly. Pasting, selecting all, and then copying the entire buffer into Sublime yields a working document.

core-ai-bot commented 3 years ago

Comment by joelrbrandt Thursday Jan 17, 2013 at 02:14 GMT


On the cmv3 branch (as of right now) the paste does not get truncated, but it does not display properly (exactly like the demo on codemirror.net).

core-ai-bot commented 3 years ago

Comment by joelrbrandt Thursday Jan 17, 2013 at 02:26 GMT


Also filed as marijnh/CodeMirror#1163

core-ai-bot commented 3 years ago

Comment by jasonsanjose Friday Jan 18, 2013 at 23:24 GMT


Marked as tracking, assigned to@joelrbrandt.

core-ai-bot commented 3 years ago

Comment by joelrbrandt Monday Jan 21, 2013 at 22:09 GMT


This is now almost completely fixed in CodeMirror v3 (see marijnh/CodeMirror#1163) and I've confirmed the fix in the CodeMirror demo page. The remaining possible issue is that long lines break syntax highlighting on subsequent lines (and thus indentation, etc.)

By design, CodeMirror bails on syntax highlighting for lines longer than 5000 characters. I'm not sure if we should even try fixing the remaining issue (once the current CodeMirror fix makes it into Brackets).

core-ai-bot commented 3 years ago

Comment by njx Saturday Feb 02, 2013 at 01:30 GMT


Removing the codemirror v3 tag since it's not actually a bug in the codemirror v3 branch.

core-ai-bot commented 3 years ago

Comment by njx Wednesday Feb 13, 2013 at 01:45 GMT


This should be fixed in master now.@joelrbrandt, can you regress?

core-ai-bot commented 3 years ago

Comment by joelrbrandt Wednesday Feb 13, 2013 at 15:10 GMT


The problem that this bug addresses is fixed. There still appears to be a few performance issues with long lines, which I've filed as #2856 (and as marijnh/CodeMirror#1242)

Closing this bug.