Instead of saving the old link colours when selecting a link and using that
to restore them when unselecting it, just copy the data from the document.
- Eliminate struct link_bg and the .link_bg and .link_bg_n members
of struct document_view.
- Eliminate the free_link routine and don't call it from draw_doc,
clear_link, or detach_formatted.
- Add a .old_current_link member to struct view_state and initialise it in
init_vs.
- Don't save link_bg in draw_current_link.
- Rewrite clear_link to use the document data instead of link_bg.
- Modify init_link_drawing not to allocate ling_bg and to return a pointer
to a static variable for the template character.
Introduce html_subscript_close callback. Draw opening and closing brackets
and carets for subscript and superscript text directly in the element
handlers rather than performing weirdness in the renderer. This both
improves readability and fixes bug 284, misplaced brackets with subscripts.
Add close callbacks html_html_close, html_style_close, and
html_xmp_close. end_element now calls the element close callback instead
of performing special handling for certain tags.
src/bfu/menu.c (scroll_menu): Let neither menu->selected nor pos
become -2.
src/bfu/menu.c (menu_mouse_handler): Call set_menu_selection directly
rather than via scroll_menu, as sel is already known to be selectable.
(Not required for fixing the bug.)
src/bfu/menu.c (menu_search_handler): Break infinite loops also if
menu->selected is -1 initially.
src/bfu/menu.c (menu_handler): Instead of tweaking menu->selected
directly, let scroll_menu do it.
This fixes two bugs:
1. Pressing F9 did not make the main menu visible, but then pressing
e.g. Right made it visible.
2. Pressing F9 and then Down displayed the first submenu (File) at the
wrong position on the screen.
src/terminal/tab.c (get_tab_by_number): Assert that the returned
struct window * actually points to a struct window.
src/terminal/tab.c (move_current_tab): Keep tabs contiguous in the
stack of windows. Obey "ui.tabs.wraparound".
src/terminal/terminal.h (struct terminal): Documented that tabs can
move in the stack.
src/terminal/window.c (assert_window_stacking): Check that the main
menu isn't between tabs.
This fixes the bug that tabs opened with -remote used to hide existing
dialogs, which then became unusable until the new tabs were closed.
src/terminal/tab.c (init_tab): Put the new tab immediately above
existing ones, or if it's the first one, then at the bottom of the stack.
Added assertions.
src/terminal/terminal.h (struct terminal): Redocumented the stacking
order of windows.
src/terminal/window.c [CONFIG_DEBUG] (assert_window_stacking): New function.
src/terminal/window.h (assert_window_stacking): New function or no-op macro.