summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-10-15 21:28:43 -0700
committerTim Hatch <tim@timhatch.com>2014-10-15 21:28:43 -0700
commit78e09bf1384aa4439f56811b08a2b79ddd440b77 (patch)
tree6ca29be2b2368d98e1ea0b75d85cc7019179c91c
parentb3d5a943b5fdda8ec51fc6c315afdbbb91bd7031 (diff)
downloadpygments-78e09bf1384aa4439f56811b08a2b79ddd440b77.tar.gz
KconfigLexer: Be explicit about single repetition.
-rw-r--r--pygments/lexers/configs.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py
index df346609..2f8f1a45 100644
--- a/pygments/lexers/configs.py
+++ b/pygments/lexers/configs.py
@@ -122,7 +122,11 @@ def _rx_indent(level):
tab_width = 8
# Regex matching a given indentation {level}, assuming that indentation is
# a multiple of {tab_width}. In other cases there might be problems.
- return r'(?:\t| {1,%s}\t| {%s}){%s}.*\n' % (tab_width-1, tab_width, level)
+ if tab_width == 2:
+ space_repeat = '+'
+ else:
+ space_repeat = '{1,%d}' % (tab_width - 1)
+ return r'(?:\t| %s\t| {%s}){%s}.*\n' % (space_repeat, tab_width, level)
class KconfigLexer(RegexLexer):