Reputation: 21
everyone, i have some confusion with the moving of and in jumplist of vim. i think it's not so suitable for code understanding. suppose that we have some code like:
package main
import "fmt"
func main() {
fmt.Println("vim-go")
hello_world()
final_answer()
}
func hello_world() {
hello()
world()
}
func hello() {
hello1()
}
func hello1() {}
func world() {
world1()
}
func world1() {}
func final_answer() {
final()
answer()
}
func final() {
final1()
}
func final1() {
}
func answer() {
answer1()
}
func answer1() {}
and now i would like to understand what the main function do. So, i have to figoure what the hello_world and final_answer function do and hello, world, final ... the path to understand all of this function i think should be the understand path i want
while when use and to browse the code , i got some jump path like this:
the jumplist of vim is not consistent with the code path i want at step 9 in the pictures.
The way i want is that when i press from the call of world() in function hello_world, i can jump back to the call of hello_world() in main but not the definition of hello1().
anyone know if i use the jumplist of vim the wrong way? or how can i jump back to hello_world when i press at world()?
Upvotes: 1
Views: 412
Reputation: 21
finally, i found a macro in https://github.com/vim/vim/blob/master/src/mark.c#L155
as the comment say
If last used entry is not at the top, put it at the top by rotating the stack until it is (the newer entries will be at the bottom). Keep one entry (the last used one) at the top.
By adding one line in src/Makefile:
EXTRA_DEFS += -DJUMPLIST_ROTATE
and recompile the vim, i can get what i want.
Upvotes: 1