Add expand_stack for testing purposes
Add method to detect if selection has line break
Skip some expansions when selection contains line break