ocaml-community / zed

Abstract engine for text edition in OCaml
Other
122 stars 16 forks source link

New Action to goto position without setting up the wanted_column #40

Closed kandu closed 4 years ago

kandu commented 4 years ago

To make the editing engine more flexible so upper layer API can simulate some more complicated actions, we may need a new action.

The current Next_line and Prev_line actions are very handy, they set the position without poking wanted_column. If the latest column exceeds the eol of the target line, the cursor will be placed next to the eol position. But this is not how vi behave in its normal mode.

My proposal is to add a new action, so the upper layer, lterm_vi for instance, can be vi compatible. It then can calculate the proper position by itself and tell zed to goto the target position without poking wanted_column, either.

What will be the proper name for the new action? Place Position Teleport any suggestions?

kandu commented 4 years ago

cc @emillon @pmetzger @jeremiedimino