google / ci_edit

A terminal text editor with mouse support and ctrl+Q to quit.
Apache License 2.0
222 stars 53 forks source link

Incorrect word is half highlighted in red #90

Closed aaxu closed 7 years ago

aaxu commented 7 years ago

image

aaxu commented 7 years ago

It looks like this is happening because it thinks that words are separated based on the capitalization of the characters rather than the spacing. Something like split a long word into multiple words by grabbing the first capital letter that appears before lowercase characters

for instance: HELLOthere would split into 'HELL' and 'OTHERE'. HELLOthereNOTaword would become 'HELL', 'Othere', 'NO', 'Taword' HELLOthereNEWWORD would become 'HELL', 'Othere', 'NEWWORD'

dschuyler commented 7 years ago

100% right.

It's expecting CamelCaseCombinedWords.

So it sees URIs and URLs as UR Is and UR ls.

aaxu commented 7 years ago

Do you think we should highlight camelCase words? I think that in most cases, camel case would be used by programmers and many times, variable names aren't whole words. Maybe for camelCase, we can see if it matches any of the already existing camelCase words in the document so it would be like a variable name check rather than a grammer check?

aaxu commented 7 years ago

Update: found another bug that doesn't look like camel case.

highlight_bug

aaxu commented 7 years ago

More weird interactions with highlighting.

highlight_bug_2

dschuyler commented 7 years ago

The last two comments showing weird spell checking behavior on the last line should now be fixed.

aaxu commented 7 years ago

Now, when you open/create a new file from the program, highlights will not work until you save and reopen.

dschuyler commented 7 years ago

Was that in the last (or only) line in the file? There was a problem with doing highlighting on the last line of the file that I recently fixed.

aaxu commented 7 years ago

It is happening in the entire file. A newly created file will not have any highlighting at all until you save and reopen.

dschuyler commented 7 years ago

I'm going to fix the initial bug report and close this. Please open a different issue if there's more to be fixed :)