Skip to content

Commit 7936751

Browse files
authored
refactor(editor): Rename WORD_WRAP to TOGGLE_WORD_WRAP and update label to title case (resolves #228). (#234)
1 parent 14082f5 commit 7936751

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/components/Editor/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const handleCopyLogEventAction = (
120120
*
121121
* @param editor
122122
*/
123-
const handleWordWrapAction = (editor: monaco.editor.IStandaloneCodeEditor) => {
123+
const handleToggleWordWrapAction = (editor: monaco.editor.IStandaloneCodeEditor) => {
124124
const currentWordWrap = editor.getRawOptions().wordWrap;
125125
const newWordWrap = "on" === currentWordWrap ?
126126
"off" :
@@ -181,8 +181,8 @@ const Editor = () => {
181181
[HASH_PARAM_NAMES.IS_PRETTIFIED]: !isPrettifiedRef.current,
182182
});
183183
break;
184-
case ACTION_NAME.WORD_WRAP:
185-
handleWordWrapAction(editor);
184+
case ACTION_NAME.TOGGLE_WORD_WRAP:
185+
handleToggleWordWrapAction(editor);
186186
break;
187187
default:
188188
break;

src/utils/actions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum ACTION_NAME {
1414
RELOAD = "reload",
1515
COPY_LOG_EVENT = "copyLogEvent",
1616
TOGGLE_PRETTIFY = "togglePrettify",
17-
WORD_WRAP = "wordWrap",
17+
TOGGLE_WORD_WRAP = "toggleWordWrap",
1818
}
1919

2020
interface EditorAction {
@@ -78,9 +78,9 @@ const EDITOR_ACTIONS : EditorAction[] = [
7878
label: "Toggle Prettify",
7979
},
8080
{
81-
actionName: ACTION_NAME.WORD_WRAP,
81+
actionName: ACTION_NAME.TOGGLE_WORD_WRAP,
8282
keyBindings: [monaco.KeyMod.Alt | monaco.KeyCode.KeyZ],
83-
label: "Toggle word wrap",
83+
label: "Toggle Word Wrap",
8484
},
8585
];
8686

0 commit comments

Comments
 (0)