mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-26 22:11:57 -07:00
ux(polish) autocomplete in the input prompt (#18181)
This commit is contained in:
@@ -44,10 +44,16 @@ vi.mock('./text-buffer.js', () => {
|
||||
);
|
||||
}
|
||||
}),
|
||||
setText: vi.fn((newText) => {
|
||||
setText: vi.fn((newText, cursorPosition) => {
|
||||
mockTextBuffer.text = newText;
|
||||
mockTextBuffer.viewportVisualLines = [newText];
|
||||
mockTextBuffer.visualCursor[1] = newText.length;
|
||||
if (typeof cursorPosition === 'number') {
|
||||
mockTextBuffer.visualCursor[1] = cursorPosition;
|
||||
} else if (cursorPosition === 'start') {
|
||||
mockTextBuffer.visualCursor[1] = 0;
|
||||
} else {
|
||||
mockTextBuffer.visualCursor[1] = newText.length;
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -92,10 +98,16 @@ describe('TextInput', () => {
|
||||
);
|
||||
}
|
||||
}),
|
||||
setText: vi.fn((newText) => {
|
||||
setText: vi.fn((newText, cursorPosition) => {
|
||||
buffer.text = newText;
|
||||
buffer.viewportVisualLines = [newText];
|
||||
buffer.visualCursor[1] = newText.length;
|
||||
if (typeof cursorPosition === 'number') {
|
||||
buffer.visualCursor[1] = cursorPosition;
|
||||
} else if (cursorPosition === 'start') {
|
||||
buffer.visualCursor[1] = 0;
|
||||
} else {
|
||||
buffer.visualCursor[1] = newText.length;
|
||||
}
|
||||
}),
|
||||
};
|
||||
mockBuffer = buffer as unknown as TextBuffer;
|
||||
|
||||
Reference in New Issue
Block a user