This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Search and Replace

Facility for finding text and replacing it with something else.

Goals

Plans

This likely involves porting gedit's search/replace to Builder. Most of the details are implemented in GtkSourceView anyway, and are easily reusable.

We also need to add a right-click context menu to the search entry (ctrl+f or / in vim mode) to allow toggling case-sensitivity.

Relevant Art

Xcode

Treats finding in file and searching project-wide as separate UIs:

https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/Art/FindReplaceFile_2x.png

https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/Art/SearchReplaceProject_2x.png

More details.

Atom

https://i.ytimg.com/vi/cNWZEt-3m1I/maxresdefault.jpg

Sublime Text

http://i.stack.imgur.com/oBoxi.png

Discussion

Initial Design Experiment

Most IDEs use a fairly standard approach to find/replace - they show a bar or small drop down, like in Xcode or Atom. This approach has some advantages. In particular, it allows you to view search matches in place, so you can tell whether it is the item you are looking for.

However, there are some issues with it:

This design attempts to resolve these issues. However, there are some issues with it:

Tentative Design

https://raw.githubusercontent.com/gnome-design-team/gnome-mockups/master/builder/builder-find-replace-wires.png

Project-wide find/replace can be treated as a non-essential secondary feature.

TODO list

Assignee: MatthewLeeds

☑ Create an XML version of Allan's mock-up and test it in Builder

☑ Connect the existing replace functionality to the new UI

☑ Allow case sensitivity

☑ Allow whole word matching

☑ Allow regular expressions

☑ Make the 'c' option on the vim substitute command trigger the search-and-replace UI

☑ Add a squiggly underline when the search or replace regex is invalid

☐ Allow search or replace to be limited to a range

? Allow project-wide replace

Comments

See Also


2024-10-23 10:58