[vte/wip/bug746690: 3/3] regex: Remove code duplication
- From: Egmont Koblinger <egmontkob src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/bug746690: 3/3] regex: Remove code duplication
- Date: Fri, 23 Oct 2015 12:21:19 +0000 (UTC)
commit 370461d1141d1c2f5658bb6428450b4c721bbf9b
Author: Christian Persch <chpe gnome org>
Date: Thu Oct 15 20:36:32 2015 +0200
regex: Remove code duplication
src/vte.cc | 19 ++-----------------
1 files changed, 2 insertions(+), 17 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 85336d6..5a8de6d 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -6504,23 +6504,8 @@ cursor_inside_match (VteTerminal *terminal, long x, long y)
{
glong col = x / terminal->pvt->char_width;
glong row = _vte_terminal_pixel_to_row(terminal, y);
- if (terminal->pvt->match_start.row == terminal->pvt->match_end.row) {
- return row == terminal->pvt->match_start.row &&
- col >= terminal->pvt->match_start.col &&
- col <= terminal->pvt->match_end.col;
- } else {
- if (row < terminal->pvt->match_start.row ||
- row > terminal->pvt->match_end.row) {
- return FALSE;
- }
- if (row == terminal->pvt->match_start.row) {
- return col >= terminal->pvt->match_start.col;
- }
- if (row == terminal->pvt->match_end.row) {
- return col <= terminal->pvt->match_end.col;
- }
- return TRUE;
- }
+
+ return rowcol_inside_match(terminal, row, col);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]