lyuts / vim-rtags

Vim bindings for rtags, llvm/clang based c++ code indexer.
BSD 2-Clause "Simplified" License
282 stars 56 forks source link

simple list-based jump back implementation #34

Closed pdavydov108 closed 8 years ago

pdavydov108 commented 8 years ago

Hello, @lyuts , I implemented a very simple function to go back after jump to some location. In general, one every jump it stores previous location to a list (the number of entries in it is limited to 100 to prevent this list to be too long in case when somebody doesn't use this function). I also added a rb mapping. It works well for me. What do you think? Do you like it?

lyuts commented 8 years ago

@pdavydov108 , thanks for implementing this kind of functionality, as I didn't have to dedicate for doing this. Overall, I like the approach and I think it is sufficient enough for the desired functionality. I do have couple comments, but they aren't critical. Instead of calling saveLocation before each call to jumpLocation it might be easier and cleaner to call saveLocation inside jumpLocation. This way it should be easier to maintaint and more future error prone if more jump invocations are to appear. Also, if you don't mind, can we make the list/stack size configurable through a variable.

pdavydov108 commented 8 years ago

@lyuts , please check it again, I fixed the issues you told me about, and I also added a few words about new features to README.

lyuts commented 8 years ago

Looks good. Thank you very much.