Skip to content

Commit

Permalink
Added support for user colors (#132)
Browse files Browse the repository at this point in the history
* Added support for user colors

* Limit user colors too 2

* Limit user colors too 2

* Added decamel too cheat sheet

* Remove minus prefix for user colors

* Gave user colors better default names
  • Loading branch information
AndreasArvidsson authored Jan 5, 2022
1 parent adaa817 commit 704c22a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/cheatsheet/get_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ def make_dict_readable(dict, descriptions=None):


def make_readable(text):
return re.sub(r"(?<=[a-z])(?=[A-Z])", " ", text).lower().capitalize()
return de_camel(text).lower().capitalize()


def de_camel(text: str) -> str:
"""Replacing camelCase boundaries with blank space"""
return re.sub(
r"(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|(?<=[a-zA-Z])(?=[0-9])|(?<=[0-9])(?=[a-zA-Z])",
" ",
text,
)
4 changes: 4 additions & 0 deletions src/marks/mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"red": "red",
"pink": "pink",
"yellow": "yellow",
"navy": "userColor1",
"apricot": "userColor2",
}

hat_shapes = {
Expand Down Expand Up @@ -106,6 +108,8 @@ def cursorless_mark(m) -> str:
"red": True,
"pink": True,
"yellow": True,
"userColor1": False,
"userColor2": False,
}

DEFAULT_SHAPE_ENABLEMENT = {
Expand Down

0 comments on commit 704c22a

Please sign in to comment.