Filtered view

Skip to first unread message

Neil Hodgson

Aug 10, 2021, 11:42:28 PM8/10/21
   A proposal was made 2 years ago to include a way to view just the lines that match a search string. This has progressed recently with much of the feature implemented on Win32 and GTK. There could still be some bugs and the functionality may need refinement. The current code has been uploaded so other people can experiment with it.

   An image of the filter view on Windows, showing 2 lines of context around each match is at

   There is a separate filter view accessed from Search | Filter. The last icon on the filter strip toggles context on/off. The replace strip can also filter: the third icon on the top row toggles filter view on/off and there is a context toggle to its right.

   A screenshot on GTK, with the replace strip in filter mode:
   The new ‘filter’ and ‘context’ buttons are surrounded with orange.

   The number of lines of context is defined by the filter.context property. Hidden lines are indicated with a line drawn with the value of the hidden.line.colour property. Matches are shows with the indicator specified with the find.indicator.incremental property. When context is shown, the match lines are highlighted with yellow which is currently hard coded but should be a property.

   The source code can be downloaded from
   A Windows 64-bit executable is at 

   The feature request is at

   Current issues:

   Scintilla doesn’t support hiding the first line. Its possible that this could be improved. If not, it might be reasonable to make the first line blank by drawing the background colour over it.

   As it may take some time to search the whole document when large, this is performed as a background idle task. This sometimes causes more flashing as lines are shown and hidden.

   The original proposal added another toggle button for incremental search. This is currently a property. There are arguments both ways on how best to control incremental search.

   The amount of context is set with a property. It may be better to include a way to change this interactively.

   Any folds are unfolded for filter view and there are attempts to restore folds after filter view ends. This may not work in all cases such as when the fold structure is changed while the view is filtered - perhaps a ‘{‘ was added or removed.


Aug 13, 2021, 6:57:38 AM8/13/21
to scite-interest
Wow. Awesome.

This will go straight into my workflow.

Many thanks

Kind Regards Gavin Holt

PS. Where can I download sc1.exe with the new filter function?

Neil Hodgson

Aug 13, 2021, 10:07:52 PM8/13/21
Gavin Holt:

> PS. Where can I download sc1.exe with the new filter function?

There isn’t one but it should be possible to run the make files in the source archive.

The script I use for making previews only makes one output configuration - a 64-bit Win32 executable with DLLs. The script for a full release does far too much.


Neil Hodgson

Aug 25, 2021, 5:53:47 PM8/25/21
to scite-interest
The filtered view feature is now committed. It is an option in the replace strip and a separate strip that can be invoked through Search | Filter.

There are properties controlling filtering which are documented in SciTEDoc.html: filter.match.indicator, filter.match.back, filter.context, and hidden.line.colour.

Scintilla was changed to allow hiding the first line of the document. Hiding all lines in the document also works.

The committed changes can be examined either in the repositories
git clone
hg clone scintilla
hg clone
or from Source Windows executable (64-bit)


Reply all
Reply to author
0 new messages