soywiki 0.3.3 → 0.3.4

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
@@ -169,7 +169,7 @@ commands:
169
169
 
170
170
  * `CTRL-j` and `CTRL-k` move the cursor directly to the next or previous WikiLink on the page
171
171
  * `ENTER` follows the WikiLink under the cursor
172
- * If there is nothing under the cursor, `ENTER` is equivalent to `CTRL-w p` and moves the cursor to the last accessed window
172
+ * If there is no WikiLink under the cursor, `ENTER` is equivalent to `CTRL-w p` and moves the cursor to the last accessed window
173
173
  * `,f` follows the first WikiLink after the cursor
174
174
  * `CTRL-l` opens a WikiLink in a vertical split window; press `CTRL-l` again
175
175
  while the cursor is on the top line to close the new window
data/lib/soywiki.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'string_ext'
2
2
 
3
3
  module Soywiki
4
- VERSION = '0.3.3'
4
+ VERSION = '0.3.4'
5
5
  WIKI_WORD = /\b([a-z][\w_]+\.)?[A-Z][a-z]+[A-Z]\w*\b/
6
6
  HYPERLINK = %r|\bhttps?://[^ >)\n\]]+|
7
7
 
data/lib/soywiki.vim CHANGED
@@ -127,19 +127,16 @@ func! s:find_next_wiki_link(backward)
127
127
  endfunc
128
128
 
129
129
  func! s:follow_link_under_cursor(split)
130
- if expand("<cWORD>>") == ''
131
- " just switch windows
132
- silent wincmd p
133
- echom "Switched to last accessed window"
134
- return
135
- endif
136
- if match(expand("<cWORD>>"), s:http_link_pattern) != -1
130
+ let word = expand("<cWORD>")
131
+ if match(word, s:http_link_pattern) != -1
137
132
  call s:open_href_under_cursor()
138
133
  return
139
134
  endif
140
135
  let link = s:link_under_cursor()
141
136
  if link == ""
142
- echom "'" . expand("<cWORD>") . "' is not a wiki link"
137
+ " just switch windows
138
+ silent wincmd p
139
+ echom "'" . word . "' is not a wiki link. " . (winnr('$') > 1 ? "Switched to last accessed window." : "")
143
140
  return ""
144
141
  elseif line('.') == 1
145
142
  " SPECIAL CASE
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 3
9
- version: 0.3.3
8
+ - 4
9
+ version: 0.3.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi