improve tree#edit and tree#new
Merge branch 'layout'