#129 Search Highlighting

open
nobody
None
5
2005-01-11
2004-12-13
TK Soh
No

This patch adds a "Highlight All" checkbox to the Find
dialog:

- when checked, will cause all search matches to be
highlighted. Highlighting begins when user clicks on
the "Find" button.
- Previous highlights will be cleared before beginning a
new search of different search string and/or search
type.
- To cleared the highlights explicitly, uncheck
the "Highlight All" checkbox.
- The "Highlight All" checkbox will toggle automatically to
reflex the highlighting state of the active tab.
- the default highlighting color is yellow, which can be
changed with "nedit.searchHiliteColor" resource.

Some sample snapshots has be uploaded.

The highlighting algorithm used in this patch has been
adapted from Andrew Hood's find_all() macro.

Discussion

  • TK Soh

    TK Soh - 2004-12-13

    highlight-all patch v1.0

     
  • TK Soh

    TK Soh - 2004-12-13

    the Find dialog with Highlight-All checkbox

     
  • TK Soh

    TK Soh - 2004-12-13

    snapshot of window with search highlights

     
  • TK Soh

    TK Soh - 2004-12-14

    patch v1.1: bugfix on search and tab-detach

     
  • Andrew Hood

    Andrew Hood - 2004-12-14

    Logged In: YES
    user_id=36856

    Version 1.0 doesn't seem to work properly if there is more
    than one match in a line. It only highlights one occurence
    in the line.

     
  • TK Soh

    TK Soh - 2004-12-14

    Logged In: YES
    user_id=411637

    Version 1.1 has a few fixes, including one that I found in the
    find_all() macro ;) Though I am not sure it cover the bug you
    described. Can you give a more specific example?

    Actually, you should try Version 2.0 instead. It does
    highlighting more than 10x faster, depending on the total
    number of matched strings. For most situation, it's almost
    instantaneous.

     
  • TK Soh

    TK Soh - 2004-12-14

    patch v2.0: with turbo-speed search highlighting

     
  • Andrew Hood

    Andrew Hood - 2004-12-15

    Logged In: YES
    user_id=36856

    Version 2.0 fixes my problem.

    I did note that if you have multiple tabs open, and you
    leave the find window up as you switch tabs, the value of
    the radio button may change (e.g. On to Off). All the other
    buttons propogate for the new tab.

     
  • TK Soh

    TK Soh - 2004-12-15

    Logged In: YES
    user_id=411637

    This is a feature: "- The "Highlight All" checkbox will toggle
    automatically to reflex the highlighting state of the active
    tab." Which, you can later uncheck the box to clear the
    highlight. Currently there's a bug that the box will stay
    checked even if the search string fails to match any, but
    nothing too serious I think.

    The UI design is restricted by a single radio button, and I
    don't feel like adding more button the dialog. Let me know if
    you have any ideas.

    I also plan to add highlighting to the incr-search bar, but still
    not exactly sure about the UI design.

     
  • Thorsten Haude

    Thorsten Haude - 2004-12-16

    Logged In: YES
    user_id=119143

    For the i-search a global option might make sense, ie. don't
    add another toggle. This would have a similar effect to a
    search in less. For this global option I would prefer a
    dimmer default color though.

     
  • TK Soh

    TK Soh - 2004-12-17

    Logged In: YES
    user_id=411637

    Version 3.0 adds highlighting to i-search, enabled
    by "Pref>Searching>Highlight_Incremental_Search"

     
  • TK Soh

    TK Soh - 2004-12-17

    patch v3.0: with i-search highlighting

     
  • TK Soh

    TK Soh - 2005-01-11

    Logged In: YES
    user_id=411637

    patch v4.0:

    1. feature progressive search highlight - search and
    highlight as text are modified or replaced. (Warning:
    efficient may vary depending on the search pattern. -O2 is
    recommended)

    2. support highlighting on Find-Selection and Find-Same.

    3. the "Highlight" button no longer toggle when switching
    tabs, but unchecking it will still clear the search
    highlight in the current tab.

    4. Search highlight is stored in a 'priority' rangeset, so
    it will not be obscured by other rangesets.

     
  • TK Soh

    TK Soh - 2005-01-11
    • summary: "Highlight All" checkbox in Find dialog --> Search Highlighting
     
  • TK Soh

    TK Soh - 2005-01-11

    patch v4.0: with progressive search highlight

     
  • TK Soh

    TK Soh - 2005-05-05

    patch v4.1: fixed coredump

     
  • TK Soh

    TK Soh - 2005-06-07

    patch v4.2: more coredump fixes

     
  • TK Soh

    TK Soh - 2005-06-07

    Logged In: YES
    user_id=411637

    uploaded patch v4.2 with coredump fix - I haven't seen one
    for a good while.

     
  • Joerg Fischer

    Joerg Fischer - 2007-05-16

    Logged In: YES
    user_id=918104
    Originator: NO

    There seems to be a conflict with the rangesets created or destroyed via the macro interface. Do a search with the "Highlight All" checkbox on, so that a rangeset is created (ie if there are matches for the search string). Then run the one line macro

    rangeset_destroy($rangeset_list)

    Then the rangeset of the Find dialog is lost. If you repeat the search now, so that there are matches, nedit crashes.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks