hiro-sun / vscode-emacs

91 stars 103 forks source link

Support for basic Rectangle operations. #32

Open okia opened 7 years ago

okia commented 7 years ago

Fix for issue #27. The following operations are supported:

# Keybinding Description
1. C-x r r Copy rectangle to register
2. C-x r i Insert rectangle from register
3. C-x r d Delete rectangle
4. C-x r k Kill rectangle
5. C-x r y Yank rectangle
6. C-x r o Open rectangle, shifting text right
7. C-x r c Blank out rectangle
8. C-x r t Replace rectangle contents with string on each line

Known issues: Cursor movement(s). Above mentioned rectangle operations do differ from Emacs as follows:

  1. Cursor placement at the end of operation is different than Emacs' The reason for that is setSelection's behavior inside the transaction seems to be somewhat erratic, and using is somewhat complicated (and not done at all for the moment). TODO: This problem might be solvable on vscode-emacs side. INVESTIGATE!
  2. Unlike Emacs, VSCode does not seem to treat cursor movement as a part of transaction. Therefore, undo does not result in the same cursor movement as with Emacs.