Menu

Find Display Position bug

2007-04-02
2012-11-13
  • Nobody/Anonymous

    V4.0.2 on Windows 2000 SP4.

    Find dialog has 3 options for Display Position. Bottom is selected as default.

    As I understand it, this function displays the found text either at the top, middle or bottom of the window. However, on large files, 107000 lines for instance, only the Bottom selection works here. If I select Top or Middle the correct line is not displayed and the selected text is actually several screens further down.

    This only happens when Word Wrap is selected (PSPad has similar problems with Word Wrap mode so I'm guessing this is initially a Scintilla problem). It would appear that a miscalculation is made as to the correct line to display making allowances for the fact that some lines are wrapped and so the number of lines shown in the window isn't the number of lines of text.

    You can see this effect in a short file and select Middle display position. Make sure Word Wrap is on and that some lines do in fact wrap. Search for a common word and depending on the number of wrapped lines you can see the selected line progressively move down the screen with each successive Find.

    Quite how Bottom always works when Word Wrap is on or off I haven't figured out yet.

    Thanks
    Mark

     
    • Nobody/Anonymous

      No one else seen this?

      Mark

       
      • Nobody/Anonymous

        I get this bug as well all the time and since I make extensive use of the Find function I'm going to use a different text editor until this bug is fixed.

         
    • Nobody/Anonymous

      I'll take that as a 'No' then :-)
      Mark

       
    • Nobody/Anonymous

      I have a file of 50 lines (and one empty) in which I search for a word that is on line 34. When using F3 and SHIFT+F3 I am not always getting the position I would expect from the descriptions in the Find dialog box.

      With Display Position set to:

      BOTTOM  : this usually work OK, but the line is not always displayed at the bottom of the window, when it has already scrolled up. This doesn't feel like a bug, but may in fact also reflect an inconsistency in the implementation.

      F3 and
      SHIFT+F3 both show this behaviour when the searched line is already above the bottom line that it would be shown on otherwise.

      TOP,

      using F3: when the cursor is above the searched line, it works fine. The line _can't_ be shown at the top of the window, because the file is too short for that. But it will display all the last lines. When the cursor is on or below the searched line, the window shows the top of the file itself, instead of the searched line. In this case, line 34 is just below the window/visible part, with line 33 showing partially.

      using SHIFT+F3: the searched line will always be shown on the BOTTOM line, unless it is already above it.

      MIDDLE,

      using F3: when starting from the top of the file, the searched line will first be centered correctly. Pressing F3 from there on again and again moves the line down a quarter of the window height with half the previous distance each next time, unless the searched line is on the partially visible line on the real bottom of the window. It doesn't really matter where you move the cursor to start with, it always works this way with the same end result.

      using SHIFT+F3: this will either show the searched line on the bottom line (last whole line) of the window, or not move the window at all, if the searched line is already visible above that line.

      Perhaps I should use a file a little longer to get more consistent information about searching upwards, but I think it is clear that the described behaviour doesn't really match the expectations from the Display Positions' descriptions.