branch: elpa/julia-mode commit dc1794335bb584b5937e995d61ad4732f06dcd5a Author: David Hanak <dha...@gmail.com> Commit: GitHub <nore...@github.com>
Indent imports from submodule correctly (#154) * Indent using/import from submodules correctly * Add changelog entry --- CHANGELOG.md | 2 ++ julia-mode-tests.el | 9 +++++++++ julia-mode.el | 2 ++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 856dabe..5aa25dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- fix indentation of submodule imports + # 0.4 - increase lookback ([#98](https://github.com/JuliaEditorSupport/julia-emacs/pull/98)), fixes [#5](https://github.com/JuliaEditorSupport/julia-emacs/issues/5) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index bb4af97..72314a6 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -390,6 +390,15 @@ notpartofit" "using Foo: bar , baz, quux +notpartofit") + (julia--should-indent + "using Foo.Bar: bar , +baz, +quux +notpartofit" + "using Foo.Bar: bar , + baz, + quux notpartofit")) (ert-deftest julia--test-indent-anonymous-function () diff --git a/julia-mode.el b/julia-mode.el index a8f8e78..04437f7 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -428,6 +428,8 @@ symbol, gives up when this is not true." (setf module (match-string-no-properties 1)))) ((looking-at (rx (* (or word (syntax symbol))) (0+ space) ",")) (when module (setf done 'broken))) + ((looking-at (rx (* (or word (syntax symbol))) ".")) + (setf module (concat (match-string-no-properties 0) module))) (t (setf done 'broken))))) (if (eq done 'broken) nil