Skip to content
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

[Feature suggestion] Extend Search to Search & Replace #85

Open
Olf0 opened this issue Jun 3, 2017 · 4 comments
Open

[Feature suggestion] Extend Search to Search & Replace #85

Olf0 opened this issue Jun 3, 2017 · 4 comments
Assignees

Comments

@Olf0
Copy link

Olf0 commented Jun 3, 2017

Extend Editor.'s search bar with a second line, containing a "R" button or an upward arrow hitting a line (like one of the two rightmost buttons in the search field line rotated by 90 degrees; maybe with a circle around it, if such a symbol is at hand and space is sufficient) below the magnifying lens icon of the first line, followed by a text field for the replacement string, a "(X)" button (if text was entered in the text field, as in the search line) and an "Insert" button.

  • Hitting the first (leftmost) button (up-arrow or "R" left of the text field) lets the replacement line collapse, leaving only the first (search) line visible. Consequently opening the search function from Editor.'s pulley menu must always open with both (the search and the replacement) lines displayed (otherwise the replacement line would be unreachable, once collapsed).
  • Hitting the (rightmost) "Insert" button replaces the current text selection in the document with the string from the replacement text field or inserts the replacement string at the current cursor position in the document (if nothing is selected; just as if the text came straight from the keyboard / the clipboard, in both cases).
  • Side note: When implemented as described in the two bullet points above, it may make sense that closing the search bar by tapping on the magnifying lens symbol as suggested in issue [Usability bug & suggestions] "Search" is nicely implemented, but hard to use #82 only collapses the search line, but not the replacement line. So one would still be able to insert the replacement string in the document text at arbitrary cursor positions (while freeing vertical space, when the search line is not needed).

[Extra suggestion] Detect landscape orientation and place both (the search and the replacement) lines side by side (i.e. in a single line), then.

Edit: [Extend this functionality, optionally] Add a "R all" button (with the "R" set in italic; see comment below for details) left of the "Insert" button (i.e. as the second button from the right in this line) to enable users replacing all occurrences of the search term in the document with the replacement string. Note that a "Replace all" functionality would be more convenient and safer to use when the feature suggestion of issue #90 is implemented.

P.S.: I am aware, that this feature suggestion duplicates SailfishOS's clipboard functionality to a certain extent, but it would provide the classic search&replace functionality conveniently.

@GoAlexander
Copy link
Owner

Hm, I like it. Will try implement in the feature but the priority will be low by now.
High priority: Dropbox, UI 2.0, RegExpressions, background fix, highlighting improvements, lineNumbers fix

@ghost
Copy link

ghost commented Jun 4, 2017

Very nice Search and Replace.

@Olf0
Copy link
Author

Olf0 commented Jun 5, 2017

@GoAlexander: I considered this rather easy to implement. Most UI elements are already there (in the search line) and the "Insert" button just has to emit the string from the input field.
Edit: Only the (freshly added in the original message) "Replace all" function appears to be a bit harder. Hence you may want to look at that sub-feature separately and later.

@Olf0
Copy link
Author

Olf0 commented Jun 5, 2017

Extend Editor.'s search bar with a second line, containing a "R" button or an upward arrow hitting a line (like one of the two rightmost buttons in the search field line rotated by 90 degrees; maybe with a circle around it, if such a symbol is at hand and space is sufficient) below the magnifying lens icon of the first line, [...]

I guess a bold, capital R (for "Replace"; you may try to set it italic additionally, but that R might look worse than solely set bold R) is the best and easiest symbol left of the text field to denote the function of the second line.

Edit: When considering the "Replace all" function, it may make sense, look good and create a connection of the "R"s to "Replace", if both "R"s are set in italic: R (bold & italic) at the beginning of the line and "R all" (the R being set italic, only) as the button label.

Edit 2: And in consequence the pulley menu entry (or wherever it is moved to in Editor.'s UI 2.0) may be labelled "Search & R", which avoids the lengthy word "Replace" or abbreviations of it, which are all somewhat clumsy, e.g. "R.", "Repl." (could mean "Reply" or "Replicate" as well), "Repla." (well, not much gained) etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants