diff options
author | Georg Brandl <georg@python.org> | 2013-05-20 07:45:23 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-05-20 07:45:23 +0200 |
commit | bb3e612d9005186e9e7c5bf092a78ef450478960 (patch) | |
tree | dfca8e7ea98d1b49f79bd489735d94a619b8c969 | |
parent | 529f6da8a1fa76baf4e0d7e8d332b5ead56b48de (diff) | |
download | pygments-bb3e612d9005186e9e7c5bf092a78ef450478960.tar.gz |
Closes #862: better guess for shell lexer.
-rw-r--r-- | pygments/lexers/shell.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index 78c5c996..5ec9deaa 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -101,7 +101,10 @@ class BashLexer(RegexLexer): } def analyse_text(text): - return shebang_matches(text, r'(ba|z|)sh') + if shebang_matches(text, r'(ba|z|)sh'): + return 1 + if text.startswith('$ '): + return 0.2 class BashSessionLexer(Lexer): |