mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 22:14:53 +00:00
pygments lexer: use the token type intended for CLI output
and squash an unused import
This commit is contained in:
parent
57119fb84d
commit
196b42e4eb
1 changed files with 1 additions and 5 deletions
|
@ -3,7 +3,6 @@
|
||||||
# Example of how to use this:
|
# Example of how to use this:
|
||||||
# env PATH="/dir/containing/fish/indent/:$PATH" pygmentize -f terminal256 -l /path/to/fish_indent_lexer.py:FishIndentLexer -x ~/test.fish
|
# env PATH="/dir/containing/fish/indent/:$PATH" pygmentize -f terminal256 -l /path/to/fish_indent_lexer.py:FishIndentLexer -x ~/test.fish
|
||||||
|
|
||||||
import os
|
|
||||||
from pygments.lexer import Lexer
|
from pygments.lexer import Lexer
|
||||||
from pygments.token import (
|
from pygments.token import (
|
||||||
Keyword,
|
Keyword,
|
||||||
|
@ -23,9 +22,6 @@ from pygments.token import (
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
# The token type representing output to the console.
|
|
||||||
OUTPUT_TOKEN = Text
|
|
||||||
|
|
||||||
# A fallback token type.
|
# A fallback token type.
|
||||||
DEFAULT = Text
|
DEFAULT = Text
|
||||||
|
|
||||||
|
@ -131,5 +127,5 @@ class FishIndentLexer(Lexer):
|
||||||
result.extend(tokenize_fish_command(m.group(2), m.start(2)))
|
result.extend(tokenize_fish_command(m.group(2), m.start(2)))
|
||||||
else:
|
else:
|
||||||
# Non-prompt line representing output from a command.
|
# Non-prompt line representing output from a command.
|
||||||
result.append((m.start(2), OUTPUT_TOKEN, m.group(2)))
|
result.append((m.start(2), Generic.Output, m.group(2)))
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in a new issue