anchor.diff:  
                   DispatchService.AssertGuiThread()
                   Gdk.Threads.Enter()
  -                ast |> Option.iter (fun ast -> 
  +                ast |> Option.iter (fun ast ->
                       let treeStore = treeView.Model :?> TreeStore
                       treeStore.Clear()
                       let toplevel = ast.GetNavigationItems()
  +                                   |> Array.sortBy(fun xs -> xs.Declaration.Range.StartLine)
  + 
                       for item in toplevel do
                           let iter = treeStore.AppendValues(item.Declaration)
  -                        for nested in item.Nested do
  +                        let children = item.Nested
  +                                       |> Array.sortBy(fun xs -> xs.Range.StartLine)
  +
  +                        for nested in children do
                               treeStore.AppendValues(iter, [| nested |]) |> ignore
  +
                       treeView.ExpandAll())
                   Gdk.Threads.Leave()
           | None -> ()
   
           refreshingOutline <- false
           false
  - 
  +
       interface IOutlinedDocument with
  -        member x.GetOutlineWidget() = 
  +        member x.GetOutlineWidget() =
               match treeView with
               | Some(treeView) -> treeView :> Widget
  -            | None -> 
  +            | None ->
                   let treeStore = new TreeStore(typedefof<obj>)
                   let padTreeView = new PadTreeView(treeStore)
   
  -                let setCellIcon (_) (cellRenderer : CellRenderer) (treeModel : TreeModel) (iter : TreeIter) = 
  +                let setCellIcon (_) (cellRenderer : CellRenderer) (treeModel : TreeModel) (iter : TreeIter) =
                       let pixRenderer = cellRenderer :?> CellRendererImage
                       let item = treeModel.GetValue(iter, 0) :?> FSharpNavigationDeclarationItem
                       pixRenderer.Image <- ImageService.GetIcon(ServiceUtils.getIcon item.Glyph, Gtk.IconSize.Menu)
  -                
  -                let setCellText (_) (cellRenderer : CellRenderer) (treeModel : TreeModel) (iter : TreeIter) = 
  +
  +                let setCellText (_) (cellRenderer : CellRenderer) (treeModel : TreeModel) (iter : TreeIter) =
                       let renderer = cellRenderer :?> CellRendererText
                       let item = treeModel.GetValue(iter, 0) :?> FSharpNavigationDeclarationItem
                       renderer.Text <- item.Name
  
positive.code:                     let iter : TreeIter ref = ref Unchecked.defaultof<_>
                      match padTreeView.Selection.GetSelected(iter) with
                      | true -> let node = padTreeView.Model.GetValue(!iter, 0) :?> FSharpNavigationDeclarationItem
                                x.Editor.CaretLine <- node.Range.StartLine
                                x.Editor.CaretColumn <- node.Range.StartColumn
                                ()
                      | false -> ()
  
                  treeView <- Some padTreeView
  
negative.code:                 sw.Add padTreeView
                  sw.ShowAll()
                  sw :> Widget
  
          member x.GetToolbarWidgets() = List.empty<Widget> :> _
          member x.ReleaseOutlineWidget() = ()
  