Commits


handle tab characters tab characters have their width depending on the column they're in, since they extend to the next multiple of 8. (citation needed?) So, keep track of the column when considering the length (in columns) of the text, so that we can render them properly. In the future we might want to turn them into spaces (either at read or render time) just to stay on the safe side in case not all terminals/ncurses implementations use 8 columns.


prompt before opening the downloads


code: add wrappers for common failure cases Certain calls to well-known functions sometimes result in similar error handling across the code base. Sometimes there's a need to centralise the failure case. Achieve this for common wrappers to often-used functions. The transformation is achieved via coccinelle, commited with this patch. Note that coccinelle can be told to ignore code blocks with comment delimiters. This transformation applies just to telescope's code, and not any of the bundled depdencies in telescope (libgrapheme).


untangle a bit buffers and parsers Now buffers have a nicer interface, taking explicitly the buffer where they push stuff, and the code that deals with buffers doesn't need to peek into the parsers. The parsers now are 'pure' structs without state attached to them, the state was moved to the buffer.


update telescope to make use of mailcap Change telescope to make use of mailcap entries. Commands are no longer prompted for how to handle an unknown mime-type. Commands are now executed via execvp(), and the mailcap handling assumes this as part of its interface.


ui: add capability to run external cmds When telescope encounters a file type which it cannot display it prompts the user whether they wish to save the file, or not. This patch extends this idea -- if the file is saved, then the user is prompted to run a command against that downloaded file. This controllable via the 'external-cmd' setting. It defaults to 'xdg-open'. This is based off work originally started by op@.


garbage collect `dequeue_first_download'


drop the `buffer' flag for enqueue_download it's unused as write_buffer now writes a buffer to the disk.


merge the fs into the ui process The previous separation between the fs and ui process wasn't that good. The idea was to have a `ui' process tightly sandboxed, but it was a lie actually. `ui' was one imsg away from making internet connections and accessing data on the disk, so it wasn't really limited in (almost) any way. Furthermore, having to serialize data to/from the fs proc started to become not really maneagable. As a first step to fix this situation, join the fs and ui process.


add write-buffer saves a page to the disk. Also, changes the order of the downloads so the new one is always at the top.


fix prototype


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.


pass the correct pointer


swap the fields in download lines


switch to our new struct download for the downloads


wrap download page


add download and download.* line styles


add side window for downloads