vimamsa 0.1.13 → 0.1.14
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/custom_example.rb +5 -0
- data/lib/vimamsa/ack.rb +3 -4
- data/lib/vimamsa/audio.rb +25 -1
- data/lib/vimamsa/buffer.rb +43 -566
- data/lib/vimamsa/buffer_changetext.rb +255 -0
- data/lib/vimamsa/buffer_cursor.rb +303 -0
- data/lib/vimamsa/buffer_list.rb +26 -9
- data/lib/vimamsa/buffer_manager.rb +4 -2
- data/lib/vimamsa/clipboard.rb +35 -0
- data/lib/vimamsa/conf.rb +130 -5
- data/lib/vimamsa/debug.rb +4 -8
- data/lib/vimamsa/editor.rb +41 -78
- data/lib/vimamsa/encrypt.rb +6 -11
- data/lib/vimamsa/file_manager.rb +138 -9
- data/lib/vimamsa/gui.rb +3 -32
- data/lib/vimamsa/gui_dialog.rb +113 -0
- data/lib/vimamsa/gui_sourceview.rb +10 -14
- data/lib/vimamsa/gui_text.rb +19 -0
- data/lib/vimamsa/hyper_plain_text.rb +8 -5
- data/lib/vimamsa/key_actions.rb +17 -197
- data/lib/vimamsa/key_binding_tree.rb +49 -31
- data/lib/vimamsa/key_bindings_vimlike.rb +30 -30
- data/lib/vimamsa/macro.rb +35 -25
- data/lib/vimamsa/main.rb +3 -10
- data/lib/vimamsa/rbvma.rb +11 -11
- data/lib/vimamsa/search.rb +1 -1
- data/lib/vimamsa/search_replace.rb +89 -151
- data/lib/vimamsa/terminal.rb +22 -0
- data/lib/vimamsa/tests.rb +122 -0
- data/lib/vimamsa/util.rb +33 -3
- data/lib/vimamsa/version.rb +1 -1
- data/vimamsa.gemspec +3 -1
- metadata +56 -7
- /data/lib/vimamsa/{form_generator.rb → gui_form_generator.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 510c17ec3221823fe5e8c800b4146879c11f278b37a0ad807d57729210af6b3a
|
4
|
+
data.tar.gz: 211596938920f6a785830d9d516cd9c999b4c8f54a67610eaf971ce127c4b8e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08b64e33fe9c031326ac005bf42da69f5e3ed9ce7ffe73d84a387ede95be8e37a44d0c57d6b5b62d3d2842b8de855dc6145e42cf4cd4a4eb8341cab33cb2b86d'
|
7
|
+
data.tar.gz: 3057288ea2ab7b13939a96282da7540287ebba518714b8aa2db7a285d9aff99e435142ab915d13d92684d229069388a0b52c86a971abad8acb817c5343ba2fff
|
data/custom_example.rb
CHANGED
@@ -15,6 +15,11 @@
|
|
15
15
|
# Open this file every time the program starts
|
16
16
|
# setcnf :startup_file, "~/Documents/startup.txt"
|
17
17
|
|
18
|
+
# To enable LSP:
|
19
|
+
# conf(:custom_lsp)[:ruby] = {name: "solargraph", command:"solargraph stdio", type: "stdio"}
|
20
|
+
# conf(:custom_lsp)[:cpp] = {name: "clangd", command:"clangd-12 --offset-encoding=utf-8", type: "stdio"}
|
21
|
+
|
22
|
+
|
18
23
|
def insert_date()
|
19
24
|
# $buffer.insert_txt("#{DateTime.now().strftime("==========\n%Y-%m-%d")}\n")
|
20
25
|
vma.buf.insert_txt("#{DateTime.now().strftime("%Y-%m-%d")}\n")
|
data/lib/vimamsa/ack.rb
CHANGED
@@ -45,7 +45,7 @@ Will search all .txt files in the following directories:
|
|
45
45
|
dlist = dlist + Dir.glob("#{d}/**/*").select { |e| File.file?(e) and fext.include?(File.extname(e)) and File.size(e) < 200e3 }
|
46
46
|
end
|
47
47
|
bufstr = "Results:\n\n"
|
48
|
-
b = create_new_buffer(bufstr,"contentsearch")
|
48
|
+
b = create_new_buffer(bufstr, "contentsearch")
|
49
49
|
lno = 1
|
50
50
|
@linep = {}
|
51
51
|
for fp in dlist
|
@@ -81,7 +81,6 @@ Will search all .txt files in the following directories:
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
# jumpto = $grep_matches[lineno]
|
85
84
|
# if jumpto.class == Integer
|
86
85
|
# vma.buffers.set_current_buffer($grep_bufid, update_history = true)
|
87
86
|
# buf.jump_to_line(jumpto)
|
@@ -118,8 +117,8 @@ def ack_buffer(_instr, b = nil)
|
|
118
117
|
bufstr += run_cmd("ack -Q --type-add=gd=.gd -ki --nohtml --nojs --nojson #{instr} #{path}")
|
119
118
|
end
|
120
119
|
if bufstr.size > 5
|
121
|
-
|
122
|
-
|
120
|
+
b = create_new_buffer(bufstr, "ack")
|
121
|
+
Gui.highlight_match(b, _instr, color: cnf.match.highlight.color!)
|
123
122
|
else
|
124
123
|
message("No results for input:#{instr}")
|
125
124
|
end
|
data/lib/vimamsa/audio.rb
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
require "gstreamer"
|
2
2
|
|
3
|
+
class File
|
4
|
+
def self.exists?(fn)
|
5
|
+
File.exist?(fn)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
3
9
|
# following the example gstreamer-4.2.0/sample/helloworld_e.rb
|
4
10
|
class Audio
|
5
11
|
@@playbin = nil
|
@@ -22,6 +28,8 @@ class Audio
|
|
22
28
|
end
|
23
29
|
end
|
24
30
|
|
31
|
+
# playbin.seek(10.0)
|
32
|
+
|
25
33
|
# playbin.volume
|
26
34
|
# playbin.volume=1.0
|
27
35
|
# playbin.stream_time
|
@@ -35,10 +43,10 @@ class Audio
|
|
35
43
|
end
|
36
44
|
playbin.uri = uri
|
37
45
|
@@playbin = playbin
|
46
|
+
$pb = playbin
|
38
47
|
|
39
48
|
bus = playbin.bus
|
40
49
|
bus.add_watch do |bus, message|
|
41
|
-
|
42
50
|
case message.type
|
43
51
|
when Gst::MessageType::EOS
|
44
52
|
puts "End-of-stream"
|
@@ -54,5 +62,21 @@ class Audio
|
|
54
62
|
|
55
63
|
# start play back and listed to events
|
56
64
|
playbin.play
|
65
|
+
playbin.seek_simple(Gst::Format::TIME, Gst::SeekFlags::NONE, 10.0)
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.seek_forward(secs = 5.0)
|
69
|
+
return if @@playbin.nil?
|
70
|
+
if @@playbin.current_state == "playing"
|
71
|
+
duration = @@playbin.query_duration(Gst::Format::TIME)[1]
|
72
|
+
curpos = @@playbin.query_position(Gst::Format::TIME)[1]
|
73
|
+
newpos = curpos + secs * 1.0e9
|
74
|
+
newpos = 0.0 if newpos < 0
|
75
|
+
return if newpos > duration
|
76
|
+
@@playbin.seek_simple(Gst::Format::TIME, Gst::SeekFlags::FLUSH, newpos)
|
77
|
+
message("New audio pos: #{(newpos / 1.0e9).round(1)}/#{(duration / 1.0e9).round(1)}")
|
78
|
+
# $pb.query_position(Gst::Format::TIME)[1]/1.0e9
|
79
|
+
end
|
57
80
|
end
|
58
81
|
end
|
82
|
+
|