layout logics for julia mode