X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/baf7a940be8927278e3b4b87e7366cebfc16532f..a6a82d96b4906e9e1f09f45f69f48124f11ae1bb:/view.go?ds=inline diff --git a/view.go b/view.go index 9fcd7d8..233e089 100644 --- a/view.go +++ b/view.go @@ -168,6 +168,18 @@ func (v *View) Refresh(node Node) { } } +// Pending tells if a line of the view is not built yet. +func (v *View) Pending() bool { + for _, line := range v.lines { + _, built := v.nodes[line] + if !built { + return true + } + } + + return false +} + // Render returns the view as the model reads it: one line "id+n|text" for each // node inside tags, with the newlines of the text as spaces. func (v *View) Render() string {