about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
...
* mailcap: add x-needsstyle extension fieldbptato2024-11-271-2/+7
| | | | | | | Useful when an x-htmloutput handler needs styling for the HTML output to be formatted correctly (as a sort of pseudo-ua style sheet). ref. https://todo.sr.ht/~bptato/chawan/28
* select: pad options in newSelectbptato2024-11-262-18/+19
| | | | this way it works for <select> tags too
* client: exit if quit was called inside a jobbptato2024-11-251-10/+11
| | | | ref. https://todo.sr.ht/~bptato/chawan/27
* pager, select: add more items, misc fixesbptato2024-11-253-46/+78
| | | | | | eh probably have to move the event loop to pager...
* select: misc fixesbptato2024-11-241-2/+10
| | | | | * jump to first selected item (if any) when opened * fix crash on control chars in option (at least they didn't bleed...)
* loader/* -> serverbptato2024-11-243-14/+14
| | | | one less mystery
* select: fix display with multi-width charsbptato2024-11-241-6/+11
| | | | progress. now they only mess up coloring a bit.
* pager: pad menu itemsbptato2024-11-241-10/+10
|
* pager, select: implement more functionsbptato2024-11-242-5/+18
| | | | | not quite happy with this design but for now let's just try to make it work well
* pager, select: add right click menu, fix some bugsbptato2024-11-234-82/+219
| | | | | | | | | | | | | | | | | | It's *not* a context menu: items are fixed, and currently not even customizable. Former is a feature, latter is a bug. Also, select now has improved mouse support; its behavior is a combination of the w3m menu (for btn1) and GTK Firefox context menu (for btn3). Also, fix some bugs in select: * lines with double width chars are handled better (not perfectly, but at least the grid isn't completely mangled anymore) * non-multiple select now highlights the currently selected option * small selects at the bottom of the screen are handled correctly * selects at the right edge of the screen are handled correctly * select multiple no longer discards selected items on cursorLeft
* pager: fix loadURL crash on empty URLbptato2024-11-231-1/+3
| | | | ref. https://todo.sr.ht/~bptato/chawan/24
* container: add Lynx-style navigation commandscommodorian2024-11-231-0/+55
|
* buffer: proper toggleImages implementationbptato2024-11-212-4/+4
| | | | | | | It necessarily removes the config.images check from codec access, which I'm not quite happy about, so I've added a check to the DOM instead. (TODO: maybe pager should just dynamically grant codec access as a capability instead? but maybe that's even more error prone...)
* select: various improvementsbptato2024-11-211-69/+79
| | | | | | * replace weird cursor position representation * add cursorTop, cursorMiddle, cursorBottom, scrollDown, scrollUp * expose fromy, cursory to JS
* container: add numLines getterbptato2024-11-191-1/+1
|
* Update monoucha, fix some JS testsbptato2024-11-181-2/+2
|
* select: add cursorPrevLink, cursorNextLinkbptato2024-11-171-0/+6
|
* container: do not share cached images on clonebptato2024-11-161-0/+1
| | | | this was causing images to disappear sometimes
* formdata: eliminate a global varbptato2024-11-152-8/+9
|
* js: reorganize modules, update docsbptato2024-11-152-8/+30
| | | | | | | most of it has already been moved to monoucha, and the rest fits better in other directories. also, move urimethodmap to config
* config: resolve download-dir as path, update docsbptato2024-11-131-1/+3
| | | | | | | Turns out it's more useful to have env vars in the variable than to allow incomplete path names. Also, fix the disappearing backslash issue in docs.
* container: fix `U' cursor repositioning (really)bptato2024-11-122-25/+16
| | | | I swear this feature is cursed
* buffer: fix broken gotoAnchor behaviorbptato2024-11-122-44/+44
| | | | | | | | | | | | | | | | | 23beebe6 introduced a regression that broke gotoAnchor. This fixes that, plus a couple other long-standing gotoAnchor bugs: * If no anchor is found, do not dupe the buffer. Desktop browsers still add a history entry, while w3m prints an error. I've copied the latter because it makes more sense as a user, but this will have to be refined for the navigation API at some point. * If the anchor *is* found, then always jump to it, even if it's not visible. This was a limitation of relying on the line array, so now we rely on the box tree instead. (Sooner or later, the former must go anyway.) Also, fix `U' reload not restoring the position (hopefully this time for good).
* client: do not reopen istream if stdin is a ttybptato2024-11-121-6/+5
|
* url: reduce URL object size, simplifybptato2024-11-113-4/+5
| | | | | | | * query, fragment are now strings, not options * get rid of Host, Path types, now hostname/pathname are strings * fix ipv4 parsing error case * in file protocol, fix URL for dirlist without slash with a redirection
* client: run actions for mouse clicksbptato2024-11-101-12/+16
| | | | | stopgap measure until I think of a more flexible mouse configuration method
* cascade: adjust prefers-color-scheme based on terminal backgroundbptato2024-11-101-0/+1
| | | | also, default link color is now blue for light terminal backgrounds
* layout -> cssbptato2024-11-102-3/+3
| | | | as much as I wish it weren't, layout *is* css.
* url: fix compilation on Nim 1.6.14bptato2024-11-071-1/+1
| | | | it handles side effects differently
* luwrap: fix compilation on 2.0.8 and refactor a bitbptato2024-11-051-1/+1
| | | | ref. https://todo.sr.ht/~bptato/chawan/21
* utils, types: merge some modulesbptato2024-11-035-6/+2
| | | | | * line, vector, matrix -> path * twtuni, charcategory -> twtstr
* container: fix nil deref on cancelbptato2024-11-021-3/+4
|
* pager: fix borked error checkbptato2024-10-311-1/+1
|
* container: fix peekCursor showing hover texts in the wrong orderbptato2024-10-291-4/+5
|
* config: refactor, accept more possible config dirsbptato2024-10-281-1/+2
| | | | | | | | | | | | | | | | | | | | | I'm starting to favor dotfiles over XDG basedirs, but there's no reason why we couldn't have both. So now the search path is: 0. if config was set through -C, use that 1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml 2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml 3. ~/.config/chawan/config.toml exists -> use that 4. ~/.chawan/config.toml exists -> use that Notably, this makes it so the default directory is ~/.chawan *if* you don't have an existing config.toml file. So in that case known_hosts will be placed in ~/.chawan/known_hosts. However, configurations with a config in ~/.config/chawan/config.toml continue to work as expected, as for those the known_hosts file remains inside ~/.config/chawan/. Finally, I've added a default user CGI directory to reduce friction in setting CGI up. (Like known_hosts, it's also relative to whatever config dir you have.)
* pager: misc extern fixesbptato2024-10-271-80/+109
| | | | | * fix externFilterSource ignoring content types other than html * refactor runProcess to use a custom fork/exec instead of system(3)
* container: fix crash on isearch between redirectsbptato2024-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | Sadly, pushCursorPos may not be paired with a popCursorPos in case the container in question is replaced during the isearch. The easiest way to reproduce this is: * start request to a page that redirects * start isearch * redirection happens, now the old container is gone * type something Then, popCursorPos would try to pop the cursor position from the new container. An alternative (and better) solution would be to add a weak ref to the container as the line edit data. Sadly, we don't have weak refs, and I don't want to hack them in with finalizers. (But maybe I should. Hmm.)
* termcap: merge into termbptato2024-10-231-1/+29
| | | | | again, not that useful to put it in a separate module if only term uses it
* dynstream: refactorbptato2024-10-203-9/+7
| | | | | | | | | | * consistently use cint instead of FileHandle - this was another remnant of winapi support; on posix, they are the same. * move "blocking" field to PosixStream * recvFileHandle -> recvFd, sendFileHandle -> sendFd * merge serversocket into dynstream * merge auxiliary C functions into dynstream_aux
* dynstream, serversocket: use posix instead of nativesocketsbptato2024-10-203-6/+2
| | | | | | | | | | | nativesockets is a wrapper over posix and winapi, but we don't support winapi, so we can just fall back to PosixStream instead. SocketStream remains as a constraint over PosixStream to allow sendFileHandle/recvFileHandle. As a nice side effect, we can drop some allowed syscalls from the seccomp filter.
* pager: refactor mailcap, console; misc fixesbptato2024-10-142-245/+227
| | | | | | | | | * use more PosixStream (because it has double-close checking) * factor out some common mailcap operations * move console from client to pager * fix case-insensitive mime type matching * replace convoluted fdin/fdout comparison logic (that only accidentally worked) with a boolean flag
* twtstr, toml: misc cleanupbptato2024-10-131-2/+1
| | | | | * remove unused DateTime toml type * add parseIntP for pointer-size int parsing
* base64: merge into twtstr/envbptato2024-10-131-1/+0
|
* layout, pager: preserve tabs on display, selection & outputbptato2024-10-102-23/+45
| | | | | | | | | | | | Substitute tabs with one of eight PUA characters based on their width, and convert them back in the pager: * TUI mode always prints spaces, but now handles tabs appropriately on cursor movement * dump mode tries to preserve hard tabs, but uses soft tabs when that is not possible (e.g. tabs after a margin, tab with background color, etc) * selection mode always outputs hard tabs.
* client: fix redirected buffers jumping back to parent on reloadbptato2024-10-071-0/+5
| | | | | replaceBackup was not being cleared, so the next gotoURL with a replace pointing to such buffers wouldn't work.
* pager: do not choke on empty editor commandbptato2024-10-071-2/+4
|
* color: reduce CellColor size, misc color refactoringbptato2024-10-062-15/+26
| | | | | | * split out CSSColor from CellColor; now CellColor is just 4 bytes (which helps reduce FormatCell size) * unify color function naming (still not perfect)
* pager: add missing int conversionbptato2024-10-061-1/+1
|
* Update Chagashibptato2024-10-051-9/+0
|
* dynstream: fix memory leakbptato2024-10-041-2/+1
| | | | now I know why overloading dealloc felt wrong