mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix: code interpreter code editor issue
Some checks failed
Deploy to HuggingFace Spaces / check-secret (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Deploy to HuggingFace Spaces / deploy (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda126-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
Some checks failed
Deploy to HuggingFace Spaces / check-secret (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Deploy to HuggingFace Spaces / deploy (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda126-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
This commit is contained in:
parent
b6e2b2e514
commit
21d616f8ed
@ -48,35 +48,28 @@
|
|||||||
/**
|
/**
|
||||||
* Finds multiple diffs in two strings and generates minimal change edits.
|
* Finds multiple diffs in two strings and generates minimal change edits.
|
||||||
*/
|
*/
|
||||||
function findChanges(oldStr, newStr) {
|
function findChanges(oldStr: string, newStr: string) {
|
||||||
let changes = [];
|
// Find the start of the difference
|
||||||
let oldIndex = 0,
|
let start = 0;
|
||||||
newIndex = 0;
|
while (start < oldStr.length && start < newStr.length && oldStr[start] === newStr[start]) {
|
||||||
|
start++;
|
||||||
while (oldIndex < oldStr.length || newIndex < newStr.length) {
|
|
||||||
if (oldStr[oldIndex] !== newStr[newIndex]) {
|
|
||||||
let start = oldIndex;
|
|
||||||
|
|
||||||
// Identify the changed portion
|
|
||||||
while (oldIndex < oldStr.length && oldStr[oldIndex] !== newStr[newIndex]) {
|
|
||||||
oldIndex++;
|
|
||||||
}
|
}
|
||||||
while (newIndex < newStr.length && newStr[newIndex] !== oldStr[start]) {
|
// If equal, nothing to change
|
||||||
newIndex++;
|
if (oldStr === newStr) return [];
|
||||||
|
// Find the end of the difference by comparing backwards
|
||||||
|
let endOld = oldStr.length,
|
||||||
|
endNew = newStr.length;
|
||||||
|
while (endOld > start && endNew > start && oldStr[endOld - 1] === newStr[endNew - 1]) {
|
||||||
|
endOld--;
|
||||||
|
endNew--;
|
||||||
}
|
}
|
||||||
|
return [
|
||||||
changes.push({
|
{
|
||||||
from: start,
|
from: start,
|
||||||
to: oldIndex, // Replace the differing part
|
to: endOld,
|
||||||
insert: newStr.substring(start, newIndex)
|
insert: newStr.slice(start, endNew)
|
||||||
});
|
|
||||||
} else {
|
|
||||||
oldIndex++;
|
|
||||||
newIndex++;
|
|
||||||
}
|
}
|
||||||
}
|
];
|
||||||
|
|
||||||
return changes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export let id = '';
|
export let id = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user