Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: trunk/src/third_party/clang_format/scripts/clang-format-sublime.py

Issue 135793002: Revert 244398 "Revert of https://codereview.chromium.org/111953007/" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # This file is a minimal clang-format sublime-integration. To install: 1 # This file is a minimal clang-format sublime-integration. To install:
2 # - Change 'binary' if clang-format is not on the path (see below). 2 # - Change 'binary' if clang-format is not on the path (see below).
3 # - Put this file into your sublime Packages directory, e.g. on Linux: 3 # - Put this file into your sublime Packages directory, e.g. on Linux:
4 # ~/.config/sublime-text-2/Packages/User/clang-format-sublime.py 4 # ~/.config/sublime-text-2/Packages/User/clang-format-sublime.py
5 # - Add a key binding: 5 # - Add a key binding:
6 # { "keys": ["ctrl+shift+c"], "command": "clang_format" }, 6 # { "keys": ["ctrl+shift+c"], "command": "clang_format" },
7 # 7 #
8 # With this integration you can press the bound key and clang-format will 8 # With this integration you can press the bound key and clang-format will
9 # format the current lines and selections for all cursor positions. The lines 9 # format the current lines and selections for all cursor positions. The lines
10 # or regions are extended to the next bigger syntactic entities. 10 # or regions are extended to the next bigger syntactic entities.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 print(error) 49 print(error)
50 self.view.replace( 50 self.view.replace(
51 edit, sublime.Region(0, self.view.size()), 51 edit, sublime.Region(0, self.view.size()),
52 output.decode(encoding)) 52 output.decode(encoding))
53 self.view.sel().clear() 53 self.view.sel().clear()
54 for region in regions: 54 for region in regions:
55 self.view.sel().add(region) 55 self.view.sel().add(region)
56 # FIXME: Without the 10ms delay, the viewport sometimes jumps. 56 # FIXME: Without the 10ms delay, the viewport sometimes jumps.
57 sublime.set_timeout(lambda: self.view.set_viewport_position( 57 sublime.set_timeout(lambda: self.view.set_viewport_position(
58 old_viewport_position, False), 10) 58 old_viewport_position, False), 10)
OLDNEW
« no previous file with comments | « trunk/src/third_party/clang_format/scripts/clang-format-diff.py ('k') | trunk/src/tools/checklicenses/checklicenses.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698