| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -129,6 +129,7 @@ def _replace_templates(cmd, line, windowed): | |||
| 129 | 129 | if not m: | |
| 130 | 130 | return None, None | |
| 131 | 131 | ||
| 132 | + template_key = None | ||
| 132 | 133 | full_key = (m.group(1) + m.group(2)).strip() | |
| 133 | 134 | if full_key in cmd.shebang_templates: | |
| 134 | 135 | template_key = full_key | |
@@ -137,6 +138,15 @@ def _replace_templates(cmd, line, windowed): | |||
| 137 | 138 | template_key = m.group(1) | |
| 138 | 139 | suffix = m.group(2) | |
| 139 | 140 | else: | |
| 141 | + # Also map case-insensitive keys back to their original casing | ||
| 142 | + keys_cf = {k.casefold(): k for k in cmd.shebang_templates} | ||
| 143 | + template_key = keys_cf.get(full_key.casefold()) | ||
| 144 | + suffix = "" | ||
| 145 | + if not template_key: | ||
| 146 | + template_key = keys_cf.get(m.group(1).casefold()) | ||
| 147 | + suffix = m.group(2) | ||
| 148 | + | ||
| 149 | + if not template_key: | ||
| 140 | 150 | return None, None | |
| 141 | 151 | ||
| 142 | 152 | new_cmd = cmd.shebang_templates[template_key] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -288,7 +288,9 @@ def test_quote_args(args, expect): | |||
| 288 | 288 | ("#! /usr/bin/python3", "PythonCore3", None), | |
| 289 | 289 | ("#! /usr/bin/pythonw3", "PythonCore3", None), | |
| 290 | 290 | ("#! custom", None, "#!CUSTOM"), | |
| 291 | + ("#! CUSTOM", None, "#!CUSTOM"), | ||
| 291 | 292 | ("#! full line custom", None, "#!CUSTOM2"), | |
| 293 | + ("#! FULL LINE CUSTOM", None, "#!CUSTOM2"), | ||
| 292 | 294 | ("#!full line custom with extra", None, None), | |
| 293 | 295 | ("custom", None, None), | |
| 294 | 296 | ("full line custom", None, None), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments