about summary refs log tree commit diff stats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* pager: fix compilation on 1.6.14bptato2024-02-171-1/+1
|
* regex: re-work compileSearchRegexbptato2024-02-179-79/+127
| | | | | | | I've gotten tired of not being able to search for forward slashes. Now it works like in vim, and you can also set default ignore case in the config.
* term: fix coloring messbptato2024-02-173-32/+178
| | | | | | | | | | | | | | | | | | | | | | | | | Until now, the config file required manual adjustment for the output to look bearable on terminals colored differently than {bgcolor: black, fgcolor: white}. Also, it only detected RGB when COLORTERM was set, but this is not done by most (any?) terminal emulators (sad). To improve upon the situation, we now query the terminal for some attributes on startup: * OSC(10/11, ?) -> get the terminal's bg/fgcolor * DCS(+, q, 524742) -> XTGETTCAP for the "RGB" capability (only supported by a few terminals, but better than nothing) * Primary device attributes -> check if ANSI colors are supported, also make sure we don't block indefinitely even if the previous queries fail If primary device attributes does not return anything, we hang until the user types something, then notify the user that something went wrong, and tell them how to fix it. Seems like an OK fallback. (The DA1 idea comes from notcurses; since this is implemented by pretty much every terminal emulator, we don't have to rely on slow timing hacks to skip non-supported queries.)
* winattrs: remove unnecessary call, fix height_px fallbackbptato2024-02-173-6/+6
| | | | no need for every new buffer to query the window size
* css: reduce CSSComputedValue sizebptato2024-02-172-118/+96
| | | | | | | The `t' field was completely redundant, as it's already included in the CSSComputedValues index. + removed some unused functions
* More bgcolor fixesbptato2024-02-171-10/+7
| | | | | | * fix accidental dependency on previously chosen bgcolor (ouch) * also draw empty background boxes for bgcolor-is-canvas boxes * remove unused variable
* layout: use html/body bgcolor as canvas bgcolorbptato2024-02-176-46/+74
| | | | | | This is required by the standard. (Without this, lots of websites have incorrect background colors, because they set the body height to 100% of the viewport.)
* layout: only reset charwidth on non-word atomsbptato2024-02-161-1/+1
| | | | | | | | charwidth is specifically intended to represent the width of all characters until the current one, so resetting it for words makes no sense. Originally it was reset for all atoms *except* words; 9fdea97d simplified the code incorrectly (flipped the logic) and thus introduced a regression.
* container: set color on double width char + tab fillersbptato2024-02-161-7/+10
|
* layout: avoid wrapping on dash inside double-width linesbptato2024-02-161-0/+4
| | | | | Without this we were wrapping on the last dash (if any) inside CJK sentences.
* so close!bptato2024-02-151-5/+7
| | | | but I forgot to ensure the output stream gets closed. :(
* loader: fix crash on file redirection inputsbptato2024-02-152-16/+60
| | | | | | | | cha -d <some-file was crashing loader, because it was trying to register the regular file in the selector. this patch fixes the problem, but the control flow of loader looks like spaghetti now
* pager: increase numload for stdinbptato2024-02-151-0/+1
| | | | otherwise pages from stdin have a race condition in dump
* dom: fix href stringifierbptato2024-02-151-0/+2
| | | | Return the empty string if it's unset.
* pager: enable wait in runMailcapWritePipebptato2024-02-141-1/+1
| | | | | | Otherwise, container will just happily kill the buffer and with it the loader process before it would have had the chance to stream out the input into the external process.
* Various refactorings & fixesbptato2024-02-1413-243/+127
| | | | | | | | * disallow Stream interface usage on non-blocking PosixStreams * do not read estream of forkserver byte-by-byte (it's slow) * do not call writeData with a zero len in formdata * do not quote numbers in mailcap quoteFile * remove some unused stuff
* buffer: improve style invalidationbptato2024-02-144-7/+9
|
* buffer: fix regression on htmloutput document baseURLbptato2024-02-141-3/+2
| | | | | readFromFd replacing the base URL of the buffer turns out to be a very bad idea.
* pager: reduce boilerplatebptato2024-02-143-35/+26
| | | | also spawn less processes in some cases
* pager: warn on protocol switching redirectsbptato2024-02-141-4/+16
| | | | TODO should be configurable
* css: hide noscript tags when scripting is enabledbptato2024-02-132-3/+25
|
* buffer: skip rewind after the first readbptato2024-02-131-7/+17
| | | | | Speeds up processing of pretty much all documents, because we rarely need to switch the charset after having downloaded the first chunk.
* loader: fix delOutput bug, remove ErrorWouldBlockbptato2024-02-133-28/+15
|
* loader: fixes & improvementsbptato2024-02-135-176/+125
| | | | | | | | * factor out pushBuffer to make loadFromCache async * fix incorrect cache path * replace rewind with loadFromCache (it does the same thing except actually works) * remove rewindImpl callback, rewind in buffer instead
* buffer: more form fixesbptato2024-02-134-26/+45
|
* buffer: fix wrong click behavior with JSbptato2024-02-131-1/+1
| | | | | do_reshape could move the target element, and thus call click on the wrong clickable.
* container: allow dismissing loadinfobptato2024-02-132-8/+15
| | | | it broke line info in console since it's never fully loaded
* container: do not reshape twice on loading documentsbptato2024-02-121-18/+18
|
* buffer: form fixesbptato2024-02-123-54/+50
| | | | | * show submission URL on hover for all form-associated elements * skip non-checked checkbox/radio inputs
* stricter typingbptato2024-02-121-3/+4
|
* buffersource: remove location fieldbptato2024-02-124-31/+33
|
* io: remove multistream, teestreambptato2024-02-122-74/+0
| | | | unused (hopefully forever)
* Add pager.externFilterSourcebptato2024-02-125-16/+85
| | | | useful for filtering stuff through commands like rdrview
* Remove CLONE BufferSource; cache document sources in tmpdirbptato2024-02-1218-338/+443
| | | | | | | | | | | | | | | | | | | | | | | At last all BufferSources are unified. To achieve the same effect as the previous CLONE source type, we now use the "fromcache" flag in Request. This *forces* the document to be streamed from the disk; if the file no longer exists for some reason, an error is returned (i.e. the document is not re-downloaded). For a document to be cached, it has to be the main document of the buffer (i.e. no additional resources requested with fetch()), and also not an x-htmloutput HTML file (for those, the original source is saved). The result is that toggleSource now always returns the actual source for e.g. markdown files, not the HTML-transformed version. Also, it is now possible to view the source of a document that is still being downloaded. buffer.sstream has almost been eliminated; it still exists, but only as a pseudo-buffer to interface with EncoderStream and DecoderStream. It no longer holds the entire source of a buffer at any point, and is cleared as soon as the buffer is completely loaded.
* fix rejection of readFromFd urlsbptato2024-02-111-1/+1
|
* pager: fix discardTreebptato2024-02-111-4/+6
|
* container: fix cursorToggleSelection on double-width charactersbptato2024-02-111-3/+4
|
* layout: skip newlines between full-width charactersbptato2024-02-111-0/+19
| | | | | | Crucially, *only* between full-width characters. So "あ\nあ" is rendered as "ああ", but "あ\na" remains "あ a" (with a space inbetween).
* simplify newLoaderBufferbptato2024-02-111-4/+3
|
* loader: significantly more efficient loadingbptato2024-02-112-98/+137
| | | | | | | | | | The previous version was running the processor on 100% because select would immediately return for writes even when no buffers to send were available. (This has been the case since I added asynchronous sending, but the previous commit put the console buffer's fd in loader too and that made the problem quite obvious.)
* widthconv: bugfixesbptato2024-02-111-25/+11
| | | | | | | * fix failed assertion on non-ha-column half-width chars followed by handakuten with text-transform: full-width * fix dquot full-width conversion * fix lone half-width han/dakuten conversion
* Get rid of LOAD_PIPE BufferSourcebptato2024-02-119-110/+130
| | | | | Instead, use a stream: scheme and associate hostnames with file descriptors directly from the pager.
* loader: add rejectHandlebptato2024-02-101-8/+8
|
* pager: use 644 mask for mailcap temp filesbptato2024-02-101-2/+2
|
* loader: fix teebptato2024-02-104-126/+230
| | | | | | | | | | | | My eyes are bleeding, but at least there is a chance that this does what I wanted. The previous tee implementation mixed buffer and loader fds, so it was fundamentally broken. Also, it used MultiStream which makes asynchronous streaming impossible. This time we use a flat array of output handles and link to them any buffers not written to the target yet.
* loader: fixes & cleanupbptato2024-02-104-73/+55
| | | | | | | | | | | * LoaderHandle.fd is no more, we now check ostream's fd * setBlocking converted to a PosixStream method * SocketStream now sets fd variable * handle sostream/fd redirection properly * fix suspend/resume This fixes non-HTML resource loading, mostly. However, tee is still broken :/
* loader: use recvData instead of readDatabptato2024-02-093-16/+35
| | | | | | | | recvData is a new method for PosixStream that does less weird magic than readData. Also, allow duplicates in unregWrite/unregRead; it's simpler to live with them than to prevent them.
* cgi: do not register closed istreamsbptato2024-02-091-1/+2
|
* twtstr: misc refactoringsbptato2024-02-095-143/+153
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* buffer: fix index defect in updateHoverbptato2024-02-081-1/+2
| | | | | | Caused by a race condition when updateHover is executed after buffer.lines.len changed in buffer but before the change has been reported to container.