mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 06:04:51 +00:00
perf(tui): optimized extractCursorPosition to scan lines in reverse order (#1004)
- Optimized extractCursorPosition to scan lines in reverse order for improved performance.
This commit is contained in:
parent
0ad189f12a
commit
a8f33fd630
1 changed files with 1 additions and 1 deletions
|
|
@ -772,7 +772,7 @@ export class TUI extends Container {
|
|||
* @returns Cursor position { row, col } or null if no marker found
|
||||
*/
|
||||
private extractCursorPosition(lines: string[]): { row: number; col: number } | null {
|
||||
for (let row = 0; row < lines.length; row++) {
|
||||
for (let row = lines.length - 1; row >= 0; row--) {
|
||||
const line = lines[row];
|
||||
const markerIndex = line.indexOf(CURSOR_MARKER);
|
||||
if (markerIndex !== -1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue