Skip to content

Commit

Permalink
improve grep report fortatting
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermooo committed Aug 24, 2013
1 parent afe72ee commit 32b7049
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Support/Mercurial Grep Report.JSON-tmLanguage
@@ -0,0 +1,18 @@
{ "name": "Mercurial Grep Report",
"scopeName": "text.mercurial-grep-report",
"patterns": [
{ "match": "^(.+?)(:)(\\d+)(:)(\\d+)(:)(.+?)(:)(.*)$",
"captures": {
"1": { "name": "comment.line.mercurial-grep-report" },
"2": { "name": "comment.line.mercurial-grep-report" },
"3": { "name": "constant.numeric.rev.short.mercurial-grep-report" },
"4": { "name": "comment.line.mercurial-grep-report" },
"5": { "name": "support.function.line.mercurial-grep-report" },
"6": { "name": "comment.line.mercurial-grep-report" },
"7": { "name": "keyword.username.mercurial-grep-report" },
"8": { "name": "comment.line.mercurial-grep-report" },
"9": { "name": "string.file-name.mercurial-grep-report" }
}
}
]
}
65 changes: 65 additions & 0 deletions Support/Mercurial Grep Report.hidden-tmLanguage
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Mercurial Grep Report</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>comment.line.mercurial-grep-report</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>comment.line.mercurial-grep-report</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>constant.numeric.rev.short.mercurial-grep-report</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>comment.line.mercurial-grep-report</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>support.function.line.mercurial-grep-report</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>comment.line.mercurial-grep-report</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>keyword.username.mercurial-grep-report</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>comment.line.mercurial-grep-report</string>
</dict>
<key>9</key>
<dict>
<key>name</key>
<string>string.file-name.mercurial-grep-report</string>
</dict>
</dict>
<key>match</key>
<string>^(.+?)(:)(\d+)(:)(\d+)(:)(.+?)(:)(.*)$</string>
</dict>
</array>
<key>scopeName</key>
<string>text.mercurial-grep-report</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions mercurial.py
Expand Up @@ -170,6 +170,7 @@ def create_output(self, data, exit_code):
out = self.window.create_output_panel('hg_out')
out.settings().set("line_numbers", False)
out.settings().set("gutter", False)
out.settings().set("rulers", [])
out.settings().set("scroll_past_end", False)
out = self.window.create_output_panel('hg_out')
out.run_command('append', {'characters': data, 'force': True,})
Expand Down
2 changes: 1 addition & 1 deletion shglib/commands.py
Expand Up @@ -150,7 +150,7 @@ class AmbiguousCommandError(Exception):
},
prompt='Pattern (grep):',
enabled=True,
syntax_file='',
syntax_file='Packages/Mercurial/Support/Mercurial Grep Report.hidden-tmLanguage',
help='search for a pattern in specified files and revisions',
flags=0,
preferred_output='panel',
Expand Down

0 comments on commit 32b7049

Please sign in to comment.