4

I have two nearly identical very large files (890,000+ rows of exactly 899 characters each fixed length file).

On rows 289141-289148 one file has a pipe character in column 38, and the other file has a space in that position.

If I force vimdiff to look at them line by line, it finds the difference. For example, if I delete and reinsert the line, vim finds the difference. But, when I first opened the files, vim presented them as having no differences. Also, when I run :diffupdate, vim does not recognize the difference.

Is this a defect in VimDiff, or can you think of something I might be doing incorrectly?

From first file:

ABCDEFGH            ABCDEFGHI44    }"|                           S

From second file:

ABCDEFGH            ABCDEFGHI44    }"                            S

Also note: I tested the theory that it was something special about the pipe character. Even when I replaced the pipes with a normal character (e.g., j), it still had the same behavior of not recognizing the difference.

  • 1
    With just the example lines you gave, vimdiff instantly highlights the differences for me. I suspect it is a size issue (vim doesn't always deal well with humongous texts, for memory reasons). – D. Ben Knoble Jan 15 at 20:43
  • 2
    I concur - I assume it has something to do with very small differences in very large files. Just wondering what those parameters are so I know when (if?) I can rely on the tool. – PeterBSmith Jan 16 at 14:41
  • what vim version are you trying this with? Does it make a difference if you diffopt contains internal or not? – Christian Brabandt Jan 20 at 7:07
  • I diff two files and then choose help->Version. That yields: VIM - Vi Improved 8.1 (2018 May 18, compiled May 19 2018 18:36:07). I'm on a corporate network so I cannot just go download the current version. Interestingly, now the compare is identifying the expected difference. Not sure what changed, if anything, or if it is random? – PeterBSmith Jan 20 at 16:12
  • please try to replicate this behaviour, add additional context like the output of :version and check, whether adding/removing internal from the diffopt setting changes anything. – Christian Brabandt Jan 21 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.