Skip to content

Commit

Permalink
Stop using “brackets” to mean “braces” (talonhub#1344)
Browse files Browse the repository at this point in the history
I’ve been tripped up repeatedly by how the vocabulary gives me `{}` when
I say “brackets”. In my part of the world, at least, “brackets” are `[]`
and “braces” are `{}`. “Square brackets” is a belt-and-suspenders
redundancy, like “ATM machine” or “PIN number”.

For what it's worth, aegis [agreed with me in
Slack](https://talonvoice.slack.com/archives/C7ERD5Q5T/p1703888321381209)
that there ought to be only one way to refer to these sorts of things.

I looked through [old
Issues](https://github.com/talonhub/community/issues?q=is%3Aissue+bracket)
and [old
PRs](https://github.com/talonhub/community/pulls?q=is%3Apr+bracket) and
nothing explicitly said “we choose to mean that ‘brackets’ are either
curly or square depending on whether you say ‘square’ first.”
  • Loading branch information
adiabatic authored Jan 27, 2024
1 parent f231f62 commit 2f0a066
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
16 changes: 10 additions & 6 deletions core/keys/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,15 @@ def letters(m) -> str:
"apostrophe": "'",
"L square": "[",
"left square": "[",
"brack": "[",
"bracket": "[",
"left bracket": "[",
"square": "[",
"R square": "]",
"right square": "]",
"r brack": "]",
"r bracket": "]",
"right bracket": "]",
"slash": "/",
"backslash": "\\",
"minus": "-",
Expand All @@ -194,14 +200,12 @@ def letters(m) -> str:
"paren": "(",
"brace": "{",
"left brace": "{",
"brack": "{",
"bracket": "{",
"left bracket": "{",
"curly bracket": "{",
"left curly bracket": "{",
"r brace": "}",
"right brace": "}",
"r brack": "}",
"r bracket": "}",
"right bracket": "}",
"r curly bracket": "}",
"right curly bracket": "}",
"angle": "<",
"left angle": "<",
"less than": "<",
Expand Down
4 changes: 2 additions & 2 deletions lang/c/c.talon
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ state default: "default:\nbreak;"

#control flow
#best used with a push like command
#the below example may not work in editors that automatically add the closing bracket
#the below example may not work in editors that automatically add the closing brace
#if so uncomment the two lines and comment out the rest accordingly
push brackets:
push braces:
edit.line_end()
#insert("{")
#key(enter)
Expand Down
8 changes: 4 additions & 4 deletions plugin/symbols/symbols.talon
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ empty escaped (dub string | dub quotes): user.insert_between('\\"', '\\"')
empty string: user.insert_between("'", "'")
empty escaped string: user.insert_between("\\'", "\\'")
(inside parens | args): user.insert_between("(", ")")
inside (squares | square brackets | list): user.insert_between("[", "]")
inside (bracket | braces): user.insert_between("{", "}")
inside (squares | brackets | square brackets | list): user.insert_between("[", "]")
inside (braces | curly brackets): user.insert_between("{", "}")
inside percent: user.insert_between("%", "%")
inside (quotes | string): user.insert_between("'", "'")
inside (double quotes | dub quotes): user.insert_between('"', '"')
inside (graves | back ticks): user.insert_between("`", "`")
angle that:
text = edit.selected_text()
user.paste("<{text}>")
(square | square bracket) that:
(square | bracket | square bracket) that:
text = edit.selected_text()
user.paste("[{text}]")
(bracket | brace) that:
(brace | curly bracket) that:
text = edit.selected_text()
user.paste("{{{text}}}")
(parens | args) that:
Expand Down

0 comments on commit 2f0a066

Please sign in to comment.