message: re-apply select-mark to all representation of an updated structure
diff: @@ -12,6 +12,7 @@ import { lociLabel } from '../../../mol-theme/label';
  import { PluginBehavior } from '../behavior';
  import { Interactivity } from '../../util/interactivity';
  import { StateTreeSpine } from '../../../mol-state/tree/spine';
  +import { StateSelection } from '../../../mol-state';
  export const HighlightLoci = PluginBehavior.create({
  name: 'representation-highlight-loci',
  @@ -40,10 +41,7 @@ export const SelectLoci = PluginBehavior.create({
  if (!this.ctx.canvas3d) return;
  this.ctx.canvas3d.mark({ loci: interactionLoci.loci }, action)
  }
  - register() {
  - this.ctx.interactivity.lociSelections.addProvider(this.lociMarkProvider)
  -
  - this.subscribeObservable(this.ctx.events.state.object.created, ({ ref }) => {
  + private applySelectMark(ref: string) {
  const cell = this.ctx.state.dataState.cells.get(ref)
  if (cell && SO.isRepresentation3D(cell.obj)) {
  this.spine.current = cell
  @@ -53,6 +51,19 @@ export const SelectLoci = PluginBehavior.create({
  this.lociMarkProvider({ loci }, MarkerAction.Select)
  }
  }
  + }
  + register() {
  + this.ctx.interactivity.lociSelections.addProvider(this.lociMarkProvider)
  +
  + this.subscribeObservable(this.ctx.events.state.object.created, ({ ref }) => this.applySelectMark(ref));
  +
  + // re-apply select-mark to all representation of an updated structure
  + this.subscribeObservable(this.ctx.events.state.object.updated, ({ ref }) => {
  + const cell = this.ctx.state.dataState.cells.get(ref)
  + if (cell && SO.Molecule.Structure.is(cell.obj)) {
  + const reprs = this.ctx.state.dataState.select(StateSelection.Generators.ofType(SO.Molecule.Structure.Representation3D, ref))
  + for (const repr of reprs) this.applySelectMark(repr.transform.ref)
  + }
  });
  }
  unregister() {
  