[polari/wip/kunaljain/polari-search-merge-results] resultView: Separator line hack



commit e767eb32edb4c3426a8065a3ad2cd92dd330c366
Author: Kunaal Jain <kunaalus gmail com>
Date:   Sat Aug 20 07:48:10 2016 +0530

    resultView: Separator line hack

 src/resultView.js |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/resultView.js b/src/resultView.js
index fa339b5..7e23950 100644
--- a/src/resultView.js
+++ b/src/resultView.js
@@ -227,6 +227,7 @@ const ResultView = new Lang.Class({
         } else if(found) {
             let lastMark = buffer.get_mark('view-end' + this._resultsAvailable[startIndex].rank);
             iter = buffer.get_iter_at_mark(lastMark);
+            buffer.delete_mark(lastMark);
         }
         // if(!exists)
 
@@ -246,11 +247,17 @@ const ResultView = new Lang.Class({
             let rankTag = new Gtk.TextTag({ name: 'result'+rank, invisible: true });
             this._view.get_buffer().get_tag_table().add(rankTag);
         }
+
+        if(found && !exists) {
+            iter.backward_line();
+            buffer.create_mark('view-end' + this._resultsAvailable[startIndex].rank, iter, false);
+        }
         // buffer.insert(iter, String(rank), -1);
         // buffer.insert(iter, '\n', -1);
-        if(exists)
-            buffer.move_mark_by_name('view-end'+rank, iter);
-        else
+        // if(exists)
+        //     buffer.move_mark_by_name('view-end'+rank, iter);
+        // else
+        if(!exists)
             buffer.create_mark('view-end' + rank, iter, false);
 
         let index;
@@ -345,7 +352,7 @@ const ResultView = new Lang.Class({
             }
         }
         this._resultsAvailable[index].top_query = this._startQuery;
-        this._resultsAvailable[index].top_query = this._endQuery;
+        this._resultsAvailable[index].bottom_query = this._endQuery;
         //print(this._endQuery.isClosed());
 
         // Mainloop.timeout_add(5000, Lang.bind(this,


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