bouzidanas/streamlit-code-editor

Cannot get line numbering working using editor_props

dividor opened this issue · 2 comments

An amazing piece of work, thanks!

I would like to activate line number in my editor. Following the documentation it suggests I should be able to do this by passing in editor_props dictionary to code_editor. However, when I try ...

response_dict = code_editor(code, buttons=buttons, editor_props={"showLineNumbers":True})

It doesn't add line numbers.

Is there something I'm doing wrong please?

Hi,

Its under options : https://github.com/ajaxorg/ace/wiki/Configuring-Ace#editor-options

So just add:

options={"showLineNumbers": True}

to code_editor function.

Best of luck with your project!

Perfect, that did the trick, thanks!!