-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
geanyprj: sidebar easy search feature #176
Open
Thannoy
wants to merge
18
commits into
geany:master
Choose a base branch
from
Thannoy:feature/geanyprj_sidebar-easy-search
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
geanyprj: sidebar easy search feature #176
Thannoy
wants to merge
18
commits into
geany:master
from
Thannoy:feature/geanyprj_sidebar-easy-search
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When sidebar has focus, user can type a text to auto-select a matching entry in the list. Default "start-with" matching was used. This commit set a custom match function based on "strstr".
Default gtk treeview supports an easy fast-highlight feature. User can type a text to highlight first item matching and can use up ordown arrows to highlight previuos/next matching item. Default match policy is a "has-prefix" match. Previous commit replaced it with a case-sensitive search. This commit updates previous one and defines five match algorithms: * Legacy "start_with" * Previous "contains" * New "contains insensitive" * New "contains all" * New "contains all insensitive" [default] "Contains all" policies helps highlighting an entry by typing few space-separated words like "prj side c". The only way to select a policy currently need a recompilation. The use of a settings page would be interesting here but is not implemented yet. Note: this commit add a dependancy to _GNU_SOURCE strcasestr() which may require a portability review.
Have autotools auto-detect strcasestr availability and disable a few features if this function is not available on the target system.
* Move kbdsearch_policy enum definition for it to be used by geanyprj.c * Add getters and setters for the active policy in sidebar.c * Add this policy to the geanyprj plugin settings * Add some widgets to the plugin config dialog to choose policy
Previously, plugin global-settings were applied and saved in any case. This commit tests which button has been used to give those three buttons their logical behavior.
Explain user how to use sidebar fast-search feature.
sidebar is configured even if not shown, hence this is not a bug to read its state when hidden.
Keep this branch up-to-date with master mainline.
HACKING file says plugin-specific dependancy checks should be inserted "between the GP_ARG_DISABLE and GP_COMMIT_PLUGIN_STATUS calls." but strcasestr check was inserted after those calls.
Still to be done: * have the filter feture optional * have the filter entry widget auto-clear on some events like open file * have shortcuts to focus sidebar items
Sidebar filter is now configurable in the same way sidebar fast-search is.
This commit add a clickable icon inside the sidebar filter gtk_entry which helps clearing this field.
Resync with master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch insert two features in GeanyPrj plugin, both focused on sidebar listing project files.
Simpler keyboard-based item selection in file listing
When sidebar is focused, user can type extracts of a searched name to easily select first matching file. User can then use up and down arrow to select other matches and 'Enter' key to open it.
As opposite to previous treeview-default behavior, matches are searched anywhere in the filename and not only as a kind of "start-with" test. User can also type two words in order to highlight files containings both substrings in a case insensitive way.
Sidebar file listing filtering
An optional input box is added on top of file listing to hide non-matching items. User can then press down arrow key to jump in the filtered file listing and search/open one of them.
Configurability
Few new configuration keys has been added in GeanyPrj plugin configuration pane. Configurable items are:
Limitations
Insensitive algorithm are not available on systems not offering strcasestr() function. In such systems, "Contains-all" is the default algorithm instead of "Contains-all insensitive".