Skip to content

Commit 65377b2

Browse files
committed
feat: use tab to exclude files setting
1 parent 84e8b92 commit 65377b2

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

src/settings/appSettings.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import fsOperation from "fileSystem";
66
import actions from "handlers/quickTools";
77
import actionStack from "lib/actionStack";
88
import constants from "lib/constants";
9+
import EditorFile from "lib/editorFile";
910
import lang from "lib/lang";
1011
import openFile from "lib/openFile";
1112
import appSettings from "lib/settings";
@@ -157,7 +158,7 @@ export default function otherSettings() {
157158
{
158159
key: "excludeFolders",
159160
text: strings["exclude files"],
160-
value: values.excludeFolders.join("\n"),
161+
/*value: values.excludeFolders.join("\n"),
161162
prompt: strings["exclude files"],
162163
promptType: "textarea",
163164
promptOptions: {
@@ -166,7 +167,7 @@ export default function otherSettings() {
166167
return item.trim().length > 0;
167168
});
168169
},
169-
},
170+
},*/
170171
},
171172
{
172173
key: "defaultFileEncoding",
@@ -261,11 +262,24 @@ export default function otherSettings() {
261262
break;
262263

263264
case "excludeFolders":
264-
value = value
265-
.split("\n")
266-
.map((item) => item.trim())
267-
.filter((item) => item.length > 0);
268-
break;
265+
actionStack.pop(actionStack.length);
266+
const editor = new EditorFile(strings["exclude files"], {
267+
text: values.excludeFolders.join("\n"),
268+
});
269+
editor.onsave = function (event) {
270+
event.preventDefault();
271+
const data = editor.session.getValue();
272+
273+
appSettings.update({
274+
[key]: data
275+
.split("\n")
276+
.map((item) => item.trim())
277+
.filter((item) => item.length > 0),
278+
});
279+
280+
editor.isUnsaved = false;
281+
};
282+
return;
269283

270284
default:
271285
break;

0 commit comments

Comments
 (0)