Announcement

Collapse
No announcement yet.

Incorrect mismatch on pathologically-long lines.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Incorrect mismatch on pathologically-long lines.

    (Sorry folks, I don't create these files, I just try to wrangle them .)

    I'm comparing using BC3 to compare to versions of a very simple JavaScript file and a "mismatch" is getting falsely flagged.

    Basically, my files are as follows:

    Code:
    var my_array = new Array(
                                "...";
                            )
    Where the literal string "..." is really 4100 bytes of "." (or any other string characters that you like).

    In one version of the file, that string is indented using 7 {tab} characters. In the other version of the file, the indent is made using 28 {space} characters. Therefore, these files are only "insignificantly" different.

    But apparently because BC3 starts to wrap text in the display panes once the lines exceed about 4096 characters, it ends up wrapping a different amount of text for the "tabbed" version as compared to the "spaced" version. It then calls those "wrapped" lines different.

    Here's a simulated screen shot of the two panes:

    From the pane displaying the "tabbed" file:
    var my_array = new Array(
    "........................
    ............"
    );

    From the pane displaying the "spaced" file:
    var my_array = new Array(
    "........................
    ................................."
    );

    Don't feel too bad about this, because, for example, vim's syntax analyzer gives up after only 3,000 bytes of this ridiculous string, displaying the rest as if they weren't part of the literal string. And I'll have a conversation with my developers about using such pathological constructs.

    But meanwhile, I thought you'd like to know about this limitation in BC3.

    Atlant

  • #2
    Hello,

    4096 is the default character limit per line, but that limit can be increased.

    Go to the Tools menu -> File Formats, select the format for your files, go to the Conversion tab.
    Here you can increase (or decrease) from 4096.

    How does that work for you?
    Aaron P Scooter Software

    Comment


    • #3
      That did it!

      Aaron:

      Thanks! Doubling the "characters per line limit" from 4096 to 8192 solved this issue (at least until my JavaScript developers get even more perverse )!

      Is that an expensive limit to raise? That is, will BC3 use a lot more of some resource (CPU, memory, etc.) if I were to just routinely leave that set to a high value?

      Atlant

      Comment


      • #4
        It's not significantly more expensive. It will slow down comparing those specific lines, so drawing/scrolling/editing on those lines will chug a bit, but it won't otherwise affect anything. If the long lines aren't on the screen you probably won't notice the difference at all. Individual lines are dynamically allocated, so short lines won't start taking up 8192 bytes.
        Zoë P Scooter Software

        Comment


        • #5
          Problems with lines beyond the 65536 characters

          for problems with lines beyond the 65536 characters see:

          Comment


          • #6
            Personal opinion: Ask your developers to make the strings in such a way that they are actually editable. Many languages (I don't know Java Script) allow something like this)

            var foo = ".........................." + // limit to what fits on one screen width
            ".........................." +
            ".....";

            This makes it much easier to work with, to compare etc.

            F.

            Comment

            Working...
            X