textbringer 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +12 -4
- data/CHANGES.md +4 -0
- data/appveyor.yml +0 -1
- data/lib/textbringer/config.rb +1 -1
- data/lib/textbringer/faces/basic.rb +1 -0
- data/lib/textbringer/keymap.rb +6 -1
- data/lib/textbringer/mode.rb +5 -1
- data/lib/textbringer/modes/ruby_mode.rb +4 -4
- data/lib/textbringer/utils.rb +1 -1
- data/lib/textbringer/version.rb +1 -1
- data/lib/textbringer/window.rb +5 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7c42284ec820a6074794ed19f174f9ac393d5caa316f8408db5c5e43d5e87041
|
4
|
+
data.tar.gz: 95d805f94fbce11d2858c44a2fd275af3b8cdbfe6aed396a7807ac8543282d31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a849309d4b2d77f350619fced9d26555598777fcde6f42d26439576c0933316a796027c9bc82fa427c4f698cbe581fb3b3428db8cd09ea2b7ecdaf0b6f690e47
|
7
|
+
data.tar.gz: 186933b3607392f5b28d32ab22df7324f960821fb8abb651403db281973e92bd1715d8d0e7841d0a1e1bc57ed50659f28095684e9c7a199e44bc118190aa4c23
|
data/.travis.yml
CHANGED
@@ -4,21 +4,28 @@ matrix:
|
|
4
4
|
- os: linux
|
5
5
|
dist: trusty
|
6
6
|
sudo: false
|
7
|
-
rvm: 2.3.
|
7
|
+
rvm: 2.3.5
|
8
8
|
- os: linux
|
9
9
|
dist: trusty
|
10
10
|
sudo: false
|
11
|
-
rvm: 2.4.
|
11
|
+
rvm: 2.4.3
|
12
|
+
- os: linux
|
13
|
+
dist: trusty
|
14
|
+
sudo: false
|
15
|
+
rvm: 2.5.0
|
12
16
|
- os: linux
|
13
17
|
dist: trusty
|
14
18
|
sudo: false
|
15
19
|
rvm: ruby-head
|
16
20
|
- os: osx
|
17
21
|
osx_image: xcode8.2
|
18
|
-
rvm: 2.3.
|
22
|
+
rvm: 2.3.5
|
23
|
+
- os: osx
|
24
|
+
osx_image: xcode8.2
|
25
|
+
rvm: 2.4.3
|
19
26
|
- os: osx
|
20
27
|
osx_image: xcode8.2
|
21
|
-
rvm: 2.
|
28
|
+
rvm: 2.5.0
|
22
29
|
- os: osx
|
23
30
|
osx_image: xcode8.2
|
24
31
|
rvm: ruby-head
|
@@ -27,6 +34,7 @@ matrix:
|
|
27
34
|
- rvm: ruby-head
|
28
35
|
fast_finish: true
|
29
36
|
cache: bundler
|
37
|
+
before_install: gem update --system
|
30
38
|
script:
|
31
39
|
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
32
40
|
xvfb-run bundle exec rake test;
|
data/CHANGES.md
CHANGED
data/appveyor.yml
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
clone_depth: 10
|
3
3
|
install:
|
4
4
|
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
5
|
-
- gem install bundler --no-document
|
6
5
|
- bundle install
|
7
6
|
- ps: '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12'
|
8
7
|
- ps: Invoke-WebRequest -Uri https://curl.haxx.se/ca/cacert.pem -OutFile C:\projects\textbringer\cacert.pem
|
data/lib/textbringer/config.rb
CHANGED
@@ -13,7 +13,7 @@ module Textbringer
|
|
13
13
|
global_mark_ring_max: 16,
|
14
14
|
window_min_height: 4,
|
15
15
|
syntax_highlight: true,
|
16
|
-
highlight_buffer_size_limit:
|
16
|
+
highlight_buffer_size_limit: 1024,
|
17
17
|
shell_file_name: ENV["SHELL"],
|
18
18
|
shell_command_switch: "-c",
|
19
19
|
grep_command: "grep -nH -e",
|
data/lib/textbringer/keymap.rb
CHANGED
data/lib/textbringer/mode.rb
CHANGED
@@ -6,6 +6,10 @@ module Textbringer
|
|
6
6
|
include Commands
|
7
7
|
|
8
8
|
@@mode_list = []
|
9
|
+
|
10
|
+
DEFAULT_SYNTAX_TABLE = {
|
11
|
+
control: /[\0-\t\v-\x1f\x7f\u{3000}]+/
|
12
|
+
}
|
9
13
|
|
10
14
|
def self.list
|
11
15
|
@@mode_list
|
@@ -61,7 +65,7 @@ module Textbringer
|
|
61
65
|
Buffer.current.apply_mode(child)
|
62
66
|
end
|
63
67
|
@@mode_list.push(child)
|
64
|
-
child.instance_variable_set(:@syntax_table,
|
68
|
+
child.instance_variable_set(:@syntax_table, DEFAULT_SYNTAX_TABLE.dup)
|
65
69
|
end
|
66
70
|
|
67
71
|
attr_reader :buffer
|
@@ -234,12 +234,12 @@ module Textbringer
|
|
234
234
|
break
|
235
235
|
end
|
236
236
|
end
|
237
|
+
@buffer.looking_at?(/[ \t]*/)
|
238
|
+
base_indentation = @buffer.match_string(0).
|
239
|
+
gsub(/\t/, " " * @buffer[:tab_width]).size
|
237
240
|
else
|
238
|
-
|
241
|
+
base_indentation = 0
|
239
242
|
end
|
240
|
-
@buffer.looking_at?(/[ \t]*/)
|
241
|
-
base_indentation = @buffer.match_string(0).
|
242
|
-
gsub(/\t/, " " * @buffer[:tab_width]).size
|
243
243
|
@buffer.goto_char(bol_pos)
|
244
244
|
if line.nil? ||
|
245
245
|
@buffer.looking_at?(/[ \t]*([}\])]|(end|else|elsif|when|rescue|ensure)\b)/)
|
data/lib/textbringer/utils.rb
CHANGED
data/lib/textbringer/version.rb
CHANGED
data/lib/textbringer/window.rb
CHANGED
@@ -354,8 +354,7 @@ module Textbringer
|
|
354
354
|
@highlight_on = {}
|
355
355
|
@highlight_off = {}
|
356
356
|
return if !@@has_colors || !CONFIG[:syntax_highlight] || @buffer.binary?
|
357
|
-
syntax_table = @buffer.mode.syntax_table
|
358
|
-
return if syntax_table.empty?
|
357
|
+
syntax_table = @buffer.mode.syntax_table || DEFAULT_SYNTAX_TABLE
|
359
358
|
if @buffer.bytesize < CONFIG[:highlight_buffer_size_limit]
|
360
359
|
base_pos = @buffer.point_min
|
361
360
|
s = @buffer.to_s
|
@@ -364,6 +363,7 @@ module Textbringer
|
|
364
363
|
len = columns * (lines - 1) / 2 * 3
|
365
364
|
s = @buffer.substring(@buffer.point, @buffer.point + len).scrub("")
|
366
365
|
end
|
366
|
+
return if !s.valid_encoding?
|
367
367
|
re_str = syntax_table.map { |name, re|
|
368
368
|
"(?<#{name}>#{re})"
|
369
369
|
}.join("|")
|
@@ -677,6 +677,9 @@ module Textbringer
|
|
677
677
|
end
|
678
678
|
|
679
679
|
def escape(s)
|
680
|
+
if !s.valid_encoding?
|
681
|
+
s = s.b
|
682
|
+
end
|
680
683
|
if @buffer.binary?
|
681
684
|
s.gsub(/[\0-\b\v-\x1f\x7f]/) { |c|
|
682
685
|
"^" + (c.ord ^ 0x40).chr
|
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.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -259,9 +259,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
259
|
version: '0'
|
260
260
|
requirements: []
|
261
261
|
rubyforge_project:
|
262
|
-
rubygems_version: 2.6
|
262
|
+
rubygems_version: 2.7.6
|
263
263
|
signing_key:
|
264
264
|
specification_version: 4
|
265
265
|
summary: An Emacs-like text editor
|
266
266
|
test_files: []
|
267
|
-
has_rdoc:
|