@tabwidth defaults

33 views
Skip to first unread message

Rob

unread,
Mar 31, 2021, 5:56:36 PM3/31/21
to leo-editor
Thought I'd ask here first before posting an issue or enhancement on GitHub.

I find it annoying that when Leo opens @auto-whatever (rst or md in particular), the default @tabwidth is set to -4. That happens despite if I explicitly make it -2 prior to saving. Shouldn't this preference be saved in the @persistence node?

Is there any way to keep Leo from overriding my setting?

Rob...

Edward K. Ream

unread,
Apr 1, 2021, 7:00:56 AM4/1/21
to leo-editor

On Wednesday, March 31, 2021 at 4:56:36 PM UTC-5 Rob wrote:

I find it annoying that when Leo opens @auto-whatever (rst or md in particular), the default @tabwidth is set to -4. That happens despite if I explicitly make it -2 prior to saving. Shouldn't this preference be saved in the @persistence node?

Is there any way to keep Leo from overriding my setting?

Set @int tab-width = -2 in your .leo file, or make your @auto-rst node a child of a node containing @tabwidth -2.

In other words, Leo's @auto importers use whatever tab-width setting is in effect for each particular @auto node.

Edward

Edward K. Ream

unread,
Apr 1, 2021, 7:19:44 AM4/1/21
to leo-editor
On Thursday, April 1, 2021 at 6:00:56 AM UTC-5 Edward K. Ream wrote:

>> Is there any way to keep Leo from overriding my [@tabwidth] setting?

> Set @int tab-width = -2 in your .leo file, or make your @auto-rst node a child of a node containing @tabwidth -2.

In this regard the behavior of @auto-rst is the same as all other importers. The base Importer class (in plugins/importers/linescanner.py) adds the @tabwidth directive.

I've never given this behavior much thought, and I guess I would rather not change how the importers work, but it does seem a bit strange to add what amounts to a redundant @tabwidth directive.

Edward

Rob

unread,
Apr 1, 2021, 9:12:40 AM4/1/21
to leo-editor
Perfect, thanks! I added that to myLeoSettings.

Rob...

Edward K. Ream

unread,
Apr 1, 2021, 9:40:44 AM4/1/21
to leo-editor
On Thu, Apr 1, 2021 at 8:12 AM Rob <lar...@gmail.com> wrote:
Perfect, thanks! I added that to myLeoSettings.

Glad that helped.

Edward
Reply all
Reply to author
Forward
0 new messages