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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c725051b5bf4e8474118d1f792588efa1b808a5
4
- data.tar.gz: f99a3fa82e819162717afc9b4833c499c889ab03
3
+ metadata.gz: 337a9eb3eaaccec45d5518e480d7a963bab48f20
4
+ data.tar.gz: 58eed8825d0c6accdd31d102d3c9d758377a1057
5
5
  SHA512:
6
- metadata.gz: 361a080f5eb4182874507b274c8abd93f009996c8ef35218489e2ad78e1874427fba45f255f981de3d1bf8accdfaf195e674ea093124c21faff1eccf32ba40a0
7
- data.tar.gz: 9439bca45889b6ebfa0a9c9a6ffe654c35b81e7143cd5f3799f37a8cb0862c5980f2a9bff598a9b1674f643f2782cfb7d23f6373ee5128aa2607af0a1e668600
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
 
@@ -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]
@@ -1,3 +1,3 @@
1
1
  module Pepin
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
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.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-09 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses