Commit 81459e62 authored by Bill Wendling's avatar Bill Wendling
Browse files

Merging r181299:

------------------------------------------------------------------------
r181299 | djasper | 2013-05-07 02:25:29 -0700 (Tue, 07 May 2013) | 5 lines

Fix clang-format emacs integration in last line.

Emacs seems to have a line that is just past the last character of the
buffers content. This needs to be handled specially so that clang-format
is not called with an invalid -offset.
------------------------------------------------------------------------

llvm-svn: 181380
parent 8cc42bf3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@
    (if mark-active
        (setq beg (region-beginning)
              end (region-end))
      (setq beg (line-beginning-position)
            end (line-end-position)))
      (setq beg (min (line-beginning-position) (1- (point-max)))
            end (min (line-end-position) (1- (point-max)))))
    (call-process-region (point-min) (point-max) binary t t nil
                         "-offset" (number-to-string (1- beg))
                         "-length" (number-to-string (- end beg))