pepin 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pepin/interactive_search.rb +7 -0
- data/lib/pepin/query.rb +9 -0
- data/lib/pepin/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: 337a9eb3eaaccec45d5518e480d7a963bab48f20
|
4
|
+
data.tar.gz: 58eed8825d0c6accdd31d102d3c9d758377a1057
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be619d9517044207689721eae6de5fdae8c769627f8be3259f071c649ed9ba23ef046236f78ea4676fe365dc9a76c1f13ba0a0d72288629b0274a6a26a13422e
|
7
|
+
data.tar.gz: bb72035725d1e3ab63806db8946a5a78d1b3622cfa3bddafeb3fdf78cba92afe4da49382bcf46756b7d6ba97708f41d5cca9b72ec0f10a629667ed363f344ab2
|
@@ -27,6 +27,7 @@ module Pepin
|
|
27
27
|
when Curses::KEY_CTRL_W then :handle_ctrl_w
|
28
28
|
when Curses::KEY_CTRL_E then :handle_ctrl_e
|
29
29
|
when Curses::KEY_CTRL_K then :handle_ctrl_k
|
30
|
+
when Curses::KEY_CTRL_U then :handle_ctrl_u
|
30
31
|
when Curses::KEY_BACKSPACE, Curses::KEY_CTRL_H, 127 then :handle_backspace
|
31
32
|
when Curses::KEY_CTRL_C then :handle_ctrl_c
|
32
33
|
when Curses::KEY_CTRL_D then :handle_ctrl_d
|
@@ -75,6 +76,12 @@ module Pepin
|
|
75
76
|
query.delete_ahead_from view.cursor
|
76
77
|
end
|
77
78
|
|
79
|
+
def handle_ctrl_u(*)
|
80
|
+
query.delete_behind_from view.cursor
|
81
|
+
|
82
|
+
view.move_cursor_to_first
|
83
|
+
end
|
84
|
+
|
78
85
|
def handle_backspace(*)
|
79
86
|
query.delete_behind_char_from view.cursor
|
80
87
|
|
data/lib/pepin/query.rb
CHANGED
@@ -34,6 +34,15 @@ module Pepin
|
|
34
34
|
notify_change
|
35
35
|
end
|
36
36
|
|
37
|
+
def delete_behind_from(pos)
|
38
|
+
string_was = @string
|
39
|
+
@string = @string.to_s[pos..-1]
|
40
|
+
|
41
|
+
notify_change
|
42
|
+
|
43
|
+
string_was.length - @string.length
|
44
|
+
end
|
45
|
+
|
37
46
|
def delete_behind_word_from(pos)
|
38
47
|
string_was = @string
|
39
48
|
@string = @string[0..pos.pred].split(/\b/)[0...-1].join + @string[pos..-1]
|
data/lib/pepin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pepin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hibariya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|