ki-editor / ki-editor

https://ki-editor.github.io/ki-editor/
Mozilla Public License 2.0
194 stars 17 forks source link

Case Agnostic mode is confusing (was: Regex search mode seems to always be case agnostic) #333

Closed ilyagr closed 1 week ago

ilyagr commented 1 month ago

I searched for Dispatch\b and then pressed gx to make it a Regex search.

I have dispatch highlighted as a match, even though the search is supposedly not case agnostic.

Update: In fact, I'm getting something similar for literal search as well. Also, after search settings are changed, the search doesn't seem to be updated correctly (though I'm not sure enough what happens to file a bug report).

wongjiahau commented 1 month ago

Hey @ilyagr, I think there’s some misunderstanding here, to enter Regex mode you should press g , x, did you press the comma?

ilyagr commented 1 month ago

Yes, that's what I meant, sorry.

I now notice that there are two similar-looking options: g,c for "Case Agnostic" and g,i for "Case-sensitive". The latter seems to work OK. The former seems weird and confusing. Perhaps it should be removed?

wongjiahau commented 1 month ago

They have different purposes, because case-agnostic doesn’t mean uppercase or lowercase, it means kebab case, snake case, pascal case and etc.

For example, in case-agnostic mode, searching hello world matches hello_world, HelloWorld, hello-world and etc.

I guess I might need a better name for “case-agnostic”, do you have any recommendations?

ilyagr commented 1 month ago

Ah, that's tricky. The first suggestion that comes to mind is to call it "Join Words" and explain it in detail in the docs.

I definitely think it should be renamed. Even if we cannot come up with a perfect name, we should come up with a name that isn't confusing with another commonly used feature.

Also, thanks for explaining, it's an interesting idea!

wongjiahau commented 1 month ago

How about "Naming-convention agnostic"?

ilyagr commented 1 month ago

"Naming-convention agnostic" is much better than "Case Agnostic". I find it still quite confusing, but it would at least be clear it's not the same as case-sensitive.

Another idea I had: "Identifier From Words". Or maybe "Identifier From Joined Words"?

I'll let you know if something else comes to mind.