Skip to content

Conversation

@KonerDev
Copy link
Member

@KonerDev KonerDev commented Oct 8, 2025

This PR improves the existing Xed-Editor search functionality.

Changes

  • Only allow either the option Regex or Whole word in UI (Previously, one of them was silently ignored)
  • Add search result count and index of currently selected search result
  • Replace hardcoded strings with XML resources
  • Fix placeholder text color inconsistency
  • Allow newlines in replacement text field (Maybe closes Regular expression replacement problem #575)

@github-actions
Copy link

github-actions bot commented Oct 8, 2025

PR Summary

Implemented significant enhancements to the editor's search and replace functionality. This includes displaying the total number of search results and the index of the current match. The UI for search options (Regex and Whole word) was improved to ensure mutual exclusivity. Additionally, the replacement text field now supports newlines, and several hardcoded strings were replaced with localized resources for better internationalization.

Changes

File Summary
core/main/src/main/assets/supported_locales.json Added the 'arq' locale identifier to the supported_locales.json file, expanding the list of languages supported by the application.
core/main/src/main/java/com/rk/tabs/EditorTab.kt Removed several redundant empty lines within the EditorTab.kt file, improving code readability and consistency without altering functionality.
core/main/src/main/java/com/rk/xededitor/ui/components/EditorSearch.kt Implemented search result counting and current match indexing. Ensured Regex and Whole word search options are mutually exclusive. Replaced hardcoded strings with stringResource calls. Removed maxLines = 1 from the replacement text field to allow multiline input and added KeyboardOptions.
core/main/src/main/java/com/rk/xededitor/ui/components/StyledTextFeild.kt Refactored the internal structure of the StyledTextField composable by moving the BasicTextField and TextFieldDefaults.DecorationBox into a more standard arrangement, improving maintainability without functional changes.
core/resources/src/main/res/values/strings.xml Added new string resources for 'Ignore case', 'Regex', and 'Whole word' to strings.xml, facilitating localization and replacing hardcoded text in the search panel.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Review Summary

Commits Considered (1)
  • 952acf5: feat(search): allow newlines in replacement and show search result count
Files Processed (5)
  • core/main/src/main/assets/supported_locales.json (1 hunk)
  • core/main/src/main/java/com/rk/tabs/EditorTab.kt (6 hunks)
  • core/main/src/main/java/com/rk/xededitor/ui/components/EditorSearch.kt (8 hunks)
  • core/main/src/main/java/com/rk/xededitor/ui/components/StyledTextFeild.kt (1 hunk)
  • core/resources/src/main/res/values/strings.xml (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • core/main/src/main/java/com/rk/xededitor/ui/components/EditorSearch.kt [193-210]

    maintainability: "Refactor duplicated mutual exclusivity logic for search options."

  • core/main/src/main/java/com/rk/xededitor/ui/components/EditorSearch.kt [219-236]

    maintainability: "Consolidate mutual exclusivity logic for 'Whole Word' search option."

@RohitKushvaha01 RohitKushvaha01 merged commit 0227609 into Xed-Editor:main Oct 9, 2025
@KonerDev KonerDev deleted the feature/search-improvements branch October 19, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regular expression replacement problem

2 participants