ExcludePatterns for OpenCode
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
! From a user (novice) point of view, how does it look like?
|
! From a user (novice) point of view, how does it look like?
|
||||||
|
|
||||||
- We need regex for: [FormatCode matching, IsCode matching,
|
- We need regex for: [FormatCode matching, IsCode matching,
|
||||||
- Project config
|
|
||||||
- IndentKind has issues with stuff still like cleaning whitespace etc.
|
- IndentKind has issues with stuff still like cleaning whitespace etc.
|
||||||
- Remedybg commands integrated! (like clicking f5 and opening up the window)
|
- Remedybg commands integrated! (like clicking f5 and opening up the window)
|
||||||
- Macros
|
- Macros
|
||||||
|
|||||||
@@ -833,23 +833,33 @@ void CMD_SetWorkDirHere() {
|
|||||||
|
|
||||||
void Coro_OpenCode(mco_coro *co) {
|
void Coro_OpenCode(mco_coro *co) {
|
||||||
Array<String> patterns = SplitWhitespace(CoCurr->arena, OpenCodePatterns);
|
Array<String> patterns = SplitWhitespace(CoCurr->arena, OpenCodePatterns);
|
||||||
|
Array<String> exclude_patterns = SplitWhitespace(CoCurr->arena, OpenCodeExcludePatterns);
|
||||||
Array<String> dirs = {CoCurr->arena};
|
Array<String> dirs = {CoCurr->arena};
|
||||||
String *param_dir = (String *)CoCurr->user_ctx;
|
String *param_dir = (String *)CoCurr->user_ctx;
|
||||||
Add(&dirs, *param_dir);
|
Add(&dirs, *param_dir);
|
||||||
for (int diri = 0; diri < dirs.len; diri += 1) {
|
for (int diri = 0; diri < dirs.len; diri += 1) {
|
||||||
for (FileIter it = IterateFiles(CoCurr->arena, dirs[diri]); IsValid(it); Advance(&it)) {
|
for (FileIter it = IterateFiles(CoCurr->arena, dirs[diri]); IsValid(it); Advance(&it)) {
|
||||||
|
bool should_open = true;
|
||||||
if (!it.is_directory) {
|
if (!it.is_directory) {
|
||||||
bool should_open = false;
|
should_open = false;
|
||||||
ForItem (ending, patterns) {
|
ForItem (ending, patterns) {
|
||||||
if (EndsWith(it.absolute_path, ending)) {
|
if (EndsWith(it.absolute_path, ending)) {
|
||||||
should_open = true;
|
should_open = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ForItem (ending, exclude_patterns) {
|
||||||
|
if (EndsWith(it.absolute_path, ending)) {
|
||||||
|
should_open = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!should_open) {
|
if (!should_open) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (it.is_directory) {
|
if (it.is_directory) {
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ RegisterVariable(Float, UndoMergeTime, 0.3);
|
|||||||
RegisterVariable(Float, JumpHistoryMergeTime, 0.3);
|
RegisterVariable(Float, JumpHistoryMergeTime, 0.3);
|
||||||
RegisterVariable(String, InternetBrowser, "firefox");
|
RegisterVariable(String, InternetBrowser, "firefox");
|
||||||
RegisterVariable(String, OpenCodePatterns, ".c .h .cpp .hpp .cc .cxx .rs .go .zig .py .lua .js .ts .jsx .tsx .java .kt .swift .cs .rb .php .html .css .scss .sh .bash .zsh .sql .asm .s .cmake .make .json .yaml .toml .ini .txt .md .rst .Makefile .Dockerfile .gitignore .bashrc .zshrc");
|
RegisterVariable(String, OpenCodePatterns, ".c .h .cpp .hpp .cc .cxx .rs .go .zig .py .lua .js .ts .jsx .tsx .java .kt .swift .cs .rb .php .html .css .scss .sh .bash .zsh .sql .asm .s .cmake .make .json .yaml .toml .ini .txt .md .rst .Makefile .Dockerfile .gitignore .bashrc .zshrc");
|
||||||
|
RegisterVariable(String, OpenCodeExcludePatterns, "");
|
||||||
RegisterVariable(Int, TrimTrailingWhitespace, 1);
|
RegisterVariable(Int, TrimTrailingWhitespace, 1);
|
||||||
RegisterVariable(Int, FormatCode, 0);
|
RegisterVariable(Int, FormatCode, 0);
|
||||||
RegisterVariable(Int, SetModifiesConfig, 1);
|
RegisterVariable(Int, SetModifiesConfig, 1);
|
||||||
Reference in New Issue
Block a user