Skip to content

[BUG] search in note action (Ctrl+F) does not replace the line edit (and in preview and in QLiteHtmlSearchWidget) #3538

@ipariparipa

Description

@ipariparipa

repro:

  • open a note
  • select a word (e.g. "gumicsirke")
  • Ctrl+F
  • search widget is shown, the search text is set correctly ("gumicsirke")
  • select another word in the note (e.g. "fakutya")
  • Ctrl+F
  • the search text is not replaced in the line edit of the search widget, but the note is scrolled immediately to the first presence of the previously searched string ("gumicsirke")

this is quite bothering, because...

  • not this is the "standard" behavior of the "good" text editors
  • I lose the focus in a bigger note when Ctrl+F — this one is the more critical

BG:

this code causes the problem (three times):

if (!selectedText.isEmpty() && ui->searchLineEdit->text().isEmpty()) {

it seems to me this is a wanted "feature" as it's described in your comment

// preset the selected text as search text if there is any and there is no
// other search text

…but for me this is just a stupid nuisance in one of my favorite platform independent(!) really first-class usable application (sorry for my openness).

solution:

when modifying the mentioned line to…

if (!selectedText.isEmpty()) {

…seems to be quite OK, but I did not test all the possible cases.

I can fix it if you want but…

  • I should know if a special case exists when the original logic is maybe needed
  • what would be the good strategy?
    • a. simple fix (three times) — I would vote for this one, but this "feature" seems to be already 7 years old
    • b. this behavior could be influenced by a new configuration entry
      • checkable action in "Edit" menu
      • new entry on the config panel
      • something else…

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions