about summary refs log tree commit diff stats
path: root/src/local/container.nim
Commit message (Collapse)AuthorAgeFilesLines
* buffer: clean up contentTypebptato2024-02-221-15/+19
| | | | | | | | | | This fixes a bug where setContentType would call setHTML twice, which messed up charsets and probably a couple more things. As a bonus, it allows us to pass around the content type less. In fact, buffer does not have to know its exact content type, just whether it is in HTML mode or not. So that's all we tell it now; only container still keeps track of the content type (as it should).
* Replace Chakasu with Chagashibptato2024-02-221-1/+1
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* container: fix crash on clone -> view sourcebptato2024-02-191-5/+9
| | | | | * set loaderPid in clones too * handle URL in container the same way as in buffer
* winattrs: remove unnecessary call, fix height_px fallbackbptato2024-02-171-3/+2
| | | | no need for every new buffer to query the window size
* layout: use html/body bgcolor as canvas bgcolorbptato2024-02-171-7/+20
| | | | | | 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.)
* container: set color on double width char + tab fillersbptato2024-02-161-7/+10
|
* Various refactorings & fixesbptato2024-02-141-1/+0
| | | | | | | | * 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-141-2/+2
| | | | also spawn less processes in some cases
* container: allow dismissing loadinfobptato2024-02-131-6/+12
| | | | 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-121-9/+12
|
* Add pager.externFilterSourcebptato2024-02-121-0/+4
| | | | useful for filtering stuff through commands like rdrview
* Remove CLONE BufferSource; cache document sources in tmpdirbptato2024-02-121-9/+28
| | | | | | | | | | | | | | | | | | | | | | | 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.
* container: fix cursorToggleSelection on double-width charactersbptato2024-02-111-3/+4
|
* Get rid of LOAD_PIPE BufferSourcebptato2024-02-111-15/+18
| | | | | Instead, use a stream: scheme and associate hostnames with file descriptors directly from the pager.
* twtstr: misc refactoringsbptato2024-02-091-1/+1
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* Add command to yank link under cursor (yc)bptato2024-01-291-0/+6
|
* forkserver: clean upbptato2024-01-291-12/+2
| | | | | Move forkBuffer into forkserver (why was it in container anyway), remove unused mainproc variable, etc.
* 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.
* js: merge some type modules into jstypesbptato2024-01-111-1/+1
| | | | They only had type definitions, no need to put them in separate modules.
* Use std/* imports everywherebptato2024-01-071-5/+5
|
* 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.
* Implement local CGI error message handlingbptato2023-12-151-1/+7
| | | | | | 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-151-0/+3
| | | | | This way we can at least view HTML source of x-htmloutput filtered buffers. TODO: make it render the actual source instead.
* Various fixesbptato2023-12-131-0/+1
| | | | | | | * 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-131-0/+1
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* pager: add marksbptato2023-12-091-7/+150
| | | | | 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-031-40/+163
| | | | | | | | | | * 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 `\'
* WindowAttributes: refactorbptato2023-10-191-1/+1
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* container: add cursorNthLink, cursorRevNthLinkbptato2023-10-141-0/+14
|
* Refactor Consolebptato2023-10-131-2/+7
| | | | | * merge dom.console & client.Console * move client-specific stuff out of Console (into callbacks when necessary)
* 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-301-2/+4
| | | | 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-271-4/+4
| | | | | | * 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-261-26/+33
|
* 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
|