textbringer 1.4.0 → 1.4.1
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/.github/workflows/push_gem.yml +48 -0
- data/lib/textbringer/buffer.rb +25 -39
- data/lib/textbringer/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c32799602faad1b9a13a0d298bcf922aa4fcac7430fc9f17258e457ef0463bd8
|
4
|
+
data.tar.gz: 853b1b04ed778c8f04117ca23bfe22e0989d79028869d54fbcca7fff65203795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2cc2d14d52bdfe261a5a1499db09a76917e20040b142d5c266131fa255d90cb5823059b719f40cfb608453a1090cc4affa0abf6f741aa3bd587be47b092c87
|
7
|
+
data.tar.gz: c068f9f253ea113ecf2bd082600a89c5dd483a4240a1546f06e08e10e76bb22a9e0ee31fcbb753755687f43b19d73b492f3d3cb207657bd170f7a67ef382b8d9
|
@@ -0,0 +1,48 @@
|
|
1
|
+
name: Publish gem to rubygems.org
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- 'v*'
|
7
|
+
|
8
|
+
permissions:
|
9
|
+
contents: read
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
push:
|
13
|
+
if: github.repository == 'shugo/textbringer'
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
environment:
|
17
|
+
name: rubygems.org
|
18
|
+
url: https://rubygems.org/gems/textbringer
|
19
|
+
|
20
|
+
permissions:
|
21
|
+
contents: write
|
22
|
+
id-token: write
|
23
|
+
|
24
|
+
steps:
|
25
|
+
# Set up
|
26
|
+
- name: Harden Runner
|
27
|
+
uses: step-security/harden-runner@f086349bfa2bd1361f7909c78558e816508cdc10 # v2.8.0
|
28
|
+
with:
|
29
|
+
egress-policy: audit
|
30
|
+
|
31
|
+
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
32
|
+
|
33
|
+
- name: Set up Ruby
|
34
|
+
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
|
35
|
+
with:
|
36
|
+
bundler-cache: true
|
37
|
+
ruby-version: ruby
|
38
|
+
|
39
|
+
# Release
|
40
|
+
- name: Publish to RubyGems
|
41
|
+
uses: rubygems/release-gem@612653d273a73bdae1df8453e090060bb4db5f31 # v1
|
42
|
+
|
43
|
+
- name: Create GitHub release
|
44
|
+
run: |
|
45
|
+
tag_name="$(git describe --tags --abbrev=0)"
|
46
|
+
gh release create "${tag_name}" --verify-tag --draft --generate-notes
|
47
|
+
env:
|
48
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/lib/textbringer/buffer.rb
CHANGED
@@ -187,7 +187,7 @@ module Textbringer
|
|
187
187
|
|
188
188
|
def self.new_buffer_name(name)
|
189
189
|
if @@table.key?(name)
|
190
|
-
(2..
|
190
|
+
(2..).lazy.map { |i|
|
191
191
|
"#{name}<#{i}>"
|
192
192
|
}.find { |i| !@@table.key?(i) }
|
193
193
|
else
|
@@ -1057,47 +1057,11 @@ module Textbringer
|
|
1057
1057
|
end
|
1058
1058
|
|
1059
1059
|
def undo
|
1060
|
-
|
1061
|
-
if @undo_stack.empty?
|
1062
|
-
raise EditorError, "No further undo information"
|
1063
|
-
end
|
1064
|
-
action = @undo_stack.pop
|
1065
|
-
@undoing = true
|
1066
|
-
begin
|
1067
|
-
was_modified = @modified
|
1068
|
-
action.undo
|
1069
|
-
if action.version == @version
|
1070
|
-
@modified = false
|
1071
|
-
action.version = nil
|
1072
|
-
elsif !was_modified
|
1073
|
-
action.version = @version
|
1074
|
-
end
|
1075
|
-
@redo_stack.push(action)
|
1076
|
-
ensure
|
1077
|
-
@undoing = false
|
1078
|
-
end
|
1060
|
+
undo_or_redo(:undo, @undo_stack, @redo_stack)
|
1079
1061
|
end
|
1080
1062
|
|
1081
1063
|
def redo
|
1082
|
-
|
1083
|
-
if @redo_stack.empty?
|
1084
|
-
raise EditorError, "No further redo information"
|
1085
|
-
end
|
1086
|
-
action = @redo_stack.pop
|
1087
|
-
@undoing = true
|
1088
|
-
begin
|
1089
|
-
was_modified = @modified
|
1090
|
-
action.redo
|
1091
|
-
if action.version == @version
|
1092
|
-
@modified = false
|
1093
|
-
action.version = nil
|
1094
|
-
elsif !was_modified
|
1095
|
-
action.version = @version
|
1096
|
-
end
|
1097
|
-
@undo_stack.push(action)
|
1098
|
-
ensure
|
1099
|
-
@undoing = false
|
1100
|
-
end
|
1064
|
+
undo_or_redo(:redo, @redo_stack, @undo_stack)
|
1101
1065
|
end
|
1102
1066
|
|
1103
1067
|
def re_search_forward(s, raise_error: true, count: 1)
|
@@ -1713,6 +1677,28 @@ module Textbringer
|
|
1713
1677
|
end
|
1714
1678
|
end
|
1715
1679
|
|
1680
|
+
def undo_or_redo(op, from_stack, to_stack)
|
1681
|
+
check_read_only_flag
|
1682
|
+
if from_stack.empty?
|
1683
|
+
raise EditorError, "No further #{op} information"
|
1684
|
+
end
|
1685
|
+
action = from_stack.pop
|
1686
|
+
@undoing = true
|
1687
|
+
begin
|
1688
|
+
was_modified = @modified
|
1689
|
+
action.send(op)
|
1690
|
+
if action.version == @version
|
1691
|
+
@modified = false
|
1692
|
+
action.version = nil
|
1693
|
+
elsif !was_modified
|
1694
|
+
action.version = @version
|
1695
|
+
end
|
1696
|
+
to_stack.push(action)
|
1697
|
+
ensure
|
1698
|
+
@undoing = false
|
1699
|
+
end
|
1700
|
+
end
|
1701
|
+
|
1716
1702
|
def new_regexp(s)
|
1717
1703
|
if s.is_a?(Regexp)
|
1718
1704
|
s
|
data/lib/textbringer/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textbringer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shugo Maeda
|
8
|
+
autorequire:
|
8
9
|
bindir: exe
|
9
10
|
cert_chain: []
|
10
|
-
date: 2024-05
|
11
|
+
date: 2024-06-05 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: nkf
|
@@ -205,6 +206,7 @@ files:
|
|
205
206
|
- ".editorconfig"
|
206
207
|
- ".gitattributes"
|
207
208
|
- ".github/workflows/macos.yml"
|
209
|
+
- ".github/workflows/push_gem.yml"
|
208
210
|
- ".github/workflows/ubuntu.yml"
|
209
211
|
- ".github/workflows/windows.yml"
|
210
212
|
- ".gitignore"
|
@@ -272,6 +274,7 @@ homepage: https://github.com/shugo/textbringer
|
|
272
274
|
licenses:
|
273
275
|
- MIT
|
274
276
|
metadata: {}
|
277
|
+
post_install_message:
|
275
278
|
rdoc_options: []
|
276
279
|
require_paths:
|
277
280
|
- lib
|
@@ -286,7 +289,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
289
|
- !ruby/object:Gem::Version
|
287
290
|
version: '0'
|
288
291
|
requirements: []
|
289
|
-
rubygems_version: 3.
|
292
|
+
rubygems_version: 3.5.9
|
293
|
+
signing_key:
|
290
294
|
specification_version: 4
|
291
295
|
summary: An Emacs-like text editor
|
292
296
|
test_files: []
|