In Sublime when you use swap-line and selection being swapped goes out of the view sublime scrolls with it. but that was not happening in code mirror. so i added  '''scrollIntoView'''