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.
|
||||
*/
|
||||
function findChanges(oldStr, newStr) {
|
||||
let changes = [];
|
||||
let oldIndex = 0,
|
||||
newIndex = 0;
|
||||
|
||||
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++;
|
||||
function findChanges(oldStr: string, newStr: string) {
|
||||
// Find the start of the difference
|
||||
let start = 0;
|
||||
while (start < oldStr.length && start < newStr.length && oldStr[start] === newStr[start]) {
|
||||
start++;
|
||||
}
|
||||
while (newIndex < newStr.length && newStr[newIndex] !== oldStr[start]) {
|
||||
newIndex++;
|
||||
// If equal, nothing to change
|
||||
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--;
|
||||
}
|
||||
|
||||
changes.push({
|
||||
return [
|
||||
{
|
||||
from: start,
|
||||
to: oldIndex, // Replace the differing part
|
||||
insert: newStr.substring(start, newIndex)
|
||||
});
|
||||
} else {
|
||||
oldIndex++;
|
||||
newIndex++;
|
||||
to: endOld,
|
||||
insert: newStr.slice(start, endNew)
|
||||
}
|
||||
}
|
||||
|
||||
return changes;
|
||||
];
|
||||
}
|
||||
|
||||
export let id = '';
|
||||
|
Loading…
Reference in New Issue
Block a user