Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert commit 984e8d790469eb088c0f006841a7e4c8459a92c3 (g?/rot13) due to regression in visual mode motions #293

Merged
merged 1 commit into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/Actions/Case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@ export class ActionCase {
.then(() => ActionReveal.primaryCursor());
}

@StaticReflect.metadata(SymbolMetadata.Action.isChange, true)
static rot13Selections(): Thenable<boolean> {
const activeTextEditor = window.activeTextEditor;

if (!activeTextEditor) {
return Promise.resolve(false);
}

return activeTextEditor
.edit((editBuilder) => {
activeTextEditor.selections.forEach((selection) => {
const text = activeTextEditor.document.getText(selection);
editBuilder.replace(selection, UtilText.rot13(text));
});
})
.then(() => ActionReveal.primaryCursor());
}

@StaticReflect.metadata(SymbolMetadata.Action.isChange, true)
static switchActives(args: { n?: number }): Thenable<boolean> {
args.n = args.n === undefined ? 1 : args.n;
Expand Down
4 changes: 0 additions & 4 deletions src/Modes/Visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ export class ModeVisual extends Mode {
keys: 'U',
actions: [ActionCase.uppercaseSelections, ActionSelection.shrinkToStarts],
},
{
keys: 'g ?',
actions: [ActionCase.rot13Selections, ActionSelection.shrinkToStarts],
},

{ keys: '=', actions: [ActionFilter.Format.bySelections] },

Expand Down
4 changes: 0 additions & 4 deletions src/Modes/VisualLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ export class ModeVisualLine extends Mode {
keys: 'U',
actions: [ActionCase.uppercaseSelections, ActionSelection.shrinkToStarts],
},
{
keys: 'g ?',
actions: [ActionCase.rot13Selections, ActionSelection.shrinkToStarts],
},

{ keys: '=', actions: [ActionFilter.Format.bySelections] },

Expand Down
6 changes: 0 additions & 6 deletions src/Utils/Text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ export class UtilText {
return to;
}

static rot13(text: string): string {
return text.replace(/[a-z]/gi, (char) =>
String.fromCharCode(char.charCodeAt(0) + (char.toUpperCase() > 'M' ? -13 : 13)),
);
}

static countStringAppearance(searchString: string, text: string): number {
let count = 0;
let position = -1;
Expand Down
35 changes: 0 additions & 35 deletions test/ModeVisual/rot13.test.ts

This file was deleted.

35 changes: 0 additions & 35 deletions test/ModeVisualLine/rot13.test.ts

This file was deleted.