Commit Briefs

Omar Polo

guard cmd_scroll_line_up against crashes

buffer->top_line could end up being NULL if we blindly TAILQ_PREV...



Omar Polo

scroll one line more on page up/down

with the new implementation of redraw_window, we need to scroll a line more to "push" for a new page scroll.


Omar Polo

introduce forward_line and don't touch curs_y anymore

redraw_window in ui.c already compute the curs_y by itself, so don't update it from here. Also, introduce forward_line: moves the cursor up/down n lines. It's amazing sometimes how a good interface can simplify a large chunk of code!


Omar Polo

optimisation: cache the top_line vline

instead of using the line_off + vline_nth, cache the current top line.




Omar Polo

added next/previous-heading




Omar Polo

fix end-of-buffer glitch

before, the cursor went one line after the end and glitch everything.


Omar Polo

fix cmd_scroll_line_up

buffer->current_line *IS NOT* the first line at the top of the window...



Omar Polo

move all cmd_* functions in their own file

this detangles definitely the commands from the ui. Various variables and struct from ui.c needed to be exported, aside from that, no functional changes.