feat: add ability to select & move multiple units (closes #71)

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-07-21 00:39:29 +03:00
parent 5884a8d195
commit 61776f397a
5 changed files with 126 additions and 55 deletions

View File

@ -67,13 +67,13 @@ type Tracker struct {
}
func (t *Tracker) UnmarshalContent(bytes []byte) error {
var unit sointu.Unit
if errJSON := json.Unmarshal(bytes, &unit); errJSON == nil {
t.PasteUnit(unit)
var units []sointu.Unit
if errJSON := json.Unmarshal(bytes, &units); errJSON == nil {
t.PasteUnits(units)
return nil
}
if errYaml := yaml.Unmarshal(bytes, &unit); errYaml == nil {
t.PasteUnit(unit)
if errYaml := yaml.Unmarshal(bytes, &units); errYaml == nil {
t.PasteUnits(units)
return nil
}
var instr sointu.Instrument