diff --git a/README.rst b/README.rst index 8717fa1..59ed2fd 100644 --- a/README.rst +++ b/README.rst @@ -203,7 +203,7 @@ in Gertty:: URxvt.keysym.C-Delete: perl:matcher:last URxvt.keysym.M-Delete: perl:matcher:list URxvt.matcher.button: 1 - URxvt.matcher.pattern.1: https:\/\/review.example.org/(\\#\/c\/)?(\\d+)[\w]* + URxvt.matcher.pattern.1: https:\/\/review.example.org/(\\#/c/)?(c/[^\\+]+\\+/)?(\\d+)[\\w]* URxvt.matcher.launcher.1: gertty --open $0 You will want to adjust the pattern to match the review site you are diff --git a/gertty/app.py b/gertty/app.py index e430a81..064812d 100644 --- a/gertty/app.py +++ b/gertty/app.py @@ -637,7 +637,15 @@ class App(object): change = patchset = filename = None path = [x for x in result.path.split('/') if x] if path: - change = path[0] + if path[0] == 'c': + while path: + path.pop(0) + if path[0] == '+': + path.pop(0) + change = path.pop(0) + break + else: + change = path[0] else: path = [x for x in result.fragment.split('/') if x] if path[0] == 'c':