Commits

guillermooo committed 2df7a62

improve grep report fortatting

  • Participants
  • Parent commits 2139294

Comments (0)

Files changed (4)

File Support/Mercurial Grep Report.JSON-tmLanguage

+{ "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" }
+			  }
+		}
+	]
+}

File Support/Mercurial Grep Report.hidden-tmLanguage

+<?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>

File mercurial.py

                 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,})

File shglib/commands.py

                     },
                     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',