Skip to content

find and subsitute not match case #195

Open

Description

@SomaLily

image

This can be confusing when one wants to replace keys.

Activity

  1. firai commented on Nov 13, 2024

    @firai

    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 */);

  2. nightwing commented on Nov 13, 2024

    @nightwing
    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.

  3. firai commented on Nov 13, 2024

    @firai

    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).

  4. nightwing commented on Nov 13, 2024

    @nightwing
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions