diff --git a/plantuml-mode.el b/plantuml-mode.el index 69dcbec..cdd15bb 100644 --- a/plantuml-mode.el +++ b/plantuml-mode.el @@ -108,6 +108,11 @@ :type '(repeat string) :group 'plantuml) +(defcustom plantuml-tab-width tab-width + "The number of spaces used for indentation." + :type 'integer + :group 'plantuml) + (defcustom plantuml-suppress-deprecation-warning t "To silence the deprecation warning when `puml-mode' is found upon loading." :type 'boolean @@ -460,7 +465,7 @@ Restore point to same position in text of the line as before indentation." (let ((original-position-eol (- (line-end-position) (point)))) (save-excursion (beginning-of-line) - (indent-line-to (* tab-width (plantuml-current-block-depth)))) + (indent-line-to (* plantuml-tab-width (plantuml-current-block-depth)))) ;; restore position in text of line (goto-char (- (line-end-position) original-position-eol)))) diff --git a/test/plantuml-indentation-basics-test.el b/test/plantuml-indentation-basics-test.el index 23b9e43..88aa05d 100644 --- a/test/plantuml-indentation-basics-test.el +++ b/test/plantuml-indentation-basics-test.el @@ -166,7 +166,7 @@ the position of | in AFTER." ;; use 2 spaces instead of one tab for indentation (setq-local indent-tabs-mode nil) - (setq-local tab-width 2) + (setq-local plantuml-tab-width 2) (indent-according-to-mode) (should (equal expected-state (buffer-string))) diff --git a/test/test-helper.el b/test/test-helper.el index bbba7b4..609b401 100644 --- a/test/test-helper.el +++ b/test/test-helper.el @@ -61,7 +61,7 @@ Finally, the indented text in the buffer will be compared with AFTER." (plantuml-mode) ;; use 2 spaces instead of one tab for indentation (setq-local indent-tabs-mode nil) - (setq-local tab-width 2) + (setq-local plantuml-tab-width 2) (indent-region (point-min) (point-max)) (should (equal (buffer-string) after))))