about summary refs log tree commit diff stats
path: root/src/layout/box.nim
Commit message (Expand)AuthorAgeFilesLines
* layout: improve/simplify line box error correctionbptato2024-02-281-5/+0
* layout: consider inline positioning for absolute blocksbptato2024-01-291-3/+4
* layout: rewrite inline box handlingbptato2023-11-271-24/+33
* layout: refactor flow margin propagation, sizingbptato2023-11-121-102/+9
* layout: refactorbptato2023-10-281-44/+0
* buffer: remove viewport referencebptato2023-10-281-1/+1
* layout/engine: refactor inline atoms etc.bptato2023-10-261-25/+17
* WindowAttributes: refactorbptato2023-10-191-1/+1
* layout: move Strut from box -> enginebptato2023-10-141-13/+0
* layout: remove unused InlineAtom membersbptato2023-10-141-2/+0
* layout: add LineBoxStatebptato2023-10-141-2/+0
* layout: get rid of baseline, firstBaseline functionsbptato2023-10-141-0/+10
* fix commentbptato2023-10-131-1/+1
* layout: refactor InlineContextbptato2023-10-131-8/+1
* layout: fix table cell sizing with specified widthsbptato2023-09-201-1/+0
* move around more modulesbptato2023-09-141-1/+1
* layout: make table rowspan occupy several rowsbptato2023-09-111-0/+5
* layout: add table rowspanbptato2023-09-091-1/+0
* layout: distinguish padding from spacingbptato2023-07-271-0/+3
* layout: refactor sizingbptato2023-07-251-11/+49
* layout: refactor table layoutbptato2023-07-071-0/+1
* Use LayoutUnit in layoutbptato2023-07-041-59/+45
* Fix various layout bugs, prepare for image supportbptato2023-06-121-10/+3
* layout: fix min-height/max-height handlingbptato2023-06-071-0/+2
* Working position: absolute, some other fixesbptato2023-05-131-3/+6
* layout/engine: fix double positioning absolute boxesbptato2023-02-191-0/+3
* layout: fix position:absolute, remove position:fixedbptato2023-01-201-1/+1
* layout/engine: fix non-inheritable values for inline boxbptato2023-01-061-0/+6
* layout/engine: fix crash on padding-rightbptato2022-12-311-1/+0
* layout/engine: table layout improvements, fix pre-wrap whitespacebptato2022-12-281-3/+20
* layout/engine: get rid of dom dependencybptato2022-12-271-1/+0
* Proper support for tabsbptato2022-12-271-0/+1
* layout/engine: clean up & fix width computationbptato2022-12-251-7/+10
* layout/engine: simplify a bitbptato2022-12-211-3/+3
* Display text for img tag, background-imagebptato2022-12-161-2/+1
* layout/engine: clean up shrink attributebptato2022-12-161-4/+0
* layout/engine: fix a <br> bug that ate inline boxes, add broken min-width/max...bptato2022-12-161-1/+5
* Add border-collapse, border-spacing; fix fd sending hackbptato2022-12-111-0/+3
* Support vertical-align on tdbptato2022-12-111-1/+1
* Implement a proper table layoutbptato2022-12-111-3/+10
* Table layout improvementsbptato2022-12-111-1/+1
* Add multiple text-decoration, overline emulationbptato2022-12-071-1/+1
* Remove unused BlockBox attributebptato2022-12-071-1/+0
* Fix table cell reflowbptato2022-12-071-2/+4
* Table changesbptato2022-12-061-1/+0
* Add position css property, inline block fixesbptato2022-11-281-2/+3
* Fix some table layout issuesbptato2022-11-251-1/+6
* Table improvementsbptato2022-11-221-3/+4
* Table fixes wipbptato2022-11-221-3/+10
* Terminal refactoringsbptato2022-11-201-2/+2
{ color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# w3m-like keybindings for Chawan.
# Copy-paste this into your config file, or just include it (place it in
# ~/.config/chawan/w3m.toml, then at the beginning of
# ~/.config/chawan/chawan.toml, include = "w3m.toml".)

[cmd.w3m.buffer]
pageDown = 'n => pager.scrollDown(pager.height * (n ?? 1))'
pageUp = 'n => pager.scrollUp(pager.height * (n ?? 1))'
mark = '''
() => {
	/* id is always the current position; this way we can clear by
	   setting a mark twice at the same position. */
	const id = pager.buffer.cursorx + " " + pager.buffer.cursory;
	if (!pager.getMarkPos(id))
		pager.setMark(id);
	else
		pager.clearMark(id);
}
'''
gotoLine = 'n => pager.gotoLine(n)'
centerColumn = '() => pager.centerColumn()'
centerLine = '() => pager.centerLine()'
prevMark = '''
() => {
	const next = pager.findPrevMark();
	if (next)
		pager.gotoMark(next);
	else
		pager.alert("No mark exists before here");
}
'''
nextMark = '''
() => {
	const next = pager.findNextMark();
	if (next)
		pager.gotoMark(next);
	else
		pager.alert("No mark exists before here");
}
'''

[cmd.w3m.pager]
saveFile = '''
() => {
	if (pager.url.protocol == "file:")
		pager.extern(pager.getEditorCommand(pager.url.pathname))
	else
		pager.alert("Can't edit other than local file");
}
'''
askQuit = '''
() => pager.ask("Do you want to exit Chawan?").then(x => x ? quit() : void(0))
'''

[page]
# Page/cursor movement
' ' = 'cmd.w3m.buffer.pageDown'
C-v = 'cmd.w3m.buffer.pageDown'
b = 'cmd.w3m.buffer.pageUp'
M-v = 'cmd.w3m.buffer.pageUp'
'M-[6~' = 'cmd.w3m.buffer.pageDown'
'M-[5~' = 'cmd.w3m.buffer.pageUp'
C-f = 'cmd.buffer.cursorRight'
C-b = 'cmd.buffer.cursorLeft'
C-n = 'cmd.buffer.cursorDown'
C-p = 'cmd.buffer.cursorUp'
J = 'cmd.buffer.scrollUp'
K = 'cmd.buffer.scrollDown'
'^' = 'cmd.buffer.cursorLineBegin'
C-a = 'cmd.buffer.cursorLineBegin'
'$' = 'cmd.buffer.cursorLineEnd'
C-e = 'cmd.buffer.cursorLineEnd'
w = 'cmd.buffer.cursorNextWord'
W = 'cmd.buffer.cursorWordBegin'
'<' = 'cmd.buffer.pageLeft'
'>' = 'cmd.buffer.pageRight'
'.' = 'cmd.buffer.scrollLeft'
',' = 'cmd.buffer.scrollRight'
g = 'cmd.buffer.gotoLineOrStart'
'M-<' = 'cmd.buffer.cursorFirstLine'
G = 'cmd.buffer.gotoLineOrEnd'
'M->' = 'cmd.buffer.cursorLastLine'
M-g = 'cmd.w3m.buffer.gotoLine'
Z = 'cmd.w3m.buffer.centerColumn'
z = 'cmd.w3m.buffer.centerLine'
C-i = 'cmd.buffer.cursorNextLink'
C-u = 'cmd.buffer.cursorPrevLink'
M-C-i = 'cmd.buffer.cursorPrevLink'
'[' = 'cmd.buffer.cursorNthLink'
']' = 'cmd.buffer.cursorRevNthLink'
# Hyperlink selection
C-j = 'cmd.buffer.click'
C-m = 'cmd.buffer.click'
c = 'cmd.pager.peek'
u = 'cmd.pager.peekCursor'
a = 'cmd.pager.saveLink'
M-C-j = 'cmd.buffer.saveLink'
M-C-m = 'cmd.buffer.saveLink'
I = 'cmd.buffer.viewImage'
#TODO save image
# File and URL-related actions
U = 'cmd.pager.load'
V = 'cmd.pager.load' #TODO file only
#TODO exec shell
# Buffer operations
B = 'cmd.pager.discardBufferPrev'
v = 'cmd.pager.toggleSource'
#TODO edit
C-l = 'cmd.buffer.redraw'
R = 'cmd.pager.reload'
E = 'cmd.pager.editFile'
M-s = 'cmd.pager.saveSource'
#TODO save screen, edit screen
#TODO buffer selection mode
'C-@' = 'cmd.w3m.buffer.mark'
M-p = 'cmd.w3m.buffer.prevMark'
M-n = 'cmd.w3m.buffer.nextMark'
# Search
'/' = 'cmd.pager.searchForward'
C-s = 'cmd.pager.searchForward'
'?' = 'cmd.pager.searchBackward'
C-r = 'cmd.pager.searchBackward'
n = 'cmd.pager.searchNext'
N = 'cmd.pager.searchPrev'
C-w = 'cmd.pager.toggleWrap'
# Misc
#TODO shell out, help file, options, cookies
C-c = 'cmd.pager.cancel'
q = 'cmd.w3m.pager.askQuit'
Q = 'cmd.pager.quit'
C-d = ''

# w3m line editing is equivalent to Chawan's defaults.