feat: tab completions for file paths (#279)
Made a PR as was requested in the #113
This commit is contained in:
@@ -155,6 +155,8 @@ export interface MultilineTextEditorHandle {
|
||||
isCursorAtLastRow(): boolean;
|
||||
/** Full text contents */
|
||||
getText(): string;
|
||||
/** Move the cursor to the end of the text */
|
||||
moveCursorToEnd(): void;
|
||||
}
|
||||
|
||||
const MultilineTextEditorInner = (
|
||||
@@ -372,6 +374,16 @@ const MultilineTextEditorInner = (
|
||||
return row === lineCount - 1;
|
||||
},
|
||||
getText: () => buffer.current.getText(),
|
||||
moveCursorToEnd: () => {
|
||||
buffer.current.move("home");
|
||||
const lines = buffer.current.getText().split("\n");
|
||||
for (let i = 0; i < lines.length - 1; i++) {
|
||||
buffer.current.move("down");
|
||||
}
|
||||
buffer.current.move("end");
|
||||
// Force a re-render
|
||||
setVersion((v) => v + 1);
|
||||
},
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user