fix Emacs crashing bug when rectangle ends at EOB
Merge branch 'fix-rectangle-end-eob' into lewang-master