Skip to content

Commit 415cac9

Browse files
committed
PR Fixes
1 parent 91bc9d6 commit 415cac9

14 files changed

Lines changed: 149 additions & 123 deletions

File tree

.vscode/launch.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
"outFiles": ["${workspaceFolder}/out/**/*.js"],
1111
},
1212
{
13-
"name": "Launch extension with helix keybinds",
13+
"name": "Launch extension with Helix keybindings",
1414
"type": "extensionHost",
1515
"request": "launch",
1616
"runtimeExecutable": "${execPath}",
1717
"args": [
18-
"${workspaceFolder}/.vscode-test",
1918
"--extensionDevelopmentPath=${workspaceFolder}",
2019
"--extensionDevelopmentPath=${workspaceFolder}/extensions/helix/",
2120
],

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,7 @@
3838
},
3939
},
4040
},
41+
"[typescript]": {
42+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
43+
},
4144
}

extensions/helix/package.build.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { Builder, generateIgnoredKeybinds } from "../../meta";
55
import * as fs from "fs/promises";
6-
import { SelectionBehavior } from "../../src/api";
6+
import { extensionName } from "../../src/utils/constants";
77

88
const version = "0.1.0",
99
preRelease = 1,
@@ -14,16 +14,23 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
1414
// Common package.json properties.
1515
// ==========================================================================
1616

17-
name: "dance-helix-keybinds",
18-
description: "Helix keybindings for dance",
17+
name: "dance-helix-keybindingss",
18+
description: "Helix keybindings for Dance",
1919
version,
2020
license: "ISC",
21-
21+
extensionDependencies: [extensionName],
2222
author: {
2323
name: "Grégoire Geis",
2424
email: "opensource@gregoirege.is",
2525
},
2626

27+
contributors: [
28+
{
29+
name: "Rémi Lavergne",
30+
url: "https://github.com/Strackeror",
31+
},
32+
],
33+
2734
repository: {
2835
type: "git",
2936
url: "https://github.com/71/dance.git",
@@ -33,7 +40,7 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
3340
vscode: "^1.63.0",
3441
},
3542

36-
displayName: "Dance",
43+
displayName: "Dance (Helix keybindings)",
3744
publisher: "gregoire",
3845
categories: ["Keymaps", "Other"],
3946
readme: "README.md",

extensions/helix/package.json

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

meta.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,13 @@ function getKeybindings(module: Omit<Builder.ParsedModule, "keybindings">): Buil
653653
].sort((a, b) => a.command.localeCompare(b.command));
654654
}
655655

656+
/**
657+
* Takes a list of keybindings and generates `dance.ignore` keybindings for
658+
* common keys that are unused. This is used for modes where we don't want the
659+
* user to be able to type
660+
*/
656661
export function generateIgnoredKeybinds(
657-
currentKeybindings: Builder.Keybinding[],
662+
currentKeybindings: readonly Builder.Keybinding[],
658663
when: string,
659664
): Builder.Keybinding[] {
660665
const alphanum = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"],

package.build.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const builtinModesAreDeprecatedMessage =
2222
"Built-in modes are deprecated. Use `#dance.modes#` instead.";
2323

2424
const modeNamePattern = {
25-
pattern: /^[a-zA-Z]\w*\/?\w*$/.source,
25+
pattern: /^[a-zA-Z]\w*(\/\w+)?$/.source,
2626
patternErrorMessage: "",
2727
};
2828

@@ -129,7 +129,11 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
129129
"publish": "vsce publish --allow-star-activation",
130130
"package:pre": `vsce package --allow-star-activation --pre-release --no-git-tag-version --no-update-package-json ${version.replace(/\d+$/, "$&" + preRelease.toString().padStart(3, "0"))}`,
131131
"publish:pre": `vsce publish --allow-star-activation --pre-release --no-git-tag-version --no-update-package-json ${version.replace(/\d+$/, "$&" + preRelease.toString().padStart(3, "0"))}`,
132-
"package-helix": `cd extensions/helix && npm run package`,
132+
133+
"package-helix": `cd extensions/helix && yarn run package`,
134+
"publish-helix": `cd extensions/helix && yarn run publish`,
135+
"package-helix:pre": `cd extensions/helix && yarn run package:pre`,
136+
"publish-helix:pre": `cd extensions/helix && yarn run publish:pre`,
133137
},
134138

135139
devDependencies: {
@@ -763,7 +767,7 @@ export const pkg = (modules: Builder.ParsedModule[]) => ({
763767

764768
return [
765769
...keybindings,
766-
...generateIgnoredKeybinds(keybindings,`editorTextFocus && dance.mode == 'normal'`),
770+
...generateIgnoredKeybinds(keybindings, `editorTextFocus && dance.mode == 'normal'`),
767771
];
768772
})(),
769773

package.json

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/data/commands.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,15 +1814,15 @@ select.line.below.extend:
18141814
title:
18151815
en: Extend to line below
18161816

1817-
doc:
1818-
en: |
1819-
Extend to line below.
1820-
18211817
keys:
18221818
qwerty: |-
18231819
`x` (helix: normal)
18241820
`x` (helix: select)
18251821
1822+
doc:
1823+
en: |+
1824+
Extend to line below.
1825+
18261826
select.lineEnd:
18271827
title:
18281828
en: Select to line end
@@ -2759,7 +2759,7 @@ anonymous:
27592759
en: Open match menu with extend
27602760

27612761
commands: |-
2762-
[".openMenu", { menu: "match", pass: [{shift: "extend"}] }]
2762+
[".openMenu", { menu: "match", pass: [{ shift: "extend" }] }]
27632763
27642764
keys:
27652765
qwerty: |-

src/api/modes.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,10 @@ function findMode(modeName: string, context?: Context) {
7070
split = currentMode.name.split("/");
7171
if (split.length === 2) {
7272
const namespacedMode = context.extension.modes.get(`${split[0]}/${modeName}`);
73-
if (namespacedMode) {
73+
if (namespacedMode !== undefined) {
7474
return namespacedMode;
7575
}
7676
}
7777

78-
const directMode = context.extension.modes.get(modeName);
79-
if (directMode) {
80-
return directMode;
81-
}
82-
83-
return undefined;
78+
return context.extension.modes.get(modeName);
8479
}

src/commands/README.md

Lines changed: 31 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)