Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6e916f0
Update zh-cn.json and zh-hant.json (#3022)
LaunchLee Nov 9, 2026
f066852
chore(lang): translate remaining Azerbaijani UI strings (#3012)
jamalkamaladdin Nov 9, 2026
33314a3
fix(styles): guard color-mix() with @supports for old WebViews (#3025)
bajrangCoder Nov 9, 2026
7cd14b6
chore(deps): bump @acode.app/canvas-view to 0.0.5
bajrangCoder Nov 9, 2026
71235fe
fix(search): expand regex capture groups in native replace (#3033)
bajrangCoder Nov 11, 2026
20abca4
perf(tabs): speed up closing and saving many tabs (#3035)
bajrangCoder Nov 11, 2026
2591646
Translation: Update hu-hu.json (#3046)
summoner001 Nov 12, 2026
b2e4e57
fix: allow replace all with an empty replacement (#3048)
bardrop Nov 13, 2026
9a5ef12
feat: add hints to search in files search options (#3042)
Mittalnew Nov 13, 2026
a5d5a22
chore(deps): bump ghcr.io/devcontainers/features/node (#3052)
dependabot[bot] Nov 13, 2026
f040ba7
chore(deps): bump sigstore/cosign-installer from 4.1.2 to 4.1.3 (#3053)
dependabot[bot] Nov 13, 2026
31f23f6
chore(deps): bump @acode.app/canvas-view to 0.0.7
bajrangCoder Nov 13, 2026
0b118ac
feat(editor): see-through canvas behind a plugin's background picture
bajrangCoder Nov 13, 2026
79d845a
feat(editor): canvasMagnifier setting for the canvas selection magnifier
bajrangCoder Nov 13, 2026
4271d91
fix(editor): clear native selection handles when the editor loses foc…
bajrangCoder Nov 13, 2026
add579b
fix(editor): hide canvas fold markers when code folding is off (#3067)
bajrangCoder Nov 13, 2026
91a38f8
fix(scrollbar): don't reopen the keyboard when dragging the scrollbar…
bajrangCoder Nov 13, 2026
cede3c4
feat(editor): let themes set the canvas gutter border (#3070)
bajrangCoder Nov 13, 2026
1d461a1
fix(editor): canvas theme colors for plugin themes styled in CSS (#3072)
bajrangCoder Nov 14, 2026
1a4d04a
chore(deps): bump @acode.app/canvas-view to 0.0.9
bajrangCoder Nov 14, 2026
cd5409b
test(canvas): run canvasOptions tests under happy-dom
bajrangCoder Nov 15, 2026
364d2f2
refactor(editor): take canvas theme colors from the theme's CSS (#3088)
bajrangCoder Nov 15, 2026
df608ac
docs(contributing): add rules for performance changes
bajrangCoder Nov 16, 2026
be472de
chore(deps): bump @acode.app/canvas-view to 0.0.11
bajrangCoder Nov 16, 2026
a3feeaa
update: translate strings in es-sv (#3015)
UnschooledGamer Nov 20, 2026
e903103
chore(deps): bump @lezer/common to 1.5.6
bajrangCoder Nov 22, 2026
47fa24a
fix(ios): expand regex capture groups in native replace
bajrangCoder Nov 22, 2026
9a3f5a3
Merge Acode-migration main into chore/sync-acode-main-7a667de9
bajrangCoder Nov 22, 2026
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
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/node:2.1": {
"version": "2.1.1",
"resolved": "ghcr.io/devcontainers/features/node@sha256:2a19d3b0b3879437637cfd292eb29fee0afcfbe6364e33db9afc4f80c5c1f956",
"integrity": "sha256:2a19d3b0b3879437637cfd292eb29fee0afcfbe6364e33db9afc4f80c5c1f956"
"version": "2.1.2",
"resolved": "ghcr.io/devcontainers/features/node@sha256:20ac718cc67e7999a9d3fbb8387f1a3a5d53ecbd41fe7c075ebadb8e9b431b17",
"integrity": "sha256:20ac718cc67e7999a9d3fbb8387f1a3a5d53ecbd41fe7c075ebadb8e9b431b17"
},
"ghcr.io/nordcominc/devcontainer-features/android-sdk:2": {
"version": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
persist-credentials: true

- name: Install cosign
uses: sigstore/cosign-installer@v4.1.2
uses: sigstore/cosign-installer@v4.1.3

- name: Set Publish Metadata
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ tsconfig.tsbuildinfo
.dev-cert.pem
.dev-key.pem
.pnpm-store/
pnpm-workspace.yaml
pnpm-workspace.yml
platforms/android/**/build/
platforms/android/.gradle/
platforms/**/bundle/
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,16 @@ We use [Biome](https://biomejs.dev/) for linting and formatting:
- Run `npm run check` before committing
- Install the Biome VS Code extension for auto-formatting

### Performance Changes

Performance PRs must show a real, measurable improvement in Acode itself:

- Include a profile from the app (for example, Chrome DevTools connected to the Android WebView) showing that the code you change is an actual bottleneck in something the user waits on.
- Include before/after numbers measured in the app, with the device and steps used.
- Microbenchmark results from sites like jsbench or measurethat are not accepted on their own. They time a function in a tight loop and say nothing about its effect in the app.
- Keep the change focused on the bottleneck. Don't mix in rewrites of unrelated code, build scripts, Cordova hooks or vendored files.
- The change must not alter behavior. Point out any output that differs from before.

### Commit Messages

Use clear, descriptive messages:
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"ws": "^8.21.3"
},
"dependencies": {
"@acode.app/canvas-view": "^0.0.4",
"@acode.app/canvas-view": "^0.0.11",
"@codemirror/autocomplete": "^6.20.3",
"@codemirror/commands": "^6.11.0",
"@codemirror/lang-angular": "^0.1.4",
Expand Down Expand Up @@ -110,7 +110,7 @@
"@codemirror/view": "^6.43.14",
"@deadlyjack/ajax": "^1.2.6",
"@emmetio/codemirror6-plugin": "^0.4.1",
"@lezer/common": "^1.5.5",
"@lezer/common": "^1.5.6",
"@lezer/highlight": "^1.2.5",
"@lezer/lr": "^1.4.10",
"@ungap/custom-elements": "^1.3.0",
Expand Down Expand Up @@ -163,7 +163,7 @@
"@codemirror/search": "^6.7.1",
"@codemirror/state": "^6.7.6",
"@codemirror/view": "^6.43.14",
"@lezer/common": "^1.5.5",
"@lezer/common": "^1.5.6",
"@lezer/lr": "^1.4.10",
"tar": "^7.5.22"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1009,8 +1009,11 @@ private void runSearch(Job job, JSONObject options, Callback callback)
}

if ("replace".equals(mode)) {
String replacement = Matcher.quoteReplacement(replace == null ? "" : replace);
String text = pattern.matcher(new SearchInput(content, job)).replaceAll(replacement);
String replacement = replace == null ? "" : replace;
Matcher matcher = pattern.matcher(new SearchInput(content, job));
String text = searchOptions.optBoolean("regExp", false)
? replaceAllJs(matcher, content, replacement)
: matcher.replaceAll(Matcher.quoteReplacement(replacement));
JSONObject result = baseEvent(job.id, "replace-result");
result.put("file", file);
result.put("text", text);
Expand All @@ -1026,6 +1029,135 @@ private void runSearch(Job job, JSONObject options, Callback callback)
send(callback, baseEvent(job.id, "replace".equals(mode) ? "done-replacing" : "done-searching"), false);
}

/**
* Replaces every match using JavaScript String.prototype.replace substitution
* rules ($$, $&, $`, $', $1..$99, $<name>), so regex replacements behave the
* same as the JS worker path.
*/
static String replaceAllJs(Matcher matcher, String content, String replace) {
StringBuilder out = new StringBuilder(content.length());
boolean namedGroups = hasNamedGroups(matcher.pattern().pattern());
int last = 0;
while (matcher.find()) {
out.append(content, last, matcher.start());
appendJsSubstitution(out, matcher, content, replace, namedGroups);
last = matcher.end();
}
out.append(content, last, content.length());
return out.toString();
}

/**
* Whether the pattern declares a named capture group, ignoring escaped text,
* \Q...\E quotes and character classes.
*/
static boolean hasNamedGroups(String pattern) {
int len = pattern.length();
int classDepth = 0;
for (int i = 0; i < len; i++) {
char c = pattern.charAt(i);
if (c == '\\') {
if (i + 1 < len && pattern.charAt(i + 1) == 'Q') {
int end = pattern.indexOf("\\E", i + 2);
if (end == -1) return false;
i = end + 1;
} else {
i++;
}
} else if (classDepth > 0) {
if (c == '[') classDepth++;
else if (c == ']') classDepth--;
} else if (c == '[') {
classDepth = 1;
if (i + 1 < len && pattern.charAt(i + 1) == '^') i++;
if (i + 1 < len && pattern.charAt(i + 1) == ']') i++;
} else if (
c == '(' &&
i + 3 < len &&
pattern.charAt(i + 1) == '?' &&
pattern.charAt(i + 2) == '<' &&
Character.isLetter(pattern.charAt(i + 3))
) {
return true;
}
}
return false;
}

private static void appendJsSubstitution(
StringBuilder out,
Matcher matcher,
String content,
String replace,
boolean namedGroups
) {
int groups = matcher.groupCount();
int len = replace.length();
for (int i = 0; i < len; i++) {
char c = replace.charAt(i);
if (c != '$' || i + 1 >= len) {
out.append(c);
continue;
}

char next = replace.charAt(i + 1);
if (next == '$') {
out.append('$');
i++;
} else if (next == '&') {
out.append(content, matcher.start(), matcher.end());
i++;
} else if (next == '`') {
out.append(content, 0, matcher.start());
i++;
} else if (next == '\'') {
out.append(content, matcher.end(), content.length());
i++;
} else if (next >= '0' && next <= '9') {
int index = next - '0';
int consumed = 1;
if (i + 2 < len) {
char digit = replace.charAt(i + 2);
if (digit >= '0' && digit <= '9') {
int twoDigit = index * 10 + (digit - '0');
if (twoDigit >= 1 && twoDigit <= groups) {
index = twoDigit;
consumed = 2;
}
}
}
if (index >= 1 && index <= groups) {
String group = matcher.group(index);
if (group != null) out.append(group);
i += consumed;
} else {
out.append(c);
}
} else if (next == '<') {
int close = replace.indexOf('>', i + 2);
boolean found = false;
String group = null;
if (close != -1) {
try {
group = matcher.group(replace.substring(i + 2, close));
found = true;
} catch (IllegalArgumentException ignored) {
// JS: an unknown name is empty when the pattern has named groups.
found = namedGroups;
}
}
if (found) {
if (group != null) out.append(group);
i = close;
} else {
out.append(c);
}
} else {
out.append(c);
}
}
}

private Pattern compileSearchPattern(String search, JSONObject options)
throws PatternSyntaxException {
boolean regExp = options.optBoolean("regExp", false);
Expand Down
17 changes: 9 additions & 8 deletions platforms/ios/runner/lib/workspace/WorkspaceMatches.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ final class WorkspaceMatches {
func search(_ emit: ([[String: Any]], Bool) -> Void) throws {
var batch: [[String: Any]] = []
var count = 0, cursor = 0, row = 0, column = 0
try enumerate { range in
try enumerate { match in
let range = match.range
if count == 5000 { emit(batch, true); batch.removeAll(); return false }
let word = self.source.substring(with: NSRange(location: range.location, length: min(160, range.length)))
try self.advance(to: range.location, cursor: &cursor, row: &row, column: &column)
Expand All @@ -28,25 +29,25 @@ final class WorkspaceMatches {
if !batch.isEmpty { emit(batch, false) }
}

func replace(_ replacement: String) throws -> String {
func replace(_ replacement: WorkspaceReplacement) throws -> String {
let result = NSMutableString(capacity: source.length)
var cursor = 0
try enumerate { range in
result.append(self.source.substring(with: NSRange(location: cursor, length: range.location - cursor)))
result.append(replacement)
cursor = NSMaxRange(range)
try enumerate { match in
result.append(self.source.substring(with: NSRange(location: cursor, length: match.range.location - cursor)))
result.append(replacement.expand(match, in: self.source))
cursor = NSMaxRange(match.range)
return true
}
result.append(source.substring(from: cursor))
return result as String
}

private func enumerate(_ match: (NSRange) throws -> Bool) throws {
private func enumerate(_ match: (NSTextCheckingResult) throws -> Bool) throws {
var failure: Error?
regex.enumerateMatches(in: text, options: [.reportProgress], range: NSRange(location: 0, length: source.length)) { result, flags, stop in
do {
try self.check()
if let result, try !match(result.range) { stop.pointee = true }
if let result, try !match(result) { stop.pointee = true }
if flags.contains(.internalError) { throw WorkspaceFailure("Regular expression failed") }
} catch { failure = error; stop.pointee = true }
}
Expand Down
Loading
Loading