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

find and subsitute not match case #195

Open
SomaLily opened this issue Nov 13, 2024 · 4 comments
Open

find and subsitute not match case #195

SomaLily opened this issue Nov 13, 2024 · 4 comments

Comments

@SomaLily
Copy link

image

This can be confusing when one wants to replace keys.

@firai
Copy link

firai commented Nov 13, 2024

Not entirely sure I'm looking at the right parts of the code, but it seems like ignoreCase and smartCase may have hardcoded values at various places, but the options seem to be available in the functions? So maybe new options to change the parameters would be needed?

handleQuery(query, true /** ignoreCase */, true /** smartCase */);

codemirror-vim/src/vim.js

Lines 1702 to 1703 in 59c44ef

parsedQuery = updateSearchQuery(cm, lastQuery,
true /** ignoreCase */, true /** smartCase */);

handleQuery(query, true /** ignoreCase */, false /** smartCase */);

handleQuery(query, true /** ignoreCase */, false /** smartCase */);

@nightwing
Copy link
Collaborator

vim has ignorecase and smartcase options, which we can implement as well, but i think we should not change the default here to match the default in vim.

@firai
Copy link

firai commented Nov 13, 2024

It seems like the defaults in codemirror-vim are different than the vim defaults right now. vim defaults for both ignorecase and smartcase are both off, while codemirror-vim default seems to behave as if smartcase is on, which in turn implies that ignorecase is also on (for vim).

@nightwing
Copy link
Collaborator

Yes, i think turning smarcase on by default was an intentional choice of the author of vim mode for codemirror5 codemirror/codemirror5#2302 (comment)

By default we have javascript regex mode turned on, and it is more natural in this mode to have a default that is common in other modern editors, the people who want exactly vim behavior who already have to change the setting for pcre can change ic setting as well .

Perhaps we should change the text on the right side to 3 buttons pcre ic scs?

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

No branches or pull requests

3 participants