[vte/wip/bug746690: 2/2] regex: Remove code duplication
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/bug746690: 2/2] regex: Remove code duplication
- Date: Tue, 20 Oct 2015 19:08:47 +0000 (UTC)
commit 53fd83f86168bf89500cc527bcb5e78df70a708a
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 4f2cd46..ab6e736 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -6502,23 +6502,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]