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

Retrospective capitalization commands are inconsistent #1049

Closed
SeaLiteral opened this issue Feb 19, 2019 · 2 comments
Closed

Retrospective capitalization commands are inconsistent #1049

SeaLiteral opened this issue Feb 19, 2019 · 2 comments

Comments

@SeaLiteral
Copy link

Summary

The "uppercase last word" and "lowercase last word" commands have different rules for what they change. Using the former and then the latter on a word produces words where the first letter is lowered and everything else is uppered. That's probably not the intended behavior.

Reproducing

Map strokes to the two actions and compare what they do.

  • Map one stroke {*<} to and one to {*>}.
  • Write a word with several letters, preferably something with an uppercase letter somewhere else than in the start. For example, you could write iPod.

Expected results:

The word comes out, the first command puts it in all-caps (IPOD), the second one lowercases the whole word (ipod).

Actual results

The last stroke lowercases the first character, leaving the first one uppercased (iPOD).

Plover version and system

Running from source on Ubuntu.

What I've done to debug this

Since this had to do with built in commands, I decided to look at formatting.py and see if I could see what the commands were supposed to do. I checked the list of meta-to-action mappings and it seems the parameters passed to _apply_meta_retro_case have names that explain it: META_RETRO_UPPER uses CASE_UPPER_FIRST_WORD, but META_RETRO_LOWER uses CASE_LOWER_FIRST_CHAR. That could probably be changed to CASE_LOWER_FIRST_WORD, but some people might be used to the old behaviour, so maybe another solution is to create a new command that uses CASE_LOWER_FIRST_WORD. In any case, CASE_LOWER_FIRST_WORD would have to exist, in order to lowercase the entire word, and then you'd probably need a _lower_first_word function similar to the _upper_first word function. I could do this, but I think it should be easy enough for someone else. Or I could come back and look at it when I'm not as tired as I am now (it's half past 11 pm).

@benoit-pierre
Copy link
Member

Yeah, we can't change it without breaking compatibility, but #1069 will provide a (more user-friendly) way to access all the different case modes.

@benoit-pierre
Copy link
Member

Closing, since #1069 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants