about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
* Implement local CGI error message handlingbptato2023-12-152-4/+8
| | | | | | This was documented, but not implemented until now. Also, improve the loader module's protocol documentation.
* Set ishtml in the correct place, take ishtml on clonebptato2023-12-151-1/+2
|
* container: track ishtml statusbptato2023-12-152-1/+4
| | | | | This way we can at least view HTML source of x-htmloutput filtered buffers. TODO: make it render the actual source instead.
* client: nil check connectSocketStream resultbptato2023-12-141-0/+5
| | | | | It may fail if the buffer process could not successfully create a server socket.
* client: avoid nil defect in flushConsolebptato2023-12-141-0/+5
|
* Various fixesbptato2023-12-132-2/+3
| | | | | | | * Makefile: fix parallel build, add new binaries to install target * twtstr: split out libunicode-related stuff to luwrap * config: quote default gopher2html URL env var for unquote * adapter/: get rid of types/url dependency, use CURL url in all cases
* break up twtstr somewhatbptato2023-12-133-0/+3
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* mailcap: add $MAILCAP_URLbptato2023-12-101-0/+2
| | | | | | This is better than %u as it is backwards compatible (i.e. does not rely on other user agents doing whatever upon encountering an unknown substitution template.)
* config: better path handling; fix array parsing bugbptato2023-12-101-14/+39
| | | | | | | | | * Paths are now parsed through an unified code path with some useful additions like environment variable substitution. * Fix a bug in parseConfigValue where strings would be appended to existing arrays (and not override them). * Fix beforeLast calling afterLast for some reason. * Add a default CGI directory.
* pager: add marksbptato2023-12-093-15/+185
| | | | | Default is vi-style, but w3m-style marks work as well; see bonus/w3m.toml.
* pager: add precnum to [, ]bptato2023-12-091-4/+4
|
* pager: add `{', `}'; document externIntobptato2023-12-091-0/+14
| | | | | | | | { & } acts like in vi (except the cursor is not moved to the line beginning). No reason to leave externInto undocumented, as it is even used in the default config.
* pager, container: add text selection/copyingbptato2023-12-033-67/+203
| | | | | | | | | | * Add select & copy selection functionality to container * Fix bug in generateSwapOutput where output could be misplaced because of zero-width cells * Add fromJSPromise, call runJSJobs in every iteration of the headed event loop * "await" pager actions that output a promise * Change default view source keybinding to `\'
* Get rid of clang 16 workaroundbptato2023-12-021-5/+6
| | | | | * bindings/quickjs: importc and use correct pointer types * add constcharp module for when it is unavoidable
* pager: small optimization in drawBufferbptato2023-12-011-2/+2
|
* pager: fix regressionbptato2023-11-212-18/+18
| | | | | pager.tty refers to infile, not outfile. rename to avoid further confusion
* pager: remove pager.tty memberbptato2023-11-211-3/+3
| | | | now it's a function
* Remove trailing spacesbptato2023-10-231-1/+1
|
* base64: reduce pointless re-coding using JSStringbptato2023-10-211-2/+3
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* javascript: add TextEncoder, TextDecoderbptato2023-10-211-0/+2
|
* WindowAttributes: refactorbptato2023-10-193-3/+3
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* pager/lineedit: notify lineedit of windowChangebptato2023-10-181-0/+2
| | | | this was causing crashes
* container: add cursorNthLink, cursorRevNthLinkbptato2023-10-141-0/+14
|
* Refactor Consolebptato2023-10-133-73/+104
| | | | | * merge dom.console & client.Console * move client-specific stuff out of Console (into callbacks when necessary)
* Add w3m-cgi-compat optionbptato2023-10-011-1/+2
|
* Fix cursor x not being updated on backwards searchbptato2023-10-011-3/+11
| | | | | `refresh' does not correlate with the need of moving the cursor X position, `save' is a better choice.
* container: fix oob in area highlightingbptato2023-10-011-0/+2
| | | | Avoid coloring parts of areas outside the screen.
* container: center column in setCursorXYCenterbptato2023-10-011-0/+3
| | | | Makes searching on long lines work properly.
* more vi/m compatbptato2023-10-011-16/+26
|
* Improve vi/m compat in scrollingbptato2023-10-011-17/+68
|
* buffer: fix cursor unnecessarily jumping to y=0bptato2023-09-301-2/+3
| | | | | then() is called even if a nil Promise is returned, so an Opt is needed here.
* Add urimethodmap supportbptato2023-09-303-5/+12
| | | | yay
* loader: add local-cgibptato2023-09-301-5/+2
| | | | | | | | | | | Add w3m-style local CGI support. It is not quite as powerful as w3m's local CGI, because it lacks an equivalent to W3m-control. Not sure if it's worth adding; we certainly shouldn't allow passing JS in headers, but a custom language for headers does not sound like a great idea either... eh, idk. also, TODO add multipart
* buffer: simplify contentType handlingbptato2023-09-272-14/+15
| | | | | | * remove contentType member of Buffer object * add ishtml to reduce string comparisons * consistent spelling: contenttype -> contentType
* interface clone: remove unused arg, documentbptato2023-09-271-1/+1
|
* Add precnum support to more functionsbptato2023-09-262-34/+41
|
* pager: show character sequence inputs on status linebptato2023-09-262-31/+44
| | | | pretty useful I think
* Add M-p as "load page on clipboard"bptato2023-09-251-3/+8
|
* client: write errors to browser console in evalActionbptato2023-09-251-3/+10
|
* client: clean up Client objectbptato2023-09-241-14/+5
| | | | | * remove unused attributes * make line a function
* client, timeout: simplifybptato2023-09-241-8/+8
| | | | | We don't use the generic feature of selectors, so just unify the client & buffer timeout types.
* regex: copy after compilingbptato2023-09-241-1/+2
| | | | | | | | | | | | Instead of the broken attempt at making regexes zero-copy (it copied anyway), copy once and forget about it. (There have been way too many problems with the destructor approach, including the latest one where the GC would happily zero out our regexes if they were in a sequence. Maybe we can make this work once we switched to ORC. For now, it's not worth the trouble.)
* container: un-extern, un-ref highlightsbptato2023-09-231-9/+6
| | | | No need for either of that now.
* fix devnull dup in place of stdinbptato2023-09-231-4/+7
| | | | The previous solution was ok, but it could leak an fd...
* buffer: make readFromFd work with pipesbptato2023-09-231-1/+8
|
* buffer: make clone fork()bptato2023-09-232-20/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes e.g. on-page anchor navigation near-instantaneous. Well, as instantaneous as a fork can be. In any case, it's a lot faster than loading the entire page anew. This involves duplicating open resources (file descriptors, etc.), which is not exactly trivial. For now we have a huge clone() procedure that does an ok-ish job at it, but there remains a lot of room for improvement. e.g. cloning is still broken in some cases: * As noted in the comments, TeeStream'ing the input stream for any buffer is a horrible idea, as readout in the cloned buffer now depends on the original buffer also reading from the stream. (So e.g. if you clone, then kill the old buffer without waiting for the new one to load, the new buffer gets stuck.) * Timeouts/intervals are broken in cloned buffers. The timeout module probably needs a redesign to fix this. * If you clone before connect2, the cloned buffer gets stuck. The previous solution was even worse (i.e. broken in more cases), so this is still an improvement. For example, this fixes some issues with mailcap handling (removes the "set the Content-Type of htmloutput buffers to text/html" hack), does not reload all resources, does not completely break if the buffer is cloned during loading, etc.
* Disable "toggle source" for the console bufferbptato2023-09-213-8/+17
|
* lineedit: rewritebptato2023-09-181-13/+7
| | | | | | | | | | | | | | | | The old lineedit system worked quite well in the original synchronous model. However, because it needs access to the terminal, it has been subtly broken ever since buffer updates are allowed while the user is in line edit mode. This is best observed in incremental search, where searching for a bgcolor'ed text would result in the bgcolor bleeding into the line editor box. The new version is much simpler, and therefore less optimized. But it can still take advantage of output optimization in the terminal controller, and it is free of races (because we simply query the current state from the pager and feed it into the main output grid).
* Fix compilation with --assertions:offbptato2023-09-151-2/+4
| | | | | Remove side effects from assert statements. The flag is not used currently, but let's not depend on that.
* bindings: fix JSInterruptHandler signaturebptato2023-09-151-1/+1
|