# Some primitives for checking the state of fake screen objects. # validate data on screen regardless of attributes (color, bold, etc.) # Mu doesn't have multi-line strings, so we provide functions for rows or portions of rows. # Tab characters (that translate into multiple screen cells) not supported. fn check-screen-row screen: (addr screen), y: int, expected: (addr array byte), msg: (addr array byte) { check-screen-row-from screen, 0/x, y, expected, msg } fn check-screen-row-from screen-on-stack: (addr screen), x: int, y: int, expected: (addr array byte), msg: (addr array byte) { var screen/esi: (addr screen) <- copy screen-on-stack var idx/ecx: int <- screen-cell-index screen, x, y # compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme var e: (stream byte 0x100) var e-addr/edx: (addr stream byte) <- address e write e-addr, expected { var done?/eax: boolean <- stream-empty? e-addr compare done?, 0 break-if-!= var _g/eax: grapheme <- screen-grapheme-at-idx screen, idx var g/ebx: grapheme <- copy _g var expected-grapheme/eax: grapheme <- read-grapheme e-addr # compare graphemes $check-screen-row-from:compare-graphemes: { # if expected-grapheme is space, null grapheme is also ok { compare expected-grapheme, 0x20 break-if-!= compare g, 0 break-if-= $check-screen-row-from:compare-graphemes } # if (g == expected-grapheme) print "." compare g, expected-grapheme { break-if-!= draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg break $check-screen-row-from:compare-graphemes } # otherwise print an error count-test-failure draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3/fg/cyan, 0/bg draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") but observed '", 3/fg/cyan, 0/bg draw-grapheme-at-cursor 0/screen, g, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "'", 3/fg/cyan, 0/bg move-cursor-to-left-margin-of-next-line 0/screen } idx <- increment increment x loop } } # various variants by screen-cell attribute; spaces in the 'expected' data should not match the attribute fn check-screen-row-in-color screen: (addr screen), fg: int, y: int, expected: (addr array byte), msg: (addr array byte) { check-screen-row-in-color-from screen, fg, y, 0/x, expected, msg } fn check-screen-row-in-color-from screen-on-stack: (addr screen), fg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) { var screen/esi: (addr screen) <- copy screen-on-stack var idx/ecx: int <- screen-cell-index screen, x, y # compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme var e: (stream byte 0x100) var e-addr/edx: (addr stream byte) <- address e write e-addr, expected { var done?/eax: boolean <- stream-empty? e-addr compare done?, 0 break-if-!= var _g/eax: grapheme <- screen-grapheme-at-idx screen, idx var g/ebx: grapheme <- copy _g var _expected-grapheme/eax: grapheme <- read-grapheme e-addr var expected-grapheme/edi: grapheme <- copy _expected-grapheme $check-screen-row-in-color-from:compare-cells: { # if expected-grapheme is space, null grapheme is also ok { compare expected-grapheme, 0x20 break-if-!= compare g, 0 break-if-= $check-screen-row-in-color-from:compare-cells } # if expected-grapheme is space, a different color is ok { compare expected-grapheme, 0x20 break-if-!= var color/eax: int <- screen-color-at-idx screen, idx compare color, fg break-if-!= $check-screen-row-in-color-from:compare-cells } # compare graphemes $check-screen-row-in-color-from:compare-graphemes: { # if (g == expected-grapheme) print "." compare g, expected-grapheme { break-if-!= draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg break $check-screen-row-in-color-from:compare-graphemes } # otherwise print an error count-test-failure draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3/fg/cyan, 0/bg draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") but observed '", 3/fg/cyan, 0/bg draw-grapheme-at-cursor 0/screen, g, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "'", 3/fg/cyan, 0/bg move-cursor-to-left-margin-of-next-line 0/screen } $check-screen-row-in-color-from:compare-colors: { var color/eax: int <- screen-color-at-idx screen, idx compare fg, color { break-if-!= draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg break $check-screen-row-in-color-from:compare-colors } # otherwise print an error count-test-failure draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ": expected '", 3/fg/cyan, 0/bg draw-grapheme-at-cursor 0/screen, expected-grapheme, 3/cyan, 0/bg move-cursor-rightward-and-downward 0/screen, 0/xmin, 0x80/xmax=screen-width draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "' at (", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, x, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ", ", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, y, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ") in color ", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, fg, 3/fg/cyan, 0/bg draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, " but observed color ", 3/fg/cyan, 0/bg draw-int32-hex-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, color, 3/fg/cyan, 0/bg move-cursor-to-left-margin-of-next-line 0/screen } } idx <- increment increment x loop } } fn check-screen-row-in-background-color screen: (addr screen), bg: int, y: int, expected: (addr array byte), msg: (addr array byte) { check-screen-row-in-background-color-from screen, bg, y, 0/x, expected, msg } fn check-screen-row-in-background-color-from screen-on-stack: (addr screen), bg: int, y: int, x: int, expected: (addr array byte), msg: (addr array byte) { var screen/esi: (addr screen) <- copy screen-on-stack var idx/ecx: int <- screen-cell-index screen, x, y # compare 'expected' with the screen contents starting at 'idx', grapheme by grapheme var e: (stream byte 0x100) var e-addr/edx: (addr stream byte) <- address e write e-addr, expected { var done?/eax: boolean <- stream-empty? e-addr compare done?, 0 break-if-!= var _g/eax: grapheme <- screen-grapheme-at-idx screen, idx var g/ebx: grapheme <- copy _g var _expected-grapheme/eax: grapheme <- read-grapheme e-addr var expected-grapheme/edi: graphe
.TH RANGER 1 ranger-1.0.4
.SH NAME
ranger - visual file manager
.\"-----------------------------------------
.SH SYNOPSIS
.B ranger
.R [OPTIONS] [FILE]
.\"-----------------------------------------
.SH DESCRIPTION
Ranger is a file manager with an ncurses frontend written in Python.
.P
It is designed to give you a broader overview of the file system by displaying
previews and backviews, dividing the screen into several columns.
The keybindings are similar to those of other console programs like
.BR vim ", " mutt " or " ncmpcpp
so the usage will be intuitive and efficient.
.\"-----------------------------------------
.SH OPTIONS
.TP
--version
Print the version and exit.
.TP
-h, --help
Print a list of options and exit.
.TP
-d, --debug
Activate the debug mode:  Whenever an error occurs, ranger will exit and
print a full backtrace.  The default behaviour is to merely print the
name of the exception in the statusbar/log and to try to keep running.
.TP
-c, --clean
Activate the clean mode:  Ranger will not access or create any configuration
files nor will it leave any traces on your system.  This is useful when
your configuration is broken, when you want to avoid clutter, etc.
.TP
-r \fIdir\fR, --confdir=\fIdir\fR
Define a different configuration directory.  The default is $HOME/.ranger.
.TP
-m \fIn\fR, --mode=\fIn\fR
When a filename is supplied, make it run in mode \fIn\fR. Check the
documentation for more information on modes.
.TP
-f \fIflags\fR, --flags=\fIflags\fR
When a filename is supplied, make it run with the flags \fIflags\fR. Check the
documentation for more information on flags.
.\"-----------------------------------------
.SH USAGE
.\"-----------------------------------------
.SS Keybindings
Many keybindings take an additional numeric argument.  Type \fI5j\fR to move
down 5 lines, \fI10<Space>\fR to mark 10 files or \fI3?\fR to read the
third chapter of the documentation.
.TP
h, j, k, l
Move left, down, up, right
.TP
^D or J, ^U or K
Move a half page down, up
.TP
H, L
Move back and forward in the history
.TP
gg
Move to the top
.TP
G
Mov