Transform the HTML TEXTAREA tag into a basic text editor. The features include the inclusion of line numbers and the capability to input tabs.
First, load the sweEditor.js and sweEditor.css files. Then, place a TEXTAREA tag in your HTML. Please attach a JavaScript class to the textarea tag.
<script>
window.onload = (e) => {
const sedt = document.getElementById("fugafuga");
if (sedt) {
new sweEditor(sedt);
}
};
</script>
The size of the editor is designed to automatically match the dimensions specified in the textarea tag.
Feel free to experiment with the CSS file for things like color, font, and text size. While it has been completed, there are performance issues. Text editing at the level of a few thousand lines poses no problem, but when it exceeds tens of thousands of lines, editing becomes difficult. The cause seems to be related to the use of HTML's TEXTAREA, possibly indicating a performance issue in the browser (perhaps a design flaw). It is likely that TEXTAREA is not designed to handle such lengthy texts.