Skip to content

Commit

Permalink
Addd table close command
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Oct 28, 2023
1 parent b5e753b commit 7f31e4a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/components/editor/util/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,21 @@ const Commands: Command[] = [
return caret.insert(TABLE_OPEN_SYMBOL) ?? false;
},
},
{
symbol: TABLE_CLOSE_SYMBOL,
description: (l) => l.ui.source.cursor.insertTable,
visible: Visibility.Visible,
category: Category.Insert,
alt: true,
shift: true,
control: false,
key: 'KeyT',
keySymbol: 't',
execute: ({ caret }) => {
if (caret === undefined) return false;
return caret.insert(TABLE_CLOSE_SYMBOL) ?? false;
},
},

// EVALUATE
StepBackNode,
Expand Down
2 changes: 2 additions & 0 deletions src/locale/UITexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ type UITexts = {
insertConvert: string;
/** Insert table symbol */
insertTable: string;
/** Insert table close symbol */
insertTableClose: string;
/** Insert new line */
insertLine: string;
/** Delete previous symbol */
Expand Down
3 changes: 2 additions & 1 deletion src/locale/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3865,7 +3865,8 @@
"insertStream": "insert stream symbol",
"insertConvert": "insert convert symbol",
"insertPrevious": "insert previous symbol",
"insertTable": "insert table symbol",
"insertTable": "insert table open symbol",
"insertTableClose": "insert table close symbol",
"insertLine": "insert line break",
"backspace": "delete selection or prior character",
"cut": "cut selection",
Expand Down
1 change: 1 addition & 0 deletions static/locales/es-MX/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,7 @@
"insertPrevious": "insertar símbolo de anterior",
"insertType": "insertar símbolo de tipo",
"insertTable": "insertar símbolo de tabla",
"insertTableClose": "$?",
"insertLine": "insertar salto de línea",
"backspace": "borrar selección o carácter anterior",
"cut": "corte lo que esté seleccionado",
Expand Down
1 change: 1 addition & 0 deletions static/locales/example/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,7 @@
"insertPrevious": "$?",
"insertType": "$?",
"insertTable": "$?",
"insertTableClose": "$?",
"insertLine": "$?",
"backspace": "$?",
"cut": "$?",
Expand Down
1 change: 1 addition & 0 deletions static/locales/zh-CN/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,7 @@
"insertPrevious": "$?",
"insertType": "$?",
"insertTable": "$?",
"insertTableClose": "$?",
"insertLine": "$?",
"backspace": "$?",
"cut": "$?",
Expand Down
5 changes: 5 additions & 0 deletions static/schemas/Locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -9696,6 +9696,10 @@
"description": "Insert table symbol",
"type": "string"
},
"insertTableClose": {
"description": "Insert table close symbol",
"type": "string"
},
"insertTrue": {
"description": "Insert true symbol",
"type": "string"
Expand Down Expand Up @@ -9802,6 +9806,7 @@
"insertPrevious",
"insertConvert",
"insertTable",
"insertTableClose",
"insertLine",
"backspace",
"copy",
Expand Down

0 comments on commit 7f31e4a

Please sign in to comment.