andri-ch / gotoword

vim plugin that gives users the possibility to write and access documentation about the word or expr. under cursor
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Create back/forward navigation history buttons #38

Closed andri-ch closed 8 years ago

andri-ch commented 9 years ago

subtask of #32.

When user types :Helper or clicks on a link, a "Back" button and a "Forward" button should exist: if user presses "Back", it will get back to the previous help buffer template (and view, implicitly).

Vim can keep the navigation history for tabs & windows by itself or by using plugins, but it can't keep the history of buffer views that this plugin uses.

Useful references about how to implement a history object: this one I think is the best: https://www.quora.com/What-data-structure-is-used-to-implement-the-back-and-forward-button-of-a-browser

1 http://www.sightspecific.com/~mosh/www_faq/back.html mentions about the history stack/list a browser keeps, and about the differences between user clicking a link to previous page and user pressing Back button in browser.

2 http://stackoverflow.com/questions/1313788/how-does-the-back-button-in-a-web-browser-work detailed explanation complementing the first one, and the cached/non-cached pages. One of the last comments shows a Pseudo-code implementation.

3 http://ux.stackexchange.com/questions/7909/do-users-understand-the-browser-back-button usage of Back/Forward buttons statistics and how tabs are better than Back/Forward buttons because they save the info user filled in inside a form, and too many Back btn presses are not convenient.

4 https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history gives details about how Firefox implements tab/window history.

andri-ch commented 8 years ago

solve the "header" key error resulted from the fact that template.template() is not always called with a header. checkout the log to see at what rate/how the "history" is growing. rewrite @history to properly display the header.

andri-ch commented 8 years ago

https://github.com/andri-ch/gotoword/commit/1c720807e5becef40db6d06d65d238bae025284b