Skip to content

Perhaps this is a bug #1448

Closed
Closed

Description

@VladTester255

With full search caching enabled, changes aren't found in an open DOCX document even after saving. However, if you enable caching by dates and sizes only, everything is found perfectly.
Perhaps the problem is that when a file is opened, a cache file is created without a hash value...
Perhaps the hash value should be added to the file name, or the date and size should be taken into account in addition to the hash value...
Example in the video:

2026-03-16.13-54-31.mp4

There's also a problem with the scroll bar display in the document content preview window.
When the "Wrap text" checkbox is enabled, the found text bars don't align with the scroll bar position. However, without this checkbox, hovering the scroll bar over the found text bar does align. Is there an easy fix for this?
Best regards, Vlad, and thank you in advance for your help and such excellent software!

2026-03-16.14-17-42.mp4

Activity

  1. doug24 commented on Mar 17, 2026

    @doug24
    Contributor

    Yes, the first item getting the hash code is a bug. While the search code opens the file shared (with the main Word app), the hash code was not opening the file shared and failing because it was open in Word. That's fixed and full hash of the file works as expected.

    For the second item, there is not much I can do here without destroying the performance. When 'Wrap text' is off, each line of text takes the same amount of vertical space on the screen, and the position of the markers can be calculated from the line number and total number of lines. However, when Wrap text is on, each line of text in the file takes one to many visual lines on the screen, and the text control (AvalonEdit) does not pre-calculate the space needed for all the wrapped lines, it just does the lines visible on the screen. It would be very expensive to do this on the whole document that has more than a few pages. And it would have to be re-calculated every time the text size/zoom changes or the window is resized (like sliding the splitter bar in you video).

    You may also notice the size of the scroll bar thumb changes as you scroll down in the document. This is the word-wrap problem — the scroll bar's ViewportSize and Maximum are based on DocumentHeight, which is inaccurate for the same reason the markers were wrong: only visible lines have correct wrapped heights in the height tree. As you scroll, more lines get rendered with their true (larger) wrapped heights, so DocumentHeight grows and the thumb shrinks. Without an accurate thumb size, the marker positions aren't relevant.

    GitHub Copilot suggested making a better estimate of the DocumentHeight before the visual lines are calculated and then set the marker positions based on a ratio of the line number to the total number of lines - but it's still just a guess. But I'm not sure I want to modify the AvalonEdit library to do this.

  2. deleted a comment from VladTester255 on Apr 16, 2026
  3. doug24 commented on Apr 16, 2026

    @doug24
    Contributor

    @VladTester255 Moved the new bug report to a new issue: #1463

  4. doug24 commented on May 12, 2026

    @doug24
    Contributor

    Fixed in v4.7.54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions