From patchwork Mon Jun 20 22:58:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 2104 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 406E023E52 for ; Mon, 20 Jun 2011 22:59:01 +0000 (UTC) Received: from mail-vx0-f180.google.com (mail-vx0-f180.google.com [209.85.220.180]) by fiordland.canonical.com (Postfix) with ESMTP id 11BCEA18276 for ; Mon, 20 Jun 2011 22:59:00 +0000 (UTC) Received: by mail-vx0-f180.google.com with SMTP id 7so2987210vxd.11 for ; Mon, 20 Jun 2011 15:59:00 -0700 (PDT) Received: by 10.52.161.65 with SMTP id xq1mr502483vdb.167.1308610740854; Mon, 20 Jun 2011 15:59:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs32818vdc; Mon, 20 Jun 2011 15:59:00 -0700 (PDT) Received: by 10.217.2.202 with SMTP id p52mr1775994wes.28.1308610737723; Mon, 20 Jun 2011 15:58:57 -0700 (PDT) Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) by mx.google.com with ESMTP id e43si14006863wes.7.2011.06.20.15.58.57; Mon, 20 Jun 2011 15:58:57 -0700 (PDT) Received-SPF: neutral (google.com: 80.12.242.125 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=80.12.242.125; Authentication-Results: mx.google.com; spf=neutral (google.com: 80.12.242.125 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: from monster.dhcp.lxc ([92.134.95.191]) by mwinf5d06 with ME id yNyp1g00347kPVY03NywDU; Tue, 21 Jun 2011 00:58:57 +0200 From: Daniel Lezcano To: linaro-dev@lists.linaro.org Subject: [powerdebug 15/17] the find list has it's own cursor Date: Tue, 21 Jun 2011 00:58:23 +0200 Message-Id: <1308610705-23281-15-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1308610705-23281-1-git-send-email-daniel.lezcano@linaro.org> References: <1308610705-23281-1-git-send-email-daniel.lezcano@linaro.org> That prevents to have the selections to collide between the search list result and the main window. Signed-off-by: Daniel Lezcano --- display.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/display.c b/display.c index 23a4172..e1d1325 100644 --- a/display.c +++ b/display.c @@ -280,6 +280,7 @@ struct find_data { size_t len; char *string; regex_t *reg; + int ocursor; }; struct find_data *display_find_form_init(void) @@ -312,6 +313,13 @@ struct find_data *display_find_form_init(void) findd->string = search4; findd->reg = reg; findd->len = len; + + /* save the location of the cursor on the main window in order to + * browse the search result + */ + findd->ocursor = windata[current_win].cursor; + windata[current_win].cursor = 0; + out: return findd; @@ -327,6 +335,7 @@ out_free_reg: static void display_find_form_fini(struct find_data *fd) { + windata[current_win].cursor = fd->ocursor; regfree(fd->reg); free(fd->string); free(fd);