Skip to content

Commit

Permalink
Merge pull request #134 from fsouza/optional-columns-preview_fzf_grep
Browse files Browse the repository at this point in the history
preview_fzf_grep: optional support for columns
  • Loading branch information
yuki-yano committed Jun 30, 2020
2 parents 81498ad + 876052a commit b769e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/preview_fzf_grep
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import os
bat_theme = (os.environ.get('FZF_PREVIEW_PREVIEW_BAT_THEME', 'ansi-dark'))

GREP_OUTPUT_REGEX = re.compile(
r'(?P<dev_icon>.\s\s)?(?P<file_name>.+):(?P<line_num>\d+)(:(?P<match>.*))?'
r'(?P<dev_icon>.\s\s)?(?P<file_name>[^:]+):(?P<line_num>\d+)(:(?P<col>\d+))?(:(?P<match>.*))?'
)
CLEAN_LINE_REGEX = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')

Expand All @@ -27,7 +27,7 @@ if not match:
)
sys.exit(1)

file_name = match.group('file_name').split(':')[0]
file_name = match.group('file_name')
line_num = int(match.group('line_num'))
start = max(line_num - 10, 1)
last = line_num + 100
Expand Down

0 comments on commit b769e2e

Please sign in to comment.