feat: basic nvim setup and other partially working stuff
This commit is contained in:
25
src/components/terminal/TerminalSubCanvas.tsx
Normal file
25
src/components/terminal/TerminalSubCanvas.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React, { type ReactNode, useState } from "react";
|
||||
import {
|
||||
TerminalCanvasContextProvider,
|
||||
useTerminalCanvas,
|
||||
} from "~/context/TerminalCanvasContext";
|
||||
import { TerminalRenderer } from "~/utils/terminal/renderer";
|
||||
|
||||
export const TerminalSubCanvas = (props: {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
children?: Array<ReactNode> | ReactNode;
|
||||
}) => {
|
||||
const parent = useTerminalCanvas();
|
||||
const [canvas] = useState(new TerminalRenderer(props.width, props.height));
|
||||
|
||||
parent.writeElement(canvas, props.x, props.y);
|
||||
|
||||
return (
|
||||
<TerminalCanvasContextProvider value={canvas}>
|
||||
{props.children}
|
||||
</TerminalCanvasContextProvider>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user