Skip to content

Commit 9fd2418

Browse files
committed
Use @stopped_doc flag to preserve :stopdoc: across done_documenting reset
The previous approach (checking done_documenting == value) was too broad and hid 501 items that should remain visible. Instead, track :stopdoc: state with a dedicated @stopped_doc flag. When done_documenting= resets document_self, it skips the reset if @stopped_doc is set. The flag is cleared by :startdoc:. This precisely preserves :stopdoc: directives without affecting classes that need the done_documenting reset for file reopening.
1 parent 22cdb76 commit 9fd2418

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/rdoc/code_object.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def initialize_visibility # :nodoc:
125125
@received_nodoc = false
126126
@ignored = false
127127
@suppressed = false
128+
@stopped_doc = false
128129
@track_visibility = true
129130
end
130131

@@ -204,9 +205,8 @@ def documented?
204205

205206
def done_documenting=(value)
206207
return unless @track_visibility
207-
return if @done_documenting == value
208208
@done_documenting = value
209-
@document_self = !value
209+
@document_self = !value unless @stopped_doc
210210
@document_children = @document_self
211211
end
212212

@@ -344,6 +344,7 @@ def start_doc
344344
@document_children = true
345345
@ignored = false
346346
@suppressed = false
347+
@stopped_doc = false
347348
end
348349

349350
##
@@ -354,6 +355,7 @@ def stop_doc
354355

355356
@document_self = false
356357
@document_children = false
358+
@stopped_doc = true
357359
end
358360

359361
##

0 commit comments

Comments
 (0)