summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format/clang-format.py
Commit message (Collapse)AuthorAgeFilesLines
* clang-format.py: Make formatting unnamed buffers work again (broke in r190691).Nico Weber2013-10-251-3/+4
| | | | llvm-svn: 193433
* clang-format: Add -assume-filename option for editor integrations.Daniel Jasper2013-09-131-1/+2
| | | | | | | | | | | | | | With -style=file, clang-format now starts to search for a .clang-format file starting at the file given with -assume-filename if it reads from stdin. Otherwise, it would start searching from the current directory, which is not helpful for editor integrations. Also changed vim, emacs and sublime integrations to actually make use of this flag. This fixes llvm.org/PR17072. llvm-svn: 190691
* Allow _clang-format as alternative to .clang-format config filenameHans Wennborg2013-09-101-1/+2
| | | | | | | | | | | Dotfiles are impractical on Windows. This makes clang-format search for the style configuration file as '_clang-format' in addition to the usual '.clang-format'. This is similar to how VIM searches for '_vimrc' on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1629 llvm-svn: 190413
* Switch the default mode for clang-format to '-file'. Make 'LLVM' theChandler Carruth2013-09-021-3/+4
| | | | | | | | | | | | | | | | | | | fallback syntax used when we fail to find a '.clang-format' file. Adjust variable names appropriately. Update the editor integration pieces that specify a '-style' option to specify it as '-style=file'. I left the functionality in place because even if the preferred method is to use '.clang-format' files, this way if someone needs to clobber the style in their editor we show how to do so in these examples. Also check in a '.clang-format' file for Clang to ensure that separate checkouts and builds of Clang from LLVM can still get the nice formatting. =] This unfortunately required nuking the test for the absence of a '.clang-format' file as now the directory happening to be under your clang source tree will cause there to always be a file. ;] llvm-svn: 189741
* Fix bug in clang-format's vim integration cause by r186789.Daniel Jasper2013-07-221-1/+1
| | | | | | | | After the first operation, the buffer contents has changed and thus all other operations would be invalid. Executing the operations in reversed order should fix this. llvm-svn: 186840
* clang-format: Smarter replacement in the vim integration.Daniel Jasper2013-07-211-7/+6
| | | | | | | | | With this fix, only changed regions will be replaced in vim's buffer. Thereby, marks should mostly be left intact. Furthermore, this is a better fix for the performance problem in conjunction with 'foldmethod=syntax' (see r186660). llvm-svn: 186789
* Use -lines option instead of -offset/-length. This fixes problems with files ↵Alexander Kornienko2013-07-201-6/+3
| | | | | | using dos newlines (<CR><LF>). llvm-svn: 186740
* Improve clang-format vim integration.Daniel Jasper2013-07-191-2/+2
| | | | | | | | The previous line-by-line replacement causes vim to take a long time if the foldmethod is set to 'syntax'. This should significantly improve performance in that case. llvm-svn: 186660
* [clang-format] Don't flash an ugly cmd prompt in Vim on WindowsReid Kleckner2013-06-101-1/+9
| | | | | | | | Reviewers: klimek Differential Revision: http://llvm-reviews.chandlerc.com/D941 llvm-svn: 183654
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-211-9/+15
| | | | | | | | | With this patch, clang-format will try to keep the cursor at the original code position in editor integrations (implemented for emacs and vim). This means, after formatting, clang-format will try to keep the cursor on the same character of the same token. llvm-svn: 182373
* Improvements to clang-format integrations.Daniel Jasper2013-04-091-1/+6
| | | | | | | | This adds an emacs editor integration (thanks to Ami Fischman). Also pulls out the style into a variable for the vi integration and just uses clang-formats defaults style in clang-format-diff.py. llvm-svn: 179098
* Add clang-format binary to cfe.Daniel Jasper2013-03-201-0/+60
llvm-svn: 177506
OpenPOWER on IntegriCloud