about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
* 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-143-19/+29
| | | | | | | | * 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
* pager: reduce boilerplatebptato2024-02-142-35/+22
| | | | also spawn less processes in some cases
* pager: warn on protocol switching redirectsbptato2024-02-141-4/+16
| | | | TODO should be configurable
* 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
|
* buffersource: remove location fieldbptato2024-02-122-26/+31
|
* Add pager.externFilterSourcebptato2024-02-122-6/+66
| | | | useful for filtering stuff through commands like rdrview
* Remove CLONE BufferSource; cache document sources in tmpdirbptato2024-02-123-44/+42
| | | | | | | | | | | | | | | | | | | | | | | 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.
* pager: fix discardTreebptato2024-02-111-4/+6
|
* container: fix cursorToggleSelection on double-width charactersbptato2024-02-111-3/+4
|
* Get rid of LOAD_PIPE BufferSourcebptato2024-02-113-29/+34
| | | | | Instead, use a stream: scheme and associate hostnames with file descriptors directly from the pager.
* pager: use 644 mask for mailcap temp filesbptato2024-02-101-2/+2
|
* twtstr: misc refactoringsbptato2024-02-091-1/+1
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* pager: display precnum *and* inputBuffer when precnum != 0bptato2024-02-011-3/+1
| | | | Previously we were overwriting it, and that looked a little strange.
* Add command to yank link under cursor (yc)bptato2024-01-291-0/+6
|
* forkserver: clean upbptato2024-01-293-21/+6
| | | | | Move forkBuffer into forkserver (why was it in container anyway), remove unused mainproc variable, etc.
* client: stop entire process group on suspend()bptato2024-01-291-1/+1
| | | | | * pass 0 so e.g. git does not hang * use sigtstp so e.g. cgi scripts can clean up if needed
* Remove newFormatbptato2024-01-232-8/+7
| | | | Pointless; it just returned a default zero-initialized object.
* container: fix b/e unnecessarily switching linesbptato2024-01-201-3/+8
| | | | | cursorWordEnd & cursorWordBegin must only change the current line if no new word was found.
* Re-design word handling, add e, E, W, B, etc.bptato2024-01-191-10/+156
| | | | | | | | | | | | * Add functions for moving to the beginning/end of words (vi `b', `e'). * As it turns out, there are many possible interpretations of what a word is. Now we have a function for each reasonable interpretation, and the default settings match those of vi (and w3m in w3m.toml). (Exception: it's still broken on line boundaries... TODO) * Remove `bounds` from lineedit, it was horrible API design and mostly useless. In the future, an API similar to what pager now has could be added. * Update docs, and fix some spacing issues with symbols in the tables.
* Remove std/terminal dependencybptato2024-01-171-1/+0
| | | | It is mostly unnecessary, and conflicts with our use of termcap anyway.
* js: merge some type modules into jstypesbptato2024-01-113-3/+3
| | | | They only had type definitions, no need to put them in separate modules.
* pager: simplify updateReadLinebptato2024-01-111-14/+16
|
* Fix windowChange not refreshing valid media queriesbptato2024-01-101-0/+2
| | | | | | | | * css/cascade: copy stylesheet in applyMediaQuery (so that changes are reverted on re-style) * buffer: clear prevstyled in windowChange (to avoid using cached results from previous cascading passes); set window.attrs * pager: avoid windowChange if new attrs are identical to the old ones
* Use std/* imports everywherebptato2024-01-073-25/+25
|
* Set cgiDir for client loader processbptato2024-01-062-2/+4
|
* Fix some casing issuesbptato2024-01-061-2/+2
|
* Compile with styleCheck:usagesbptato2023-12-282-6/+6
| | | | much better
* Fix warnings on Nim 2.0.2bptato2023-12-241-2/+1
| | | | | | | | One is a false-positive (in dom). The other one in pager is something I hadn't noticed before, that's nice. For now I want to avoid making a change that may break things, so I just removed the dead code.
* container: fix gotoMarkYbptato2023-12-211-1/+1
| | | | | | Now it actually does what it was supposed to do. Also, clarify what it does in config.md
* container: fix multi-byte selections, do not append newlinebptato2023-12-161-7/+11
| | | | | | We need to select (first byte of first char)..(last byte of last char). Also, in line/block mode we no longer add the final newline to selections.
* config: allow overriding default prepended schemebptato2023-12-151-2/+3
|
* 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