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

Improve local editor search (consistency with global search and improvements) #762

Closed
Komediruzecki opened this issue Jan 9, 2021 · 1 comment
Assignees
Labels
improvement request 🔨 Issue concerns an existing feature that needs improvement.
Projects

Comments

@Komediruzecki
Copy link
Contributor

When exporting a note as an HTML file or a markdown file, assets used in the note should be exported too.

Current behavior

  • Local editor search is using codemirror embedded search functionality.
  • Local editor search has bad shortcuts bound to it
  • Local editor search has hard to use search/replace process
  • Local editor search is inconsistent with global content search

Expected behavior

  • Local editor search should use the same search functionality as global search (just scoped to current note and/or title)

  • Local editor search should have proper shortcuts bound to it

    • ctrl+f search/find text
    • ctrl+r search and replace
  • Local editor search should have double search bars (one for search and one for replacing at top of the editor)

  • Local editor search should use newly implemented global search algorithms (searching, highlighting, and marking text in codemirror)

Implementation Details

  • There should be a component that consists of search input

    • This component should feature various options at the end of search input (like filtering, regex search, number of found items, etc)
    • This component can then be used both for search input box and replace the input box
  • When searching is active

    • The text should be highlighted in the editor as the user types search input
    • Count of found items should be rendered alongside search (with up/down arrows for navigation between search results)
    • When the search input box is focused
      • up/down arrow key should be used to navigate search results
    • When the user presses the ESC key, the search box should close as well as all highlighted items in the editor
      • Another ESC when search input is closed should work as previously (in VIM it should escape insert mode)
  • When search/replace is active

    • When the search is active (is focused)
      • Navigate should be active on keypresses (up/down)
    • When replace box is active (is focused)
      • enter key should replace the currently selected/highlighted item
    • There should be a replace button option as well as replace all option

Extra

  • This new local editor search implementation should avoid using escape as removing highlights from search results as ESC is used in VIM keymap to exit insert mode
@Komediruzecki Komediruzecki added the improvement request 🔨 Issue concerns an existing feature that needs improvement. label Jan 9, 2021
@Komediruzecki Komediruzecki self-assigned this Jan 9, 2021
@Komediruzecki Komediruzecki added this to In progress in Dev kanban Feb 5, 2021
@Rokt33r Rokt33r added this to the v0.14.0 milestone Feb 22, 2021
@Komediruzecki
Copy link
Contributor Author

Merged and waiting for release.

@Komediruzecki Komediruzecki moved this from In progress to Done in Dev kanban May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement request 🔨 Issue concerns an existing feature that needs improvement.
Projects
No open projects
Dev kanban
  
Done
Development

No branches or pull requests

2 participants