Only update ivars when a command happens.
Couldn't determine a reason to update the ivars on every selection change, when we can just calculate them when needed. Should save a lot of calculation as user types.
When duplicating a line, put the cursor at the end of the existing line, instead of the beginning.
When deleting a line, put the cursor at the end of the following line, instead of the beginning.