Skip to content
Snippets Groups Projects
Commit 02fb5809 authored by Daniel Jasper's avatar Daniel Jasper
Browse files

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
parent 33886c73
No related branches found
No related tags found
No related merge requests found
......@@ -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)))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment