vmail 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vmail.vim +2 -1
- data/lib/vmail/address_quoter.rb +8 -1
- data/lib/vmail/contacts_extractor.rb +1 -1
- data/lib/vmail/version.rb +1 -1
- data/test/address_quoter_test.rb +7 -0
- metadata +2 -2
data/lib/vmail.vim
CHANGED
@@ -622,7 +622,8 @@ function! CompleteContact(findstart, base)
|
|
622
622
|
" model regex: match at beginning of line, or inside < > wrapping
|
623
623
|
" email addr
|
624
624
|
" '\(^ho\|<ho\)'
|
625
|
-
let regex = shellescape('\(^' . a:base . '\|<' . a:base . '\)')
|
625
|
+
" let regex = shellescape('\(^' . a:base . '\|<' . a:base . '\)')
|
626
|
+
let regex = shellescape(a:base)
|
626
627
|
let matches = system("grep -i " . regex . " " . $VMAIL_CONTACTS_FILE)
|
627
628
|
return split(matches, "\n")
|
628
629
|
endif
|
data/lib/vmail/address_quoter.rb
CHANGED
@@ -18,7 +18,14 @@ module Vmail
|
|
18
18
|
end
|
19
19
|
|
20
20
|
#Quote the names
|
21
|
-
addrs.map { |addr|
|
21
|
+
addrs.map { |addr|
|
22
|
+
# a little hackish
|
23
|
+
if addr =~ /"/
|
24
|
+
addr
|
25
|
+
else
|
26
|
+
addr.gsub(/^(.*) (<.*)/, '"\1" \2')
|
27
|
+
end
|
28
|
+
}.join(', ')
|
22
29
|
end
|
23
30
|
|
24
31
|
end
|
data/lib/vmail/version.rb
CHANGED
data/test/address_quoter_test.rb
CHANGED
@@ -24,4 +24,11 @@ class AddressQuoterTest < MiniTest::Unit::TestCase
|
|
24
24
|
expected = %q("Bob Smith" <bobsmith@gmail.com>, "Jones, Rich A." <richjones@gmail.com>, peterbaker@gmail.com)
|
25
25
|
assert_equal expected, quote_addresses(string)
|
26
26
|
end
|
27
|
+
|
28
|
+
def test_quoting_already_quoted
|
29
|
+
string = %q(Bob Smith <bobsmith@gmail.com>, "Jones, Rich A." <richjones@gmail.com>, peterbaker@gmail.com)
|
30
|
+
expected = %q("Bob Smith" <bobsmith@gmail.com>, "Jones, Rich A." <richjones@gmail.com>, peterbaker@gmail.com)
|
31
|
+
assert_equal expected, quote_addresses(string)
|
32
|
+
end
|
33
|
+
|
27
34
|
end
|