[polari/wip/kunaljain/polari-search: 2/2] experimental: substring index



commit 9a284ec54685f2e01aa7b3778b8bfcc165f382be
Author: Kunaal Jain <kunaalus gmail com>
Date:   Sun Jun 12 22:44:46 2016 +0530

    experimental: substring index

 src/mainWindow.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 0ec5173..b7bd7a9 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -269,7 +269,7 @@ const MainWindow = new Lang.Class({
         for (let i = 0; i < events.length; i++) {
             let message = events[i].mms;
             let uid = events[i].id;
-            let index = 0;
+            let index = message.indexOf(this._keywords[0] - 5);
             let row = this._widgetMap[uid];
             for (let j = 0; j < this._keywords.length; j++) {
                 // log(this._keywords[j]);
@@ -296,7 +296,7 @@ const MainWindow = new Lang.Class({
                 row.uid = events[i].id;
                 widgetMap[uid] = row;
             }
-            widgetMap[uid].get_children()[0].label = message;
+            widgetMap[uid].get_children()[0].label = message.substring(index - 2);
         }
 
         this._widgetMap = widgetMap;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]