the current window that is being edited should probably be stored somewhere and then the reference is swapped with another window