Skip to content

Commit

Permalink
.: fix a few bugs (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbentley authored and Dan Miller committed Jan 9, 2019
1 parent 6420756 commit 2b1cf45
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions internal/engine/upper.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ func handleConfigsReloaded(
Reason: model.BuildReasonFlagConfig,
}
setLastTiltfileBuild(state, status)
if event.Err != nil {
// There was an error, so don't update status with the new, nonexistent state
return
}

newDefOrder := make([]model.ManifestName, len(manifests))
for i, m := range manifests {
Expand Down
4 changes: 3 additions & 1 deletion internal/hud/hud.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ func (h *Hud) handleScreenEvent(ctx context.Context, dispatch func(action store.
am := h.activeModal()
if am == nil {
selectedIdx, r := h.selectedResource()

if selectedIdx == 0 {
break
}
if r.IsYAML() {
h.currentViewState.AlertMessage = fmt.Sprintf("YAML Resources don't have logs")
break
Expand Down
2 changes: 1 addition & 1 deletion internal/model/globalyaml.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package model

// TODO(maia): throw an error if you try to name a manifest this in your Tiltfile?
const GlobalYAMLManifestName = ManifestName("GlobalYAML")
const GlobalYAMLManifestName = ManifestName("k8s_yaml")

type YAMLManifest struct {
name ManifestName
Expand Down
9 changes: 9 additions & 0 deletions internal/rty/scroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,22 @@ func adjustElementScroll(prevInt interface{}, newChildren []string) (*ElementScr
next := &clone
next.children = newChildren

if len(newChildren) == 0 {
next.elementIdx = 0
return next, ""
}
if len(prev.children) == 0 {
sel := ""
if len(next.children) > 0 {
sel = next.children[0]
}
return next, sel
}
if prev.elementIdx >= len(prev.children) {
// NB(dbentley): this should be impossible, but we were hitting it and it was crashing
next.elementIdx = 0
return next, ""
}
prevChild := prev.children[prev.elementIdx]
for i, child := range newChildren {
if child == prevChild {
Expand Down

0 comments on commit 2b1cf45

Please sign in to comment.