File tree 1 file changed +7
-4
lines changed 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -101,18 +101,21 @@ def __set_lines_visibility(self, last_n_blocks: int = 0) -> None:
101
101
102
102
start_from_block_number = 0 if not last_n_blocks else document .blockCount () - last_n_blocks
103
103
104
+ previous_visible_entry = None
104
105
for line_n in range (start_from_block_number , document .blockCount ()):
105
106
block = document .findBlockByNumber (line_n )
106
107
log_entry = block .text ()[self .entry_ctime_part_len :]
107
108
108
- if (
109
- log_entry
110
- and self .__text_line_is_excluded (log_entry )
109
+ if log_entry and ( # noqa: SIM114
110
+ self .__text_line_is_excluded (log_entry )
111
111
or not self .__text_line_matches_filter (log_entry )
112
112
):
113
113
block .setVisible (False )
114
+ elif not log_entry and not previous_visible_entry : # two separators in a row
115
+ block .setVisible (False )
114
116
else :
115
117
block .setVisible (True )
118
+ previous_visible_entry = log_entry
116
119
117
120
self .setDocument (document )
118
121
@@ -170,7 +173,7 @@ def __add_entry(self, log_entries: list[str]) -> None:
170
173
self .verticalScrollBar ().setValue (self .verticalScrollBar ().maximum ())
171
174
172
175
if self .__filter_text_parts or self .__exclude_text_parts :
173
- self .__apply_filter (len (log_entries ))
176
+ self .__apply_filter (len (log_entries ) + 1 )
174
177
175
178
@staticmethod
176
179
def pause_logging () -> None :
You can’t perform that action at this time.
0 commit comments