vnews 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -219,10 +219,13 @@ session using `elinks` or whatever browser you set as your
219
219
 
220
220
  * `:VNSearch [term]` searches your feeds for items matching `[term]`
221
221
 
222
-
223
222
  You can use the abbreviation `:VNS`. If there are matches, you'll see
224
223
  the matching words color-highlighted.
225
224
 
225
+ You'll also see the match score in the column to the right of the title column.
226
+ The higher the number, the more relevant the match.
227
+
228
+ Search results are sorted by publication date.
226
229
 
227
230
  ## Concatenating feed items
228
231
 
data/lib/vnews/display.rb CHANGED
@@ -65,7 +65,12 @@ class Vnews
65
65
  def format_item_summary(i, width)
66
66
  varwidth = width.to_i - 35
67
67
  feed_title = col i['feed_title'], varwidth * 0.25
68
- title = col i['title'], varwidth * 0.75
68
+ title = if i['score'] # search result
69
+ width = varwidth * 0.75
70
+ "#{col(i['title'], (width - 6))} | #{"%.3s" % i['score']}"
71
+ else
72
+ col i['title'], varwidth * 0.75
73
+ end
69
74
  word_count = i['word_count'].to_s.rjust(6)
70
75
  date = format_date(i['pub_date']).rjust(8)
71
76
  spacer = " " * 20 # to push guid all the way off screen
data/lib/vnews/sql.rb CHANGED
@@ -176,7 +176,7 @@ class Vnews
176
176
  end
177
177
 
178
178
  def search_items(term)
179
- query = "select * from items where match(title, text) against('#{e term}') order by pub_date asc"
179
+ query = "select items.*, MATCH(title, text) against('#{e term}') as score from items where MATCH(title, text) against('#{e term}') order by pub_date asc"
180
180
  @client.query query
181
181
  end
182
182
 
data/lib/vnews/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  class Vnews
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
4
4
 
data/lib/vnews.vim CHANGED
@@ -431,7 +431,6 @@ func! s:search_items(term)
431
431
  let res = system(command)
432
432
  call s:display_items(res)
433
433
  " show item for top match
434
- normal gg
435
434
  call s:show_item_under_cursor(0)
436
435
  " item window will be focused
437
436
  call clearmatches()
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi