textbringer 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +1 -1
- data/.travis.yml +3 -2
- data/CHANGES.md +6 -0
- data/appveyor.yml +4 -2
- data/exe/tbclient +0 -1
- data/lib/textbringer/buffer.rb +4 -4
- data/lib/textbringer/commands/fill.rb +4 -4
- data/lib/textbringer/commands/isearch.rb +1 -1
- data/lib/textbringer/commands/server.rb +3 -3
- data/lib/textbringer/keymap.rb +1 -0
- data/lib/textbringer/modes/programming_mode.rb +1 -1
- data/lib/textbringer/modes/ruby_mode.rb +1 -1
- data/lib/textbringer/version.rb +1 -1
- data/textbringer.gemspec +3 -4
- metadata +10 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2244343a4baaddd8efff307da619579a102c66d61c14f5dcebdba589b7f809ba
|
4
|
+
data.tar.gz: 0e59492b0f35673c3d0658d7c96c55288734017ace2edb1c58fddcdf22ca9976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 680ea08b6a0c55e0a514f8da5708cbbcde48efe50747b9f7fdf96ec39264619abfbfbab32a7ca03577885e8691c2d221e563d2fcd98c8bc3dd4e3cd9b647ac10
|
7
|
+
data.tar.gz: bac76f72017761cb3c46ff83a0d3f0dee86e811940dc97bd79c6665231f621989c262be1c17ca70d75eb5f1885fd55190062240e5b6d886c29894172a2c3c39c
|
data/.editorconfig
CHANGED
data/.travis.yml
CHANGED
@@ -34,14 +34,15 @@ matrix:
|
|
34
34
|
- rvm: ruby-head
|
35
35
|
fast_finish: true
|
36
36
|
cache: bundler
|
37
|
-
before_install:
|
37
|
+
before_install:
|
38
|
+
- gem update --system
|
39
|
+
- gem install bundler-audit
|
38
40
|
script:
|
39
41
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
40
42
|
xvfb-run bundle exec rake test;
|
41
43
|
else
|
42
44
|
bundle exec rake test;
|
43
45
|
fi
|
44
|
-
- bundle exec bundle-audit check --update
|
45
46
|
env:
|
46
47
|
global:
|
47
48
|
UPLOAD_TO_CODECOV: 1
|
data/CHANGES.md
CHANGED
data/appveyor.yml
CHANGED
data/exe/tbclient
CHANGED
data/lib/textbringer/buffer.rb
CHANGED
@@ -412,8 +412,8 @@ module Textbringer
|
|
412
412
|
f.flock(File::LOCK_EX)
|
413
413
|
write_to_file(f)
|
414
414
|
f.flush
|
415
|
-
@file_mtime = f.mtime
|
416
415
|
end
|
416
|
+
@file_mtime = File.mtime(file_name)
|
417
417
|
rescue Errno::EISDIR
|
418
418
|
if @name
|
419
419
|
file_name = File.expand_path(@name, file_name)
|
@@ -524,7 +524,7 @@ module Textbringer
|
|
524
524
|
if pos < 0 || pos > size
|
525
525
|
raise RangeError, "Out of buffer"
|
526
526
|
end
|
527
|
-
if !@binary && /[\x80-\xbf]/n
|
527
|
+
if !@binary && /[\x80-\xbf]/n.match?(byte_after(pos))
|
528
528
|
raise ArgumentError, "Position is in the middle of a character"
|
529
529
|
end
|
530
530
|
@goal_column = nil
|
@@ -578,12 +578,12 @@ module Textbringer
|
|
578
578
|
|
579
579
|
def newline
|
580
580
|
indentation = save_point { |saved|
|
581
|
-
if /[ \t]
|
581
|
+
if /[ \t]/.match?(char_after)
|
582
582
|
next ""
|
583
583
|
end
|
584
584
|
beginning_of_line
|
585
585
|
s = @point
|
586
|
-
while /[ \t]
|
586
|
+
while /[ \t]/.match?(char_after)
|
587
587
|
forward_char
|
588
588
|
end
|
589
589
|
str = substring(s, @point)
|
@@ -44,7 +44,7 @@ module Textbringer
|
|
44
44
|
while c = input.getc
|
45
45
|
if c == "\n"
|
46
46
|
if column < fill_column && !input.eof?
|
47
|
-
if /(?=[\u{0000}-\u{00FF}])[[:graph:]]
|
47
|
+
if /(?=[\u{0000}-\u{00FF}])[[:graph:]]/.match?(prev_c)
|
48
48
|
column = insert_space_between_words(input, output, column)
|
49
49
|
end
|
50
50
|
next
|
@@ -53,7 +53,7 @@ module Textbringer
|
|
53
53
|
else
|
54
54
|
w = Buffer.display_width(c)
|
55
55
|
if column + w > fill_column || column >= fill_column
|
56
|
-
if /\w
|
56
|
+
if /\w/.match?(prev_c) && /\w/.match?(c)
|
57
57
|
column = insert_newline_before_word(output, column)
|
58
58
|
else
|
59
59
|
column = insert_newline(output)
|
@@ -69,7 +69,7 @@ module Textbringer
|
|
69
69
|
def insert_space_between_words(input, output, column)
|
70
70
|
c = input.getc
|
71
71
|
input.ungetc(c)
|
72
|
-
if /(?=[\u{0000}-\u{00FF}])[[:graph:]]
|
72
|
+
if /(?=[\u{0000}-\u{00FF}])[[:graph:]]/.match?(c)
|
73
73
|
output << " "
|
74
74
|
column + 1
|
75
75
|
else
|
@@ -93,7 +93,7 @@ module Textbringer
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def insert_char(output, column, c, w)
|
96
|
-
if column == 0 && /[ \t]
|
96
|
+
if column == 0 && /[ \t]/.match?(c)
|
97
97
|
column
|
98
98
|
else
|
99
99
|
output << c
|
@@ -34,14 +34,14 @@ module Textbringer
|
|
34
34
|
|
35
35
|
class Server
|
36
36
|
def eval(s)
|
37
|
-
|
37
|
+
with_redisplay do
|
38
38
|
Controller.current.instance_eval(s).inspect
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
def visit_file(filename, wait: true)
|
43
43
|
queue = Queue.new if wait
|
44
|
-
|
44
|
+
with_redisplay do
|
45
45
|
find_file(filename)
|
46
46
|
Buffer.current[:client_wait_queue] = queue if wait
|
47
47
|
end
|
@@ -50,7 +50,7 @@ module Textbringer
|
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
-
def
|
53
|
+
def with_redisplay
|
54
54
|
foreground! do
|
55
55
|
begin
|
56
56
|
yield
|
data/lib/textbringer/keymap.rb
CHANGED
@@ -136,6 +136,7 @@ module Textbringer
|
|
136
136
|
GLOBAL_MAP.define_key(?\C-y, :yank)
|
137
137
|
GLOBAL_MAP.define_key("\ey", :yank_pop)
|
138
138
|
GLOBAL_MAP.define_key(?\C-_, :undo)
|
139
|
+
GLOBAL_MAP.define_key("\C-xu", :undo)
|
139
140
|
GLOBAL_MAP.define_key("\C-x\C-_", :redo_command)
|
140
141
|
GLOBAL_MAP.define_key("\C-t", :transpose_chars)
|
141
142
|
GLOBAL_MAP.define_key("\C-j", :newline)
|
@@ -63,7 +63,7 @@ module Textbringer
|
|
63
63
|
@buffer.save_excursion do
|
64
64
|
pos = @buffer.point
|
65
65
|
@buffer.beginning_of_line
|
66
|
-
if /\A[ \t]+\z
|
66
|
+
if /\A[ \t]+\z/.match?(@buffer.substring(@buffer.point, pos))
|
67
67
|
@buffer.delete_region(@buffer.point, pos)
|
68
68
|
end
|
69
69
|
end
|
@@ -277,7 +277,7 @@ module Textbringer
|
|
277
277
|
case text
|
278
278
|
when "class", "module", "def", "if", "unless", "case",
|
279
279
|
"do", "for", "while", "until", "begin"
|
280
|
-
if /\A(if|unless|while|until)\z
|
280
|
+
if /\A(if|unless|while|until)\z/.match?(text)
|
281
281
|
ts = tokens[0...i].reverse_each.take_while { |(l,_),| l == line }
|
282
282
|
t = ts.find { |_, e| e != :on_sp }
|
283
283
|
next if t && !(t[1] == :on_op && t[2] == "=")
|
data/lib/textbringer/version.rb
CHANGED
data/textbringer.gemspec
CHANGED
@@ -19,19 +19,18 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.required_ruby_version = '>= 2.
|
22
|
+
spec.required_ruby_version = '>= 2.4'
|
23
23
|
|
24
|
-
spec.add_runtime_dependency "curses", ">= 1.2.
|
24
|
+
spec.add_runtime_dependency "curses", ">= 1.2.7"
|
25
25
|
spec.add_runtime_dependency "unicode-display_width", "~> 1.1"
|
26
26
|
spec.add_runtime_dependency "clipboard", "~> 1.1"
|
27
27
|
spec.add_runtime_dependency "fiddley", ">= 0.0.5"
|
28
28
|
spec.add_runtime_dependency "editorconfig"
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler"
|
30
|
+
spec.add_development_dependency "bundler"
|
31
31
|
spec.add_development_dependency "rake", "~> 12.0"
|
32
32
|
spec.add_development_dependency "test-unit"
|
33
33
|
spec.add_development_dependency "simplecov"
|
34
34
|
spec.add_development_dependency "codecov"
|
35
|
-
spec.add_development_dependency "bundler-audit"
|
36
35
|
spec.add_development_dependency "ripper-tags"
|
37
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textbringer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-08 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.2.
|
19
|
+
version: 1.2.7
|
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.2.
|
26
|
+
version: 1.2.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: unicode-display_width
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: bundler-audit
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: ripper-tags
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -255,7 +241,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
241
|
requirements:
|
256
242
|
- - ">="
|
257
243
|
- !ruby/object:Gem::Version
|
258
|
-
version: '2.
|
244
|
+
version: '2.4'
|
259
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
246
|
requirements:
|
261
247
|
- - ">="
|
@@ -263,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
249
|
version: '0'
|
264
250
|
requirements: []
|
265
251
|
rubyforge_project:
|
266
|
-
rubygems_version:
|
252
|
+
rubygems_version: 3.0.0.beta3
|
267
253
|
signing_key:
|
268
254
|
specification_version: 4
|
269
255
|
summary: An Emacs-like text editor
|