@@ -692,6 +692,14 @@ def _update_items(self, result=None, error=None):
692692 alignment = QtCore .Qt .AlignmentFlag .AlignLeft | QtCore .Qt .AlignmentFlag .AlignTop
693693
694694 for i , tag in enumerate (self .tag_diff .tag_names ):
695+ is_preserved = tag in self .preserved_tags
696+ if tag == '~length' or is_preserved :
697+ self .tag_diff .set_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
698+ new_item_flags = orig_flags
699+ elif tag != '~length' :
700+ self .tag_diff .unset_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
701+ new_item_flags = new_flags
702+
695703 color = self .colors .get (self .tag_diff .tag_status (tag ),
696704 self .colors [TagStatus .NOCHANGE ])
697705
@@ -726,18 +734,14 @@ def _update_items(self, result=None, error=None):
726734 new_item = QtWidgets .QTableWidgetItem ()
727735 new_item .setTextAlignment (alignment )
728736 self .setItem (i , self .COLUMN_NEW , new_item )
729- if is_preserved or tag == '~length' :
730- self .tag_diff .set_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
731- new_item .setFlags (orig_flags )
732- else :
733- if tag != '~length' :
734- self .tag_diff .unset_bits (tag , TagStatus .NOTREMOVABLE | TagStatus .READONLY )
735- new_item .setFlags (new_flags )
736- self ._set_item_value (new_item , self .tag_diff .new , tag )
737+ new_item .setFlags (new_item_flags )
738+
737739 font = new_item .font ()
738740 strikeout = self .tag_diff .tag_status (tag ) == TagStatus .REMOVED
739741 font .setStrikeOut (strikeout )
740742 new_item .setFont (font )
743+
744+ self ._set_item_value (new_item , self .tag_diff .new , tag )
741745 new_item .setForeground (color )
742746
743747 # Adjust row height to content size
0 commit comments