🔧 Refactor scrollToResult function for improved readability and formatting consistency
This commit is contained in:
@@ -678,9 +678,15 @@ function scrollToResult() {
|
|||||||
const lineNumber = lineIndex + 1; // Convert to 1-based line number
|
const lineNumber = lineIndex + 1; // Convert to 1-based line number
|
||||||
|
|
||||||
// If result is beyond currently displayed lines, load more lines
|
// If result is beyond currently displayed lines, load more lines
|
||||||
if (lineIndex >= displayLines.value.length && lineIndex < fileLines.value.length) {
|
if (
|
||||||
|
lineIndex >= displayLines.value.length &&
|
||||||
|
lineIndex < fileLines.value.length
|
||||||
|
) {
|
||||||
// Expand displayLines to include the result
|
// Expand displayLines to include the result
|
||||||
const newLinesToDisplay = fileLines.value.slice(0, Math.min(lineIndex + 1000, fileLines.value.length));
|
const newLinesToDisplay = fileLines.value.slice(
|
||||||
|
0,
|
||||||
|
Math.min(lineIndex + 1000, fileLines.value.length)
|
||||||
|
);
|
||||||
displayLines.value = newLinesToDisplay.map((content, index) => ({
|
displayLines.value = newLinesToDisplay.map((content, index) => ({
|
||||||
lineNumber: index + 1,
|
lineNumber: index + 1,
|
||||||
content,
|
content,
|
||||||
|
|||||||
Reference in New Issue
Block a user