chore: remove dead code
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
export const NvimEditor = (props: { content: string | undefined }) => {
|
export const NvimEditor = (props: { content: string | undefined }) => {
|
||||||
const [selectedLine, setSelectedLine] = useState(0);
|
|
||||||
|
|
||||||
let rows = props.content?.split("\n") ?? [];
|
let rows = props.content?.split("\n") ?? [];
|
||||||
// trim end empty lines
|
// trim end empty lines
|
||||||
for (let i = rows.length - 1; i >= 0; i--) {
|
for (let i = rows.length - 1; i >= 0; i--) {
|
||||||
@@ -27,31 +23,4 @@ export const NvimEditor = (props: { content: string | undefined }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
{rows.map((row, i) => (
|
|
||||||
<tr
|
|
||||||
key={i}
|
|
||||||
onMouseDown={() => setSelectedLine(i)}
|
|
||||||
onMouseMove={(e) => {
|
|
||||||
if (e.buttons === 1) setSelectedLine(i);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<td
|
|
||||||
className={`flex select-none flex-col items-start pl-[2ch] pr-[1ch] text-right`}
|
|
||||||
style={{
|
|
||||||
width: `${3 + rows.length.toString().length}ch`,
|
|
||||||
color: selectedLine === i ? "inherit" : "#6b616d",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{i + 1}
|
|
||||||
</td>
|
|
||||||
<td>{row}</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user