Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 14, 2025

Adds the ability to toggle between case-sensitive and case-insensitive glob search using the Ctrl+I key combination, following the same convention as popular pager programs like less and more.

Problem

Users frequently need to search for paths that differ only in case, such as distinguishing between Rust's target directory and LLVM's Target directory. The existing glob search was always case-insensitive, making it impossible to filter results precisely.

Solution

  • Toggle functionality: Press Ctrl+I in the glob search pane to switch between case-sensitive and case-insensitive matching
  • Visual feedback: The pane title dynamically shows (case-sensitive) or (case-insensitive) to indicate the current mode
  • Inline help: Updated the search pane help text to show case = ^I alongside existing shortcuts
  • Non-interfering shortcut: Uses Ctrl+I instead of just I to avoid interference with typing 'I' in glob patterns
  • Backward compatibility: Default behavior remains case-insensitive to preserve existing user workflows

Example Usage

  1. Press / to open glob search
  2. Enter pattern like **/target (you can now type 'I' normally in patterns)
  3. Press Ctrl+I to toggle case sensitivity (notice title change)
  4. Press Enter to search with the selected case mode

In case-insensitive mode (default), **/target matches target, Target, and TARGET.
In case-sensitive mode, **/target only matches target.

Implementation Details

  • Added case_sensitive: bool field to GlobPane struct
  • Modified glob_search() function to accept case sensitivity parameter and use appropriate gix_glob::pattern::Case mode
  • Updated help documentation to reflect the new functionality
  • Added comprehensive test coverage for both case modes and shortcut behavior
  • Fixed shortcut interference by using Ctrl+I instead of just I

The implementation uses minimal, surgical changes to preserve existing behavior while adding the requested functionality.

Fixes #292


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] @Byron/dua-cli/issues/292 Implement it so that switching to case-sensitivity uses the same shortcut as in popular pager programs. Implement case-sensitive glob search toggle with 'I' shortcut Sep 14, 2025
Copilot AI requested a review from Byron September 14, 2025 02:34
Copilot finished work on behalf of Byron September 14, 2025 02:34
@nyurik
Copy link
Contributor

nyurik commented Sep 14, 2025

LOL. So nice to be able to type anything except the capital letter I ... :D

@Byron
Copy link
Owner

Byron commented Sep 14, 2025

@copilot Make it so that the shortcut doesn't interfere with what the user would type into the glob prompt.

Copy link
Contributor Author

Copilot AI commented Sep 14, 2025

@copilot Make it so that the shortcut doesn't interfere with what the user would type into the glob prompt.

Fixed in commit e46cb1b. Changed the shortcut from 'I' to Ctrl+I (^I) so users can now type 'I' normally in their glob patterns. The help text has been updated to show "case = ^I" and comprehensive tests have been added to verify both the typing behavior and the case toggle functionality work correctly.

Copilot AI changed the title Implement case-sensitive glob search toggle with 'I' shortcut Implement case-sensitive glob search toggle with Ctrl+I shortcut Sep 14, 2025
Copilot finished work on behalf of Byron September 14, 2025 06:40
@Byron Byron force-pushed the copilot/fix-2a5bb691-5ca0-4cf5-af1c-895f4fcb1f06 branch 2 times, most recently from 313b923 to a86fb87 Compare September 15, 2025 03:47
@Byron Byron force-pushed the copilot/fix-2a5bb691-5ca0-4cf5-af1c-895f4fcb1f06 branch from a86fb87 to bbe368f Compare September 15, 2025 03:48
@Byron Byron marked this pull request as ready for review September 15, 2025 03:49
@Byron Byron merged commit 91bc45d into main Sep 15, 2025
2 checks passed
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.

Allow case *sensitive* glob search

3 participants