diakonos 0.9.8 → 0.9.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/diakonos.conf +2 -2
- data/lib/diakonos/about.rb +2 -1
- data/lib/diakonos/buffer/display.rb +6 -0
- data/lib/diakonos/buffer/file.rb +2 -2
- data/lib/diakonos/buffer.rb +1 -1
- data/lib/diakonos/config.rb +6 -5
- data/lib/diakonos/functions/buffers.rb +4 -2
- data/lib/diakonos/readline.rb +1 -0
- data/lib/diakonos/sessions.rb +1 -1
- data/lib/diakonos/vendor/fuzzy_file_finder.rb +24 -3
- data/lib/diakonos/version.rb +2 -2
- data/lib/diakonos.rb +5 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4545c77e496e0e0c6ff937533229561af94ab385d972e3496909a4fe5005065d
|
4
|
+
data.tar.gz: d29e22867110489b76e8bb3c1c6472313d101d7ad6fe4056950b693a10888fa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d879ffec3cbb1b929e933c8787285ecd94bf86f18942e9ffde6de4cef72eab7916f870ea4609c7802eafa0768fa7d23a8d855e0bb376b5044da89ed7bbf2773f
|
7
|
+
data.tar.gz: 7bd4318931af575436d9816ae1bb58f5656ad44095ba2877fb5dfef877153908d3f034a0bc09846d80a8ba137c531c3be8ae33fbeed15886f7a3b9a49c54d45b
|
data/CHANGELOG
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
Diakonos Changelog
|
2
2
|
------------------
|
3
3
|
|
4
|
+
0.9.9
|
5
|
+
|
6
|
+
- List main culprits (directories) when fuzzy file finder encounters too many files
|
7
|
+
- Add support for extension configuration settings
|
8
|
+
- Make compatible with Ruby 3.2 (re: File.exists?)
|
9
|
+
|
4
10
|
0.9.8
|
5
11
|
|
6
12
|
- Handle symlink cycles when fuzzy file finding (file open)
|
data/diakonos.conf
CHANGED
@@ -918,8 +918,8 @@ lang.javascript.indent.size 2
|
|
918
918
|
lang.javascript.indent.auto true
|
919
919
|
lang.javascript.indent.roundup false
|
920
920
|
#lang.javascript.indent.using_tabs true
|
921
|
-
lang.javascript.indent.indenters (
|
922
|
-
lang.javascript.indent.unindenters (
|
921
|
+
lang.javascript.indent.indenters ([{(])
|
922
|
+
lang.javascript.indent.unindenters ([})])
|
923
923
|
lang.javascript.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
|
924
924
|
lang.javascript.indent.ignore ^(.+:|\s*?)$
|
925
925
|
lang.javascript.indent.closers true
|
data/lib/diakonos/about.rb
CHANGED
@@ -30,7 +30,7 @@ module Diakonos
|
|
30
30
|
f.puts %{
|
31
31
|
# About Diakonos
|
32
32
|
|
33
|
-
Licence:
|
33
|
+
Licence: GNU GPL v3
|
34
34
|
Copyright: Copyright (c) 2004-#{ Time.now.year } Pistos
|
35
35
|
|
36
36
|
## Version
|
@@ -43,6 +43,7 @@ Ruby Version: #{ ::RUBY_VERSION }
|
|
43
43
|
## Paths
|
44
44
|
|
45
45
|
Home dir: #{ @diakonos_home }
|
46
|
+
Session dir: #{ @session.dir }
|
46
47
|
|
47
48
|
### Installation
|
48
49
|
|
@@ -32,6 +32,9 @@ module Diakonos
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
if open_match_text
|
36
|
+
# $diakonos.debug_log "OPEN\t" + [ open_index, open_token_class, open_match_text ].inspect
|
37
|
+
end
|
35
38
|
[ open_index, open_token_class, open_match_text ]
|
36
39
|
end
|
37
40
|
|
@@ -55,6 +58,9 @@ module Diakonos
|
|
55
58
|
end
|
56
59
|
end
|
57
60
|
|
61
|
+
if close_match_text
|
62
|
+
# $diakonos.debug_log "CLOSE\t" + [close_index, close_match_text].inspect
|
63
|
+
end
|
58
64
|
[close_index, close_match_text]
|
59
65
|
end
|
60
66
|
|
data/lib/diakonos/buffer/file.rb
CHANGED
@@ -9,7 +9,7 @@ module Diakonos
|
|
9
9
|
name = @name
|
10
10
|
end
|
11
11
|
|
12
|
-
if @read_only && FileTest.
|
12
|
+
if @read_only && FileTest.exist?( @name ) && FileTest.exist?( name ) && ( File.stat( @name ).ino == File.stat( name ).ino )
|
13
13
|
$diakonos.set_iline "#{name} cannot be saved since it is read-only."
|
14
14
|
else
|
15
15
|
@read_only = false
|
@@ -18,7 +18,7 @@ module Diakonos
|
|
18
18
|
else
|
19
19
|
proceed = true
|
20
20
|
|
21
|
-
if prompt_overwrite && FileTest.
|
21
|
+
if prompt_overwrite && FileTest.exist?( name )
|
22
22
|
proceed = false
|
23
23
|
choice = $diakonos.get_choice(
|
24
24
|
"Overwrite existing '#{name}'?",
|
data/lib/diakonos/buffer.rb
CHANGED
data/lib/diakonos/config.rb
CHANGED
@@ -21,8 +21,8 @@ module Diakonos
|
|
21
21
|
if ! @testing
|
22
22
|
@diakonos_conf = @config_filename || "#{@diakonos_home}/diakonos.conf"
|
23
23
|
|
24
|
-
if ! FileTest.
|
25
|
-
if FileTest.
|
24
|
+
if ! FileTest.exist?( @diakonos_conf )
|
25
|
+
if FileTest.exist?( @global_diakonos_conf )
|
26
26
|
puts "No personal configuration file found."
|
27
27
|
puts "Would you like to copy the system-wide configuration file (#{@global_diakonos_conf}) to use"
|
28
28
|
$stdout.print "as a basis for your personal configuration (recommended)? (y/n)"; $stdout.flush
|
@@ -43,7 +43,7 @@ module Diakonos
|
|
43
43
|
puts "You download one from https://git.sr.ht/~pistos/diakonos/blob/master/diakonos.conf"
|
44
44
|
end
|
45
45
|
|
46
|
-
if ! FileTest.
|
46
|
+
if ! FileTest.exist?( @diakonos_conf )
|
47
47
|
puts "Terminating due to lack of configuration file."
|
48
48
|
exit 1
|
49
49
|
end
|
@@ -161,7 +161,7 @@ module Diakonos
|
|
161
161
|
|
162
162
|
# @return [ConfigFile, ConfigFileUnreadable]
|
163
163
|
def legitimize_config_filename!(prospective_filename, including_config_file)
|
164
|
-
if File.
|
164
|
+
if File.exist?(prospective_filename)
|
165
165
|
ConfigFile.new(
|
166
166
|
File.realpath(prospective_filename),
|
167
167
|
including_config_file
|
@@ -200,7 +200,7 @@ module Diakonos
|
|
200
200
|
case command
|
201
201
|
when "include"
|
202
202
|
self.parse_configuration_file( File.expand_path( arg ), config_file )
|
203
|
-
when
|
203
|
+
when "load_extension"
|
204
204
|
@extensions.load( arg ).each do |conf_file|
|
205
205
|
parse_configuration_file conf_file
|
206
206
|
end
|
@@ -327,6 +327,7 @@ module Diakonos
|
|
327
327
|
when "context.separator", /^lang\..+?\.indent\.ignore\.charset$/,
|
328
328
|
/^lang\.(.+?)\.tokens\.([^.]+)\.change_to$/,
|
329
329
|
/^lang\.(.+?)\.column_delimiters$/,
|
330
|
+
/^extension\.(.+?)\.(.+?)/,
|
330
331
|
"view.nonfilelines.character",
|
331
332
|
'diff_command', 'session.default_session',
|
332
333
|
'clipboard.external'
|
@@ -184,6 +184,7 @@ module Diakonos
|
|
184
184
|
filename = nil
|
185
185
|
do_open = false
|
186
186
|
else
|
187
|
+
# TODO: Maybe a bug here, re: paths relative to session dir (external file find)
|
187
188
|
existing_buffer = @buffers.find { |b| b.name == filename }
|
188
189
|
end
|
189
190
|
|
@@ -304,13 +305,14 @@ module Diakonos
|
|
304
305
|
directories: @session.dir,
|
305
306
|
ceiling: @settings['fuzzy_file_find.max_files'] || 8192,
|
306
307
|
ignores: @fuzzy_ignores,
|
307
|
-
recursive: @settings['fuzzy_file_find.recursive']
|
308
|
+
recursive: @settings['fuzzy_file_find.recursive'],
|
309
|
+
sorted: true
|
308
310
|
)
|
309
311
|
|
310
312
|
finder_block = lambda { |input|
|
311
313
|
break if input =~ %r{^/}
|
312
314
|
|
313
|
-
matches = finder.find(input)
|
315
|
+
matches = finder.find(input)
|
314
316
|
with_list_file do |list|
|
315
317
|
list.puts matches.map { |m| m[:path] }
|
316
318
|
end
|
data/lib/diakonos/readline.rb
CHANGED
data/lib/diakonos/sessions.rb
CHANGED
@@ -249,7 +249,7 @@ module Diakonos
|
|
249
249
|
end
|
250
250
|
|
251
251
|
def cleanup_session
|
252
|
-
if @session && Session.pid_session?(@session.filename) && File.
|
252
|
+
if @session && Session.pid_session?(@session.filename) && File.exist?(@session.filename)
|
253
253
|
File.delete @session.filename
|
254
254
|
end
|
255
255
|
end
|
@@ -125,9 +125,11 @@ class FuzzyFileFinder
|
|
125
125
|
@roots = root_dirnames.map { |d| Directory.new(d, true) }
|
126
126
|
@shared_prefix = determine_shared_prefix
|
127
127
|
@shared_prefix_re = Regexp.new("^#{Regexp.escape(shared_prefix)}" + (shared_prefix.empty? ? "" : "/"))
|
128
|
+
@sorted = params[:sorted]
|
128
129
|
|
129
130
|
@files = []
|
130
131
|
@directories = {} # To detect link cycles
|
132
|
+
@dirs_with_many = []
|
131
133
|
|
132
134
|
rescan!
|
133
135
|
end
|
@@ -201,11 +203,17 @@ class FuzzyFileFinder
|
|
201
203
|
# Array. If +max+ is nil, all matches will be returned.
|
202
204
|
def find(pattern, max=nil)
|
203
205
|
results = []
|
206
|
+
|
204
207
|
search(pattern) do |match|
|
205
208
|
results << match
|
206
209
|
break if max && results.length >= max
|
207
210
|
end
|
208
|
-
|
211
|
+
|
212
|
+
if @sorted
|
213
|
+
results.sort_by { |m| m[:path] }
|
214
|
+
else
|
215
|
+
results
|
216
|
+
end
|
209
217
|
end
|
210
218
|
|
211
219
|
# Displays the finder object in a sane, non-explosive manner.
|
@@ -222,9 +230,22 @@ class FuzzyFileFinder
|
|
222
230
|
if ! @directories[real_dir]
|
223
231
|
@directories[real_dir] = true
|
224
232
|
|
225
|
-
Dir.entries(directory.name)
|
233
|
+
Dir.entries(directory.name)
|
234
|
+
.tap { |_entries|
|
235
|
+
if _entries.length > ceiling/10
|
236
|
+
@dirs_with_many << [_entries.length, directory.name]
|
237
|
+
$diakonos.log "[#{self.class}] Many dir entries: #{_entries.length} in #{directory.name}"
|
238
|
+
end
|
239
|
+
}.each do |entry|
|
226
240
|
next if entry[0,1] == "."
|
227
|
-
|
241
|
+
if files.length > ceiling
|
242
|
+
raise TooManyEntries.new(%{
|
243
|
+
Directories with many entries:
|
244
|
+
|
245
|
+
#{@dirs_with_many.map { |d| d.join("\t") }.join("\n")}
|
246
|
+
|
247
|
+
})
|
248
|
+
end
|
228
249
|
|
229
250
|
full = File.join(directory.name, entry)
|
230
251
|
next if ignore?(full)
|
data/lib/diakonos/version.rb
CHANGED
data/lib/diakonos.rb
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
# :title: Diakonos
|
7
7
|
#
|
8
8
|
# Author:: Pistos
|
9
|
-
# Copyright (c) 2004-
|
9
|
+
# Copyright (c) 2004-2023 Pistos
|
10
10
|
#
|
11
|
-
# This software is released under the
|
11
|
+
# This software is released under the GNU GPL licence v3.
|
12
12
|
# See the LICENCE file included with this program, or
|
13
13
|
# http://www.opensource.org/licenses/mit-license.php
|
14
14
|
#
|
@@ -237,7 +237,7 @@ module Diakonos
|
|
237
237
|
end
|
238
238
|
|
239
239
|
def mkdir( dir )
|
240
|
-
if ! FileTest.
|
240
|
+
if ! FileTest.exist?( dir )
|
241
241
|
Dir.mkdir dir
|
242
242
|
end
|
243
243
|
end
|
@@ -473,7 +473,7 @@ module Diakonos
|
|
473
473
|
FileUtils.rmdir d
|
474
474
|
rescue Errno::ENOTEMPTY
|
475
475
|
end
|
476
|
-
if File.
|
476
|
+
if File.exist? d
|
477
477
|
$stderr.puts "(#{d} not removed)"
|
478
478
|
end
|
479
479
|
end
|
@@ -550,7 +550,7 @@ module Diakonos
|
|
550
550
|
tagfile = "./tags"
|
551
551
|
end
|
552
552
|
|
553
|
-
if ! FileTest.
|
553
|
+
if ! FileTest.exist? tagfile
|
554
554
|
set_iline "(tags file not found)"
|
555
555
|
else
|
556
556
|
IO.foreach( tagfile ) do |line_|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diakonos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pistos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.4.
|
19
|
+
version: 1.4.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.4.
|
26
|
+
version: 1.4.4
|
27
27
|
description: Diakonos is a console text editor for the masses.
|
28
28
|
email: diakonos dawt pistos aet purepistos dawt net
|
29
29
|
executables:
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
|
-
rubygems_version: 3.
|
168
|
+
rubygems_version: 3.3.7
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: Console text editor for the masses
|