summaryrefslogtreecommitdiff
path: root/tools/clang-format/clang-format.el
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-05-21 17:05:40 +0000
committerDaniel Jasper <djasper@google.com>2013-05-21 17:05:40 +0000
commit02fb58096b32676c5d1dda2e75d1e88055abf896 (patch)
tree4b6f80c156cc3f624c293b045198bb9f9a1ea935 /tools/clang-format/clang-format.el
parent33886c7345397058096697a8a031a688a7bef762 (diff)
downloadclang-02fb58096b32676c5d1dda2e75d1e88055abf896.tar.gz
clang-02fb58096b32676c5d1dda2e75d1e88055abf896.tar.bz2
clang-02fb58096b32676c5d1dda2e75d1e88055abf896.tar.xz
Fix off-by-one error in clang-format's emacs integration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-format/clang-format.el')
-rw-r--r--tools/clang-format/clang-format.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/clang-format/clang-format.el b/tools/clang-format/clang-format.el
index af69118aa2..48fe36f2e5 100644
--- a/tools/clang-format/clang-format.el
+++ b/tools/clang-format/clang-format.el
@@ -40,14 +40,14 @@
(call-process-region (point-min) (point-max) clang-format-binary t t nil
"-offset" (number-to-string (1- begin))
"-length" (number-to-string (- end begin))
- "-cursor" (number-to-string (point))
+ "-cursor" (number-to-string (1- (point)))
"-style" style)
(goto-char (point-min))
(let ((json-output (json-read-from-string
(buffer-substring-no-properties
(point-min) (line-beginning-position 2)))))
(delete-region (point-min) (line-beginning-position 2))
- (goto-char (cdr (assoc 'Cursor json-output)))
+ (goto-char (1+ (cdr (assoc 'Cursor json-output))))
(dotimes (index (length orig-windows))
(set-window-start (nth index orig-windows)
(nth index orig-window-starts)))))))