Idea

Serge A avatar image
3 Likes"
Serge A suggested Jason Lightfoot commented

A more keyboard friendly find-and-replace

Find and replace dialogs can be accessed from the keyboard, but these operations cannot be efficiently used without mouse.

To replace foo with bar, I type Ctrl-h (open Find and Replace dialog), type foo, press Tab, type bar. So far so good. I press Enter, and nothing happens. The dialog needs one-key shortcuts to "Find Next", "Replace", and "Replace All". Pressing Tab a 9 (nine) times to move focus to "Replace All" is not a great user experience.The dialog also needs a way to switch Regular Expressions mode, case-sensitive mode, and whole-word mode without interfering with typing.

Visual Studio in a similar dialog allows Alt-R, Alt-A to replace next and all respectively, and Alt-W, Alt-C, Alt-E to switch search modes. It would be nice to implement the same functionality in the FlexSim code editor.

On a related note, search functionality is particularly important while editing and navigating the text. The editor needs a shortcut to "Find next" while editing. F3 should be find.

In Visual Studio, Ctrl-F opens the search dialog. Again, there are one-key shortcuts to change search modes. Then F3 and Shift-F3 will cycle through all the matches. The user may click anywhere in the text, the shortcut still works.

In FlexSim, the user has to keep the Find dialog in focus, and keep pressing Enter (with "Find Next" pre-selected as the default action). If the user clicks anywhere in the text, the "Find Next" is not working anymore.

Another search annoyance is that the inner editor control needs to have mouse focus.

Click on other parts of the editor window, it will be brought up-front and will receive focus, but not the inner editor control:

There is also another Find and Replace tool in FlexSim, the global Search panel in the Quick Properties:

flexsim-global-find-and-replace.png

This tool is may be used to do search and replace in multiple nodes, but it doesn't have the same features as the Editor's Find and Replace: in particular it doesn't support regular expressions. It would be really nice if there was a tool to change multiple tree nodes with regular expressions. Please note how Visual Studio has only one Find and Replace tool, and the changes can be applied to single files and to the entire solution.

editorkeyboard shortcut
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

"Please note how Visual Studio has only one Find and Replace tool, and the changes can be applied to single files and to the entire solution."

Visual Studio has 2 Find/Replace tools: Ctrl+F and Ctrl+Shift+F

0 Likes 0 ·
Serge A avatar image Serge A Phil BoBo ♦♦ commented ·

You're right, there is also Ctrl-Shift-F. Though the point remains that the basic Ctrl-F in VS can change its scope from a lexical scope up to the entire solution. Ctrl-Shift-F adds some extra features which allow to select files by type or by folder, but from the usability point of view it is just an extended version of Ctrl-F. The same features and the same keyboard shortcuts work in the "Replace in Files" tool (Alt-C, Alt-W, Alt-E). "Replace in Files" in VS compensates for the lack of find, grep, xargs and similar tools which allow to select the files to change.

BTW, having something like this in FlexSim global Search panel would be great: filtering by node type and matching node names to a pattern. I agree, it's a feature that belongs to a global search tool.

0 Likes 0 ·

1 Comment

·
Przemyslaw Pasich avatar image
0 Likes"
Przemyslaw Pasich commented

Not sure if this belongs in a separate idea post, but also when you ctrl+h when having some text highlighted, it automatically populates the "Find What" field - and that is great. However, the editing focus is still on the "Find What" field, which in this context I think it would better to have it on "Replace With" instead. I cannot count how many times I accidentally overwrote "Find What" with my "Replace With" because I forgot to tab between these fields.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·
This the the way the dialog works in most other windows applications - so it might be odd to change the behavior.
0 Likes 0 ·

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.