Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 59510a1

Browse files
committed
Allow flip-flop operators to be formatted correctly within IfMod and UnlessMod nodes.
1 parent c8fe73b commit 59510a1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
4242
- Make `Command` and `CommandCall` aware that their arguments could exceed their normal expected bounds because of heredocs.
4343
- Only unescape forward slashes in regular expressions if converting from slash bounds to `%r` bounds.
4444
- Allow `When` nodes to grab trailing comments away from their statements lists.
45+
- Allow flip-flop operators to be formatted correctly within `IfMod` and `UnlessMod` nodes.
4546

4647
### Removed
4748

lib/syntax_tree.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4708,8 +4708,7 @@ def initialize(operator, node)
47084708
end
47094709

47104710
def format(q)
4711-
parent = q.parent
4712-
space = parent.is_a?(If) || parent.is_a?(Unless)
4711+
space = [If, IfMod, Unless, UnlessMod].include?(q.parent.class)
47134712

47144713
left = node.left
47154714
right = node.right

0 commit comments

Comments
 (0)