textbringer 0.2.6 → 0.2.7
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.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/appveyor.yml +1 -0
- data/lib/textbringer/buffer.rb +14 -1
- data/lib/textbringer/commands/isearch.rb +11 -0
- data/lib/textbringer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57386322dcb1c04c07b26ccc281b10dc86fff8e1
|
4
|
+
data.tar.gz: 1dc85e31122a28561a9e47bb750b0602ec8619f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29a2f745379f31d22b838691f1f61ef8fd5502786cdd32a9fd698cd603b96ffb9d48c93091ed3186ee6c677d5c495bc9a51d6b358deb1a21da93b9ab179ded7f
|
7
|
+
data.tar.gz: c9e02c3d2161d3f5a4d1fe52bee20c7bb66972fa9c716737e94fbdd56fc59db1b5bd3a22500a5d34d48629dfea8bf324f9d9b748c1c4645e803adc284a80787e
|
data/CHANGES.md
CHANGED
data/appveyor.yml
CHANGED
data/lib/textbringer/buffer.rb
CHANGED
@@ -42,7 +42,20 @@ module Textbringer
|
|
42
42
|
|
43
43
|
NKF_DETECT_ENCODING = ->(s) {
|
44
44
|
e = NKF.guess(s)
|
45
|
-
|
45
|
+
case e
|
46
|
+
when Encoding::US_ASCII
|
47
|
+
Encoding::UTF_8
|
48
|
+
when Encoding::ASCII_8BIT
|
49
|
+
s.force_encoding(Encoding::UTF_8)
|
50
|
+
if s.valid_encoding?
|
51
|
+
Encoding::UTF_8
|
52
|
+
else
|
53
|
+
s.force_encoding(Encoding::ASCII_8BIT)
|
54
|
+
Encoding::ASCII_8BIT
|
55
|
+
end
|
56
|
+
else
|
57
|
+
e
|
58
|
+
end
|
46
59
|
}
|
47
60
|
|
48
61
|
@@detect_encoding_proc = DEFAULT_DETECT_ENCODING
|
@@ -18,6 +18,7 @@ module Textbringer
|
|
18
18
|
ISEARCH_MODE_MAP.define_key(?\C-h, :isearch_delete_char)
|
19
19
|
ISEARCH_MODE_MAP.define_key(?\C-s, :isearch_repeat_forward)
|
20
20
|
ISEARCH_MODE_MAP.define_key(?\C-r, :isearch_repeat_backward)
|
21
|
+
ISEARCH_MODE_MAP.define_key(?\C-w, :isearch_yank_word_or_char)
|
21
22
|
ISEARCH_MODE_MAP.define_key(?\C-m, :isearch_exit)
|
22
23
|
ISEARCH_MODE_MAP.define_key(?\C-g, :isearch_abort)
|
23
24
|
|
@@ -105,6 +106,16 @@ module Textbringer
|
|
105
106
|
isearch_search
|
106
107
|
end
|
107
108
|
|
109
|
+
define_command(:isearch_yank_word_or_char, doc: <<~EOD) do
|
110
|
+
Yank next word or character onto the end of the search string.
|
111
|
+
EOD
|
112
|
+
buffer = Buffer.current
|
113
|
+
if buffer.looking_at?(/(\p{Letter}|\p{Number})+|\s+|./)
|
114
|
+
ISEARCH_STATUS[:string].concat(buffer.match_string(0))
|
115
|
+
isearch_search
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
108
119
|
def isearch_search
|
109
120
|
forward = ISEARCH_STATUS[:forward]
|
110
121
|
options = if /\A[A-Z]/ =~ ISEARCH_STATUS[:string]
|
data/lib/textbringer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textbringer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|