Skip to content

Commit

Permalink
Only consider matches in the target when unit is modified.
Browse files Browse the repository at this point in the history
  • Loading branch information
friedelwolff committed Mar 2, 2015
1 parent b1847a8 commit 187f95e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion virtaal/modes/searchmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# Copyright 2008-2011 Zuza Software Foundation
# Copyright 2013 F Wolff
# Copyright 2013,2015 F Wolff
#
# This file is part of Virtaal.
#
Expand Down Expand Up @@ -480,6 +480,9 @@ def _on_textbox_refreshed(self, textbox, elem):
def _on_unit_modified(self, unit_controller, current_unit):
unit_matches = self._get_matches_for_unit(current_unit)
for match in unit_matches:
# Modifications can only affect the target:
if not match.part == 'target':
continue
if not self.filter.re_search.match(match.get_getter()()[match.start:match.end]):
logging.debug('Match to remove: %s' % (match))
self.matches.remove(match)
Expand Down

0 comments on commit 187f95e

Please sign in to comment.