[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d505356 1/5: company-indent-or-complete-common: More compa
From: |
Dmitry Gutov |
Subject: |
[elpa] master d505356 1/5: company-indent-or-complete-common: More compat |
Date: |
Thu, 6 Feb 2020 17:41:09 -0500 (EST) |
branch: master
commit d5053561cb166e03051c60e5c1e05a8a926dfee5
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company-indent-or-complete-common: More compat
#94
---
NEWS.md | 6 ++++++
company.el | 6 +++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 7be2dd2..c8f2711 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,11 @@
# History of user-visible changes
+## Next
+
+* `company-indent-or-complete-common` is better compatible with
+ `indent-for-tab-command`
+
([comment](https://github.com/company-mode/company-mode/issues/94#issuecomment-571265393)).
+
## 2020-01-03 (0.9.11)
* New value for option `company-show-numbers` to show numbers on the left.
diff --git a/company.el b/company.el
index e05f668..df01c96 100644
--- a/company.el
+++ b/company.el
@@ -2171,9 +2171,9 @@ With ARG, move by that many elements."
(current-prefix-arg arg))
(call-interactively 'company-select-next))))))
-(defun company-indent-or-complete-common ()
+(defun company-indent-or-complete-common (arg)
"Indent the current line or region, or complete the common part."
- (interactive)
+ (interactive "P")
(cond
((use-region-p)
(indent-region (region-beginning) (region-end)))
@@ -2183,7 +2183,7 @@ With ARG, move by that many elements."
((let ((old-point (point))
(old-tick (buffer-chars-modified-tick))
(tab-always-indent t))
- (call-interactively #'indent-for-tab-command)
+ (indent-for-tab-command arg)
(when (and (eq old-point (point))
(eq old-tick (buffer-chars-modified-tick)))
(company-complete-common))))))