forked from OSchip/llvm-project
clang-format.py: Make formatting unnamed buffers work again (broke in r190691).
llvm-svn: 193433
This commit is contained in:
parent
8bc7db777d
commit
8bdd1ee021
|
@ -48,9 +48,10 @@ if sys.platform.startswith('win32'):
|
||||||
startupinfo.wShowWindow = subprocess.SW_HIDE
|
startupinfo.wShowWindow = subprocess.SW_HIDE
|
||||||
|
|
||||||
# Call formatter.
|
# Call formatter.
|
||||||
p = subprocess.Popen([binary, '-lines', lines, '-style', style,
|
command = [binary, '-lines', lines, '-style', style, '-cursor', str(cursor)]
|
||||||
'-cursor', str(cursor),
|
if vim.current.buffer.name:
|
||||||
'-assume-filename', vim.current.buffer.name],
|
command.extend(['-assume-filename', vim.current.buffer.name])
|
||||||
|
p = subprocess.Popen(command,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||||
stdin=subprocess.PIPE, startupinfo=startupinfo)
|
stdin=subprocess.PIPE, startupinfo=startupinfo)
|
||||||
stdout, stderr = p.communicate(input=text)
|
stdout, stderr = p.communicate(input=text)
|
||||||
|
|
Loading…
Reference in New Issue