spadarian / docblock-python

Atom plugin to insert documentation blocks for python functions
GNU General Public License v2.0
22 stars 9 forks source link

parametrize the tab length #32

Closed SKalt closed 5 years ago

SKalt commented 5 years ago

See https://github.com/google/yapf/blob/master/CONTRIBUTING.rst#yapf-coding-style: they use two spaces for indentation rather than four spaces. Grabbing the current editor tab spacing would handle this (admittedly heretical) use-case.

Generally where the change would be made: https://github.com/spadarian/docblock-python/blob/master/lib/docblock-python.js#L296 ~`atom.config.scopedSettingsStore.cache['getPropertyValue:.source.python:editor.tabLength']` does grab the correct number of spaces, but there should be a better way to do it.~ `atom.config.get('editor.tabLength')` should do the trick.
spadarian commented 5 years ago

When I started writing the plugin I thought about that, and I guess it is time to implement it. My initial idea was to add an option to change the sequence of characters used.

Probably is a good idea to use the setting from the editor or language-python. Does language-python have priority over editor settings? When I try atom.config.get('editor.tabLength') in the console I get 2... even if I use 4 spaces in Python.

SKalt commented 5 years ago

Could you try config.get(.souce.python.editor.tabLength)? If that doesn't work, we might fall back in the section I crossed out, despite the section I crossed out: it has .source.python-specific settings, though it has an awful access method.

On Mon, Feb 25, 2019, 7:10 PM José Padarian notifications@github.com wrote:

When I started writing the plugin I thought about that, and I guess it is time to implement it. My initial idea was to add an option to change the sequence of characters used.

  • 2 spaces
  • 4 spaces
  • tab (Do people still use tab to indent?)

Probably is a good idea to use the setting from the editor or language-python. Does language-python have priority over editor settings? When I try atom.config.get('editor.tabLength') in the console I get 2... even if I use 4 spaces in Python.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spadarian/docblock-python/issues/32#issuecomment-467237198, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9G5XZK3rZmN2Awpfngk8354Me5e_D0ks5vRHuPgaJpZM4bORYf .