Skip to content

Commit c2bcc51

Browse files
committed
remove whitespace on empty lines
1 parent b86c5fb commit c2bcc51

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 150
10+
trim_trailing_whitespace = true

background.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const menus = browser.menus || browser.contextMenus;
99

1010
function openInMpv(url) {
1111
const mpvUrl = `mpv://${url}`;
12-
12+
1313
browser.tabs.update({ url: mpvUrl }).then(() => {
1414
console.debug("navigating to:", mpvUrl);
1515
}, (error) => {
@@ -53,13 +53,13 @@ if (!isChrome) {
5353
browser.webNavigation.onErrorOccurred.addListener((details) => {
5454
// Error code 2152398865 -> kNoContent (mpv)
5555
// Error code 2152398866 -> kUnknownProtocol
56-
56+
5757
if (details.error.endsWith("2152398865")) {
5858
console.debug("opened in mpv");
5959
} else {
6060
console.debug("onErrorOccurred");
6161
console.debug(details);
62-
62+
6363
browser.tabs.create({ url: "setup.sh" });
6464
}
6565
}, filter);

open-in-mpv.plugin.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const settings = { showAgain: true };
1111

1212
function contextMenuPatch(tree, context) {
1313
const href = context.target.href || context.target.parentNode.href
14-
14+
1515
if (href !== undefined) {
1616
tree.props.children.push(BdApi.ContextMenu.buildItem({
1717
type: "separator",
@@ -20,7 +20,7 @@ function contextMenuPatch(tree, context) {
2020
type: "text", label: "open in mpv", action: () => {
2121
console.log("link is " + href);
2222
const electron = require('electron');
23-
23+
2424
electron.shell.openExternal('mpv://' + href).then(() => {
2525
if (settings.showAgain !== false) {
2626
BdApi.UI.showConfirmationModal("Open in mpv",
@@ -29,7 +29,7 @@ function contextMenuPatch(tree, context) {
2929
confirmText: "Download setup.sh", onConfirm: () => {
3030
electron.shell.openExternal('https://raw.githubusercontent.com/binarynoise/open-in-mpv/main/setup.sh');
3131
},
32-
32+
3333
cancelText: "Ok, don't show again", onCancel: () => {
3434
settings.showAgain = false;
3535
BdApi.Data.save("open-in-mpv", "settings", settings);
@@ -60,15 +60,15 @@ function Switch({ value, note, hideBorder, label }) {
6060
return (React.createElement(TheBigBoyBundle.FormSwitch, {
6161
value: enabled, note: note, hideBorder: hideBorder, onChange: e => {
6262
setEnabled(e);
63-
63+
6464
switch (label) {
6565
case "Show Dialog":
6666
settings.showAgain = e;
6767
break;
6868
default:
6969
break;
7070
}
71-
71+
7272
BdApi.Data.save("open-in-mpv", "settings", settings);
7373
},
7474
}, label));
@@ -96,6 +96,6 @@ function isEmpty(obj) {
9696
return false;
9797
}
9898
}
99-
99+
100100
return true
101101
}

0 commit comments

Comments
 (0)