antonmedv / codejar

An embeddable code editor for the browser 🍯
https://medv.io/codejar/
MIT License
1.8k stars 116 forks source link

Support for RTL Line Numbers #101

Closed StevenEWright closed 1 year ago

StevenEWright commented 1 year ago

This PR adds support for RTL line numbers via a new option (side) whose value may be either left or right.

When the option is set to left (or left un-set as left is the default), everything works as before. When the option is set to right, the line numbers are moved to the right hand side of the editor, and the dir attribute is set to rtl.

A new demo has been added to the test page, as seen here:

image

The Arabic text in the demo page exists because many people will likely not be able to easily generate text of sufficient length to properly test the component easily. It is Arabic Lorem Ipsum.

antonmedv commented 1 year ago

Thanks for the PR! But I decided to drop support for line numbers in Codejar.

antonmedv commented 1 year ago

Feel free to release it as a separate package 'codejar-linenumber' and add the link to the readme here.