2

I'm trying to create a text editor with line numbers, which increments with the lines increase. Well, my focus is to make the UI that will do good in Firefox OS as a privilege app. But in UI what css and html need to be used to create a text-field where line numbers must not be editable by the user. And few other thing say like, text-field is fixed height height: 100px; now if text overflows and if the user scroll then line numbers must scroll together with respective lines. (I'm trying to create with textarea and div with contenteditable="true"). I'm not able to scroll the text-field if I try this. Please provide some help or any other way to do this.

Rahul Chakrabarty
  • 2,149
  • 7
  • 39
  • 70

1 Answers1

4

As someone who has worked on this problem for over a year at a previous company. Just use one of the existing source code editors like Ace or CodeMirror. They'll work in a Firefox OS app as well (f.e. Cloud9 IDE uses Ace and works on FFOS).

Jan Jongboom
  • 26,598
  • 9
  • 83
  • 120
  • CodeMirror is awesome. Thank you so very much for suggesting this. I like how w3schools has their code examples done but was not a fan of all the lengthy code used. The CodeMirror simplifies and makes it easy to implement. Thank you, Jan. Wayne – CodingEE Feb 27 '22 at 18:06