oppen 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2e8ac9f3609e4e4d0f64e5b4b9fdbbe6856e23532b995a52281a14577a894c9
4
- data.tar.gz: 5451a9f1c73b37f7d66693698ba6d1cc6551c85b98a0953b057a4bf7de145081
3
+ metadata.gz: 209072194fbb082bd25f2583b7f930e38c79ca042c21e711e18dd7295ee00e86
4
+ data.tar.gz: 6eeb620d7d3bd6599477a46a2a5b9df86db2bc8c6a0f07a619d065245393127f
5
5
  SHA512:
6
- metadata.gz: c3a98ad61c3486094b13cb9fd200f18184fd6b475c35fc76284e58e2b194c2c74ab4a42568ae405c385a0165e75f1b6d144c96e1fb2f70e330bde063fed7c89b
7
- data.tar.gz: d760f00dc3c26800c254b07b19ecb62703920e4feaa6023814c1d611d3989768f2b916296615358a0729d45fdee2369f1fdf880e3c5c1e97ac7c97d5c4a46d65
6
+ metadata.gz: a2f8d7bd7b199b7ef0d5a97feebbe456fea9e557f6535760ad84b21a304d73c52ea954f392e7c07e0b682844fe86c0c8ccc4ef6786057785cba9f02f58c31c14
7
+ data.tar.gz: 31a73892d3afff56d85c60a6756d6fedbd2bce259d7ca259b662a7f7002549fcb53146f2fb1a32136ae2c8cca03b20ded90d95a814363d18d0d80192db79c39b
@@ -53,6 +53,7 @@ module Oppen
53
53
  else
54
54
  ->(n) { space * n }
55
55
  end
56
+ @indent = 0
56
57
  @items = []
57
58
  @new_line = new_line
58
59
  @width = width
@@ -177,7 +178,13 @@ module Oppen
177
178
  #
178
179
  # @see Token::String
179
180
  def handle_string(token, token_width)
181
+ return if token.value.empty?
182
+
180
183
  @space = [0, space - token_width].max
184
+ if @indent.positive?
185
+ indent @indent
186
+ @indent = 0
187
+ end
181
188
  write token
182
189
  end
183
190
 
@@ -223,9 +230,9 @@ module Oppen
223
230
  write new_line
224
231
  if config&.indent_anchor == Config::IndentAnchor::ON_BEGIN
225
232
  @space = width - top.offset - amount
226
- indent width - space
233
+ @indent = width - space
227
234
  else
228
- indent amount
235
+ @indent = amount
229
236
  end
230
237
  end
231
238
 
data/lib/oppen/version.rb CHANGED
@@ -5,5 +5,5 @@ module Oppen
5
5
  # Oppen version
6
6
  #
7
7
  # @return [String] current version
8
- VERSION = '0.9.5' # managed by release.sh
8
+ VERSION = '0.9.6' # managed by release.sh
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oppen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amine Mike El Maalouf <amine.el-maalouf@epita.fr>
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-11-21 00:00:00.000000000 Z
12
+ date: 2024-11-25 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Implementation of the Oppen's pretty printing algorithm
15
15
  email: