Skip to content

Commit

Permalink
Read tab_size from user settings
Browse files Browse the repository at this point in the history
closes #3
  • Loading branch information
predragnikolic committed Aug 31, 2019
1 parent 93bea87 commit e67d123
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ def name(self) -> str:

@property
def config(self) -> ClientConfig:
settings = sublime.load_settings("LSP-vue.sublime-settings")
settings = sublime.load_settings("LSP-vue.sublime-settings")
config = settings.get('config')
view = sublime.active_window().active_view()
if view is not None:
config['vetur']['format']['options']['tabs_size'] = view.settings().get("tab_size", 4)
config['vetur']['format']['options']['useTabs'] = not view.settings().get("translate_tabs_to_spaces", False)
return ClientConfig(
name='lsp-vue',
binary_args=[
Expand All @@ -81,7 +86,7 @@ def config(self) -> ClientConfig:
tcp_port=None,
enabled=True,
init_options={
"config": settings.get('config')
"config": config
},
settings=dict(),
env=dict(),
Expand Down

0 comments on commit e67d123

Please sign in to comment.