Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit bb844b5

Browse files
committed
Remove deleting word by Ctrl+W (Use Ctrl+Backspace instead).
1 parent d24e555 commit bb844b5

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

src/Enums.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export enum KeyboardAction {
102102
// CLI commands
103103
cliRunCommand,
104104
cliClearJobs,
105-
cliDeleteWord,
106105
cliClearText,
107106
cliAppendLastArgumentOfPreviousCommand,
108107
cliHistoryPrevious,

src/views/1_ApplicationComponent.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,6 @@ export class ApplicationComponent extends React.Component<{}, ApplicationState>
234234
return;
235235
}
236236

237-
// CLI Delete word
238-
if (isKeybindingForEvent(event, KeyboardAction.cliDeleteWord)) {
239-
jobFormComponent.deleteWord();
240-
241-
event.stopPropagation();
242-
event.preventDefault();
243-
return;
244-
}
245-
246237
// CLI execute command
247238
if (isKeybindingForEvent(event, KeyboardAction.cliRunCommand)) {
248239
jobFormComponent.execute((event.target as HTMLElement).innerText);

src/views/3_JobFormComponent.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -128,28 +128,6 @@ export class JobFormComponent extends React.Component<Props, State> {
128128
}
129129
}
130130

131-
async deleteWord(current = this.prompt.value, position = getCaretPosition(this.commandNode)): Promise<void> {
132-
if (!current.length) {
133-
return;
134-
}
135-
136-
const lastIndex = current.substring(0, position).lastIndexOf(" ");
137-
const endsWithASpace = lastIndex === current.length - 1;
138-
139-
current = current.substring(0, lastIndex);
140-
141-
if (endsWithASpace) {
142-
this.deleteWord(current, position);
143-
} else {
144-
if (current.length) {
145-
current += " ";
146-
}
147-
148-
this.prompt.setValue(current + this.prompt.value.substring(getCaretPosition(this.commandNode)));
149-
this.setDOMValueProgrammatically(this.prompt.value);
150-
}
151-
}
152-
153131
setPreviousHistoryItem(): void {
154132
this.setText(History.getPrevious());
155133
}

src/views/keyevents/Keybindings.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ export const KeybindingsForActions: KeybindingType[] = [
3030
action: KeyboardAction.cliClearJobs,
3131
keybinding: (e: KeyboardEvent) => e.ctrlKey && e.keyCode === KeyCode.L,
3232
},
33-
{
34-
action: KeyboardAction.cliDeleteWord,
35-
keybinding: (e: KeyboardEvent) => e.ctrlKey && e.keyCode === KeyCode.W,
36-
},
3733
{
3834
action: KeyboardAction.cliClearText,
3935
// Need to include !shiftKey otherwise it will clear instead of copying

0 commit comments

Comments
 (0)