You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
feat(marks): marks keep "view" info and restore it on jump
** RefactorPreviously most functions used to "get" a mark returned a position,changed the line number and sometimes changed even the current buffer.Now functions return a {x}fmark_T making calling context aware whetherthe mark is in another buffer without arcane casting. A new function isprovided for switching to the mark buffer and returning a flag styleEnum to convey what happen in the movement. If the cursor changed, line,columns, if it changed buffer, etc.The function to get named mark was split into multiple functions.- mark_get() -> fmark_T- mark_get_global() -> xfmark_T- mark_get_local() -> fmark_T - mark_get_motion() -> fmark_T - mark_get_visual() -> fmark_TFunctions that manage the changelist and jumplist were also modified toreturn mark types.- get_jumplist -> fmark_T- get_changelist -> fmark_TThe refactor is also seen mainly on normal.c, where all the markmovement has been siphoned through one function nv_gomark, while theother functions handle getting the mark and setting their movementflags. To handle whether context marks should be left, etc.** Mark ViewWhile doing the refactor the concept of a mark view was alsoimplemented:The view of a mark currently implemented as the number of lines betweenthe mark position on creation and the window topline. This allows formoving not only back to the position of a mark but having the windowlook similar to when the mark was defined. This is done by carrying andextra element in the fmark_T struct, which can be extended later to alsorestore horizontal shift.*** User space features1. There's a new option, jumpoptions+=view enables the mark view restoringautomatically when using the jumplist, changelist, alternate-file andmark motions. <C-O> <C-I> g; g, <C-^> '[mark] `[mark]** Limitations- The view information is not saved in shada.- Calls to get_mark should copy the value in the pointer since we are using pos_to_mark() to wrap and provide a homogeneous interfaces. This was also a limitation in the previous state of things.