Commits


ui_require_input: take a fn pointer instead of the protocol number


set_scroll_position: further semplifications Simplify it even further. There's no need to keep the curfound variable *at all*: if we end the loop, current_line is not found.


set_scroll_position: always set current_line There's a small chance we may end up finding the topline but not the current line if a page content is abruptedly changed. While here also drop `curfound = 1': it's a dead assignment since it returns in that conditions. Bug found while reading the output of clang' scan-build, but not thanks to clang. scan-build complained about the `curfound' variable, and by re-reading the code I spotted the missing case.


don't reset scroll position if the cursor changed line If the user managed to move the cursor before the page load, don't restore the scroll position. This is to avoid unnecessary jumping and causing possible confusion on the user.


save and restore scroll position Save the offset to the first and current line of the buffers and restore it when the page is loaded. This restores almost the exact viewport: we save the offset of the *real* line in the document, but they get wrapped before being displayed, so the actual restored position may be slightly above from the original one (think of a long paragraph that gets wrapped over multiple visual lines.) In practice, this isn't a drawback but only an improvement over the current behaviour. In the future we could save also the offset *inside* the line, to restore the exact position, but that felt unnecessary for now. Persisting the postion on the session file ensures that even when re-opening telescope the scroll position is correct. There are some very active pages, such as antenna or other aggregator, where this feature doesn't really work well if you re-open the page after a while, since new links are available, but otherwise is a god sent! See also github issue #1


fix a couple of printw fmt strings two %d really needs %zu


add fringe prefix and allow to override offset for fringes alone


add vi-like `~' fringes after the end of the buffers


modeline: add an extra - after the trust status char in part for symmetry, and in part because it seems a good spot to add an indicator for the presence of a client certificate in the future.


improve tabs rendering


move parse_last_session to the fs process ~/.telescope/session was parsed in the main process before dropping in the sandbox: that's no good. This moves the initialization of the ui events later in ui_main_loop and makes so that the fs process, after entering the sandbox, parses and sends the content of the last session back to the main process; when it's done the ui gets loaded and telescope is back rocking. I'm plannig to re-use the struct session_tab during the save session operation soon.


use '\e' instead of 27 for esc


use download_cols to wrap the text in the download buffer download_lines is a very small value, for a normally sized terminal is exactly 5. This was the cause behind the download pane glitch, 5 was used as *column number* for the reflow. Now, to be honest, the exact width passed to wrap_page is not important. wrap_page will only wrap the size string, which we know is less than or equal to FMT_SCALED_STRSIZE-1 (6). We could also hardcode the value eventually, but using download_cols reads better.


fmt


extract the key matching logic to its own function