Make selections specific to a code view
Created by: lguychard
Having selections as a property of CodeHost
is a problem, because it is incorrect to assume that all code views on the page have the same selections.
This adds getSelections
and observeSelections
as optional properties of CodeViewSpec
, and changes the code to make sure that when selections change, we only set them on the relevant editor. Selections are parsed from the URL hash on single file code views, only for code hosts where this is relevant (GitHub, Gitlab).