ruby-zoom 5.3.0 → 5.4.0
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/bin/z +1 -1
- data/bin/zc +1 -1
- data/bin/zf +1 -1
- data/bin/zg +1 -1
- data/bin/zl +1 -1
- data/bin/zr +1 -1
- data/lib/zoom/editor.rb +50 -8
- data/lib/zoom/wish/reset_wish.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d301bb2829817c9b24659d6d0cbc3fed7a52b4935fee6dad807535e5644d5d5a
|
4
|
+
data.tar.gz: 8d239791a5c6c86e374227f91637ddf266bc6b38f3f386d5af03a3de0fe05be4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e44a8a5f10f3b319ae0f4c610819781fea1cdfaa6c7dfebaebab266bdeb189335a8640892715c743d82e4f1cb5fd8301c21a48ae3cb92682bc2c6080086ec1b
|
7
|
+
data.tar.gz: a939ba6fa4bb8593758ffde341d0591a8896ee24de27a5a71216ccd369c81d817ee93a7c80333513be3c96c5153e17eca38b11e0aac39668bf914570a666e45d
|
data/bin/z
CHANGED
@@ -320,7 +320,7 @@ options = parse(ARGV)
|
|
320
320
|
|
321
321
|
begin
|
322
322
|
if (options["action"] == "rc")
|
323
|
-
FileUtils.rm_f(Pathname.new("~/.
|
323
|
+
FileUtils.rm_f(Pathname.new("~/.config/zoom/rc").expand_path)
|
324
324
|
end
|
325
325
|
|
326
326
|
Zoom::ProfileManager.force_tool(options["tool"])
|
data/bin/zc
CHANGED
@@ -320,7 +320,7 @@ options = parse(ARGV)
|
|
320
320
|
|
321
321
|
begin
|
322
322
|
if (options["action"] == "rc")
|
323
|
-
FileUtils.rm_f(Pathname.new("~/.
|
323
|
+
FileUtils.rm_f(Pathname.new("~/.config/zoom/rc").expand_path)
|
324
324
|
end
|
325
325
|
|
326
326
|
Zoom::ProfileManager.force_tool(options["tool"])
|
data/bin/zf
CHANGED
@@ -320,7 +320,7 @@ options = parse(ARGV)
|
|
320
320
|
|
321
321
|
begin
|
322
322
|
if (options["action"] == "rc")
|
323
|
-
FileUtils.rm_f(Pathname.new("~/.
|
323
|
+
FileUtils.rm_f(Pathname.new("~/.config/zoom/rc").expand_path)
|
324
324
|
end
|
325
325
|
|
326
326
|
Zoom::ProfileManager.force_tool(options["tool"])
|
data/bin/zg
CHANGED
@@ -320,7 +320,7 @@ options = parse(ARGV)
|
|
320
320
|
|
321
321
|
begin
|
322
322
|
if (options["action"] == "rc")
|
323
|
-
FileUtils.rm_f(Pathname.new("~/.
|
323
|
+
FileUtils.rm_f(Pathname.new("~/.config/zoom/rc").expand_path)
|
324
324
|
end
|
325
325
|
|
326
326
|
Zoom::ProfileManager.force_tool(options["tool"])
|
data/bin/zl
CHANGED
@@ -320,7 +320,7 @@ options = parse(ARGV)
|
|
320
320
|
|
321
321
|
begin
|
322
322
|
if (options["action"] == "rc")
|
323
|
-
FileUtils.rm_f(Pathname.new("~/.
|
323
|
+
FileUtils.rm_f(Pathname.new("~/.config/zoom/rc").expand_path)
|
324
324
|
end
|
325
325
|
|
326
326
|
Zoom::ProfileManager.force_tool(options["tool"])
|
data/bin/zr
CHANGED
@@ -320,7 +320,7 @@ options = parse(ARGV)
|
|
320
320
|
|
321
321
|
begin
|
322
322
|
if (options["action"] == "rc")
|
323
|
-
FileUtils.rm_f(Pathname.new("~/.
|
323
|
+
FileUtils.rm_f(Pathname.new("~/.config/zoom/rc").expand_path)
|
324
324
|
end
|
325
325
|
|
326
326
|
Zoom::ProfileManager.force_tool(options["tool"])
|
data/lib/zoom/editor.rb
CHANGED
@@ -49,13 +49,26 @@ class Zoom::Editor
|
|
49
49
|
@editor= "vi" if (ScoobyDoo.where_are_you(@editor).nil?)
|
50
50
|
@flags = ""
|
51
51
|
end
|
52
|
+
|
53
|
+
# In case of vim server functionality
|
54
|
+
@vimserver = ""
|
55
|
+
@flags.match(/--servername\s+["']?([^"' ]+)/) do |m|
|
56
|
+
@vimserver = m[1]
|
57
|
+
end
|
58
|
+
|
59
|
+
# In case of vim remote functionality
|
60
|
+
if (!@vimserver.empty?)
|
61
|
+
@flags.match(/(--remote(-tab)?(-wait)?(-silent)?)/) do |m|
|
62
|
+
@flags.gsub!(/#{m[1]}/, "")
|
63
|
+
end
|
64
|
+
end
|
52
65
|
end
|
53
66
|
|
54
67
|
def open(results)
|
55
68
|
return if (results.nil? || results.empty?)
|
56
69
|
|
57
70
|
case @editor
|
58
|
-
when /vim
|
71
|
+
when /vim$/
|
59
72
|
vim(results)
|
60
73
|
else
|
61
74
|
default(results)
|
@@ -83,6 +96,8 @@ class Zoom::Editor
|
|
83
96
|
private :open_result
|
84
97
|
|
85
98
|
def vim(results)
|
99
|
+
already_started = vim_remote_started?
|
100
|
+
|
86
101
|
quickfix = Pathname.new("~/.cache/zoom/quickfix").expand_path
|
87
102
|
source = Pathname.new("~/.cache/zoom/source").expand_path
|
88
103
|
FileUtils.mkdir_p(quickfix.dirname)
|
@@ -101,7 +116,7 @@ class Zoom::Editor
|
|
101
116
|
"nnoremap zp :cp<cr>",
|
102
117
|
""
|
103
118
|
].join("\n")
|
104
|
-
zs.write(vimscript)
|
119
|
+
zs.write(vimscript) if (!already_started)
|
105
120
|
|
106
121
|
files = Array.new
|
107
122
|
results.each do |result|
|
@@ -124,6 +139,7 @@ class Zoom::Editor
|
|
124
139
|
|
125
140
|
if (!files.include?(filename))
|
126
141
|
files.push(filename)
|
142
|
+
zs.write("edit! #{filename}\n")
|
127
143
|
zs.write("#{lineno}\nbnext\n") if (result.grep_like?)
|
128
144
|
end
|
129
145
|
|
@@ -131,16 +147,42 @@ class Zoom::Editor
|
|
131
147
|
zq.write("#{filename}:#{lineno}: #{match}\n")
|
132
148
|
end
|
133
149
|
end
|
134
|
-
|
150
|
+
|
151
|
+
if (!already_started)
|
152
|
+
zs.write("silent cfile #{quickfix}\n")
|
153
|
+
else
|
154
|
+
results.each do |result|
|
155
|
+
zs.write("bprev\n") if (result.grep_like?)
|
156
|
+
end
|
157
|
+
zs.write("silent caddf #{quickfix}\n")
|
158
|
+
end
|
135
159
|
|
136
160
|
zq.close
|
137
161
|
zs.close
|
138
162
|
|
139
|
-
|
140
|
-
"#{@editor}
|
141
|
-
|
163
|
+
if (!already_started)
|
164
|
+
system("#{@editor} -c \"source #{source}\" #{@flags}")
|
165
|
+
FileUtils.rm_f(quickfix)
|
166
|
+
FileUtils.rm_f(source)
|
167
|
+
else
|
168
|
+
system(
|
169
|
+
[
|
170
|
+
@editor,
|
171
|
+
@flags,
|
172
|
+
"--remote-send \":source #{source}\n\""
|
173
|
+
].join(" ")
|
174
|
+
)
|
175
|
+
end
|
176
|
+
end
|
142
177
|
|
143
|
-
|
144
|
-
|
178
|
+
def vim_remote_started?
|
179
|
+
return false if (@vimserver.empty?)
|
180
|
+
%x(#{@editor} --serverlist).downcase.match(
|
181
|
+
/^#{@vimserver}$/
|
182
|
+
) do
|
183
|
+
return true
|
184
|
+
end
|
185
|
+
return false
|
145
186
|
end
|
187
|
+
private :vim_remote_started?
|
146
188
|
end
|
data/lib/zoom/wish/reset_wish.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-zoom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|