aboutsummaryrefslogtreecommitdiff
path: root/config.c (follow)
Commit message (Collapse)AuthorAgeLines
...
* config: first argument to log_and_notify() is now a ‘struct context’Daniel Eklöf2021-11-13-139/+119
|
* config: rename str_to_spawn_template() -> value_to_spawn_template()Daniel Eklöf2021-11-13-20/+11
|
* config: rename str_to_fonts() -> value_to_fonts()Daniel Eklöf2021-11-13-10/+8
|
* config: rename str_to_wchars() -> value_to_wchars()Daniel Eklöf2021-11-13-19/+13
|
* config: rename str_to_double() -> value_to_double()Daniel Eklöf2021-11-13-28/+22
| | | | | * str_to_double() -> value_to_double() * str_to_pt_or_px() -> value_to_pt_or_px()
* config: rename str_to_ulong() -> value_to_ulong()Daniel Eklöf2021-11-13-47/+73
| | | | | | * str_to_ulong() -> value_to_ulong() * str_to_color() -> value_to_color() * str_to_two_colors() -> value_to_two_colors()
* config: value_to_bool(): fixupDaniel Eklöf2021-11-13-1/+1
|
* config: rename str_to_bool() -> value_to_bool()Daniel Eklöf2021-11-13-19/+19
| | | | Change argument to a ‘struct context’ pointer
* config: pass aggregated struct to top-level section handlersDaniel Eklöf2021-11-13-53/+138
|
* config: format all (well, most) error messages in the same wayDaniel Eklöf2021-10-31-127/+120
| | | | path:lineno: [section].key: value: message desribing what’s wrong with value
* config: use "[section].key" syntax when logging errorsDaniel Eklöf2021-10-31-55/+55
|
* config: improve error messages for invalid section keysDaniel Eklöf2021-10-31-9/+18
|
* csd: add support for a visible borderDaniel Eklöf2021-10-27-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | When we’re using CSDs, we’ve up until now rendered a 5px invisible border. This border handles interactive resizing. I.e. hovering it changes the mouse cursor, and mouse button events are used to start an interactive resize. This patch makes it possible to color part of (or the entire) border, with a configurable color. To facilitate this, two new options have been added: * csd.border-width * csd.border-color border-width defaults to 0, resulting in the look we’re used to. border-color defaults to the title bar color. If the title bar color hasn’t been set, it defaults to the default foreground color (just like the title bar color does). This means that, setting border-width but not border-color, results in a border that blends with the title bar.
* config: add [key-bindings].noop actionDaniel Eklöf2021-10-27-0/+1
| | | | | | | Key combinations assigned to this action will not be sent to the application. Closes #765
* config: error out on invalid grapheme-width-method valuesDaniel Eklöf2021-10-21-0/+7
|
* config: enable grapheme shaping by defaultDaniel Eklöf2021-10-13-4/+6
| | | | | | | | This changes the default value of tweak.grapheme-shaping to “yes”, thus enabling grapheme shaping by default. It also changes the default value of tweak.grapheme-width-method to “wcswidth”, for maximum compatibility with terminal applications.
* config, render: scrollback indicator: allow configuring scrollback indicator colorsfeeptr@codeberg.org2021-10-09-0/+13
|
* notify: add the notify-focus-inhibit config optionMitja Horvat2021-10-06-0/+5
| | | | | | | | | | | | | | | foot doesn't show desktop notifications (via OSC777) if the current terminal has keyboard focus. This is probably a sane default, but there are use cases where showing a notification regardless of the focus status may be desired. For example, a completion notification of a long running task inside a non-focused tmux window. This PR adds the notify-focus-inhibit option which can be used to disable inhibition of notifications when the window has focus. The default value is `yes`, which retains the old behavior.
* config: add comments to default_color_table[] about color channel valuesCraig Barnes2021-09-25-0/+2
|
* config: simplify initialization of color table in config_load()Craig Barnes2021-09-25-46/+31
|
* config: codespell: setting has only two ‘t’Daniel Eklöf2021-08-31-1/+1
|
* main: verify primary font is monospaced at startupDaniel Eklöf2021-08-31-0/+52
| | | | | | | | | | Load a couple of ASCII glyphs and check if their advance widths matches. If not, warn the user that the font is probably not monospaced. This can be disabled by setting tweak.font-monospace-warn=no. Closes #704.
* terminfo: install to $datadir/foot/terminfo by default, append to TERMINFO_DIRSDaniel Eklöf2021-08-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of 2021-07-31, ncurses ships its own version of foot’s terminfo. Since: * It doesn’t have the non-standard Sync,Tc,setrgbf,setrgbb capabilities. * It doesn’t set hs,fsl,dsl (statusbar). * We want to be able to update our termminfo without waiting for an ncurses release. * Foot should be installable and usable on Linux systems that doesn’t have the latest ncurses. we still want to ship our own version. We can however not install it to the default terminfo location (e.g. /usr/share/terminfo), since it will collide with the ncurses provided files. Our options are to either rename our terminfo to something else, or to keep the name, but install our terminfo files somewhere else. The first option would be the easy one. However, I think it makes sense to use the same name. For example, a user that SSH’s into a remote system that does *not* have our own version installed, but *does* have the ncurses one, will gracefully fall back to that one, which is better than manually having to set e.g. TERM=xterm-256color. Now, if we want to use the same name, we need to install it somewhere else. But where? And how do we ensure our version is preferred over the ncurses one? I opted to $datadir/foot/terminfo (e.g. /usr/share/foot/terminfo) by default. It makes it namespaced to foot (i.e. we’re not introducing a new “standard” terminfo location), thus guaranteeing it wont collide with ncurses. To enable applications to find it, we export TERMINFO_DIRS. This is a list of *additional* directories to search for terminfo files. If it’s already defined, we *append* to it. The nice thing with this is, if there’s no terminfo in that location (e.g. when you SSH into a remote), the default terminfo location is *also* searched. But only *after* having searched through TERMINFO_DIRS. In short: our version is preferred, but the ncurses one (or an older version of our terminfo package!) will be used if ours cannot be found. To enable packagers full control over the new behavior, the existing meson command line options have been modified, and a new option added: -Dterminfo=disabled|enabled|auto: *build* and *install* the terminfo files. -Dcustom-terminfo-install-location=<path>: *where* the terminfo files are expected to be found. This *needs* to be set *even* if -Dterminfo=disabled. For example, if the packaging script builds and packages the terminfo files separate from the regular foot build. The path is *relative to $prefix*, and defaults to $datadir/foot/terminfo. This is the value that will be appended to TERMINFO_DIRS. Note that you can set it to ‘no’, in which case foot will *not* set/modify TERMINFO_DIRS. Only do this if you don’t intend to package foot’s terminfo files at all (i.e. you plan on using the ncurses ones only). -Ddefault-terminfo=foot. Allows overriding the default TERM value. This should only be changed if the target platform doesn’t support terminfo files. Closes #671
* config: add url.uri-charactersDaniel Eklöf2021-08-09-0/+35
| | | | | | | | | | | | This option specifies the characters allowed in the auto-detected URLs. Any character not in this set constitutes an URL delimiter, and will never be included in auto-detected URLs. This option does not affect OSC-8 URLs. Closes #654
* config: include: use xasprintf() instead of two calls to snprintf()Daniel Eklöf2021-07-30-3/+1
|
* config: include: handle get_user_home_dir() returning NULLDaniel Eklöf2021-07-30-2/+9
|
* config: include: add support for ~-expansionDaniel Eklöf2021-07-30-1/+15
| | | | Closes #659
* config: add csd.font optionDaniel Eklöf2021-07-24-15/+83
|
* render: Allow cells to bleed into their neighborTimur Celik2021-07-17-12/+5
| | | | | | | | | | | | | | | | This patch adds a `confined` flag to each cell to track if the last rendered glyph bled into it's right neighbor. To keep things simple, bleeding into any other neighbor cell than the immediate right one is not allowed. This should cover most use cases. Before rendering a row we now do a prepass and mark all cells unclean that are affected by a bleeding neighbor. If there are consecutive bleeding cells, the whole group must be re-rendered even if only a single cell has changed. The patch also deprecates both old overflowing glyph options *allow-overflowing-double-width-glyphs* and *pua-double-width* in favor of a single new one named *overflowing-glyphs*.
* config: add locked-title=no|yesDaniel Eklöf2021-07-04-0/+3
| | | | Closes #386
* config: rename at-most-2 (value for grapheme-width-method) to double-widthDaniel Eklöf2021-07-01-3/+3
|
* config: add tweak.grapheme-width-method=wcswidth|at-most-2Daniel Eklöf2021-07-01-0/+10
|
* config: add unit test for config_clone()Daniel Eklöf2021-06-30-0/+21
| | | | | | | | We’re mainly interested in seeing that we don’t leak memory, or double free heap allocated data. Valgrind and/or gcc/clang sanitizers are best at this, hence the very few asserts in the test itself.
* config: NOINLINE a couple of functions doing tll operationsDaniel Eklöf2021-06-30-4/+4
|
* config: remove replaced/removed key bindings, instead of marking as ‘unused’Daniel Eklöf2021-06-30-26/+132
| | | | | | | | | | | | Instead of keeping removed/replaced key bindings in the key binding array (marked as ‘unused’), remove them, by compacting the array. The invariant is thus that there should be *no* entries in the key binding list with the `BIND_ACTION_NONE` for action. Add code to debug builds that verifies this, plus a unit test. Closes #614
* log: add LOG_CLASS_NONE and use as initializer for log_levelCraig Barnes2021-06-26-2/+4
| | | | | | | | | | | | This means that logging will be completely disabled until log_init() has been called, which is useful to prevent log spam when running UNITTEST{} blocks in debug builds. Note that this doesn't change the default log level at runtime, which was already being set to LOG_CLASS_INFO in main.c and client.c. The new log level is also exposed to the command-line interface as `--log-level=none`, which allows disabling logging entirely.
* wip: grapheme shapingDaniel Eklöf2021-06-24-0/+30
|
* config: clone: fix font-list cloningDaniel Eklöf2021-06-23-1/+4
| | | | Need to copy over *all* members...
* config: add new function config_clone()Daniel Eklöf2021-06-23-94/+195
|
* tokenize: strdup() each individual argvDaniel Eklöf2021-06-20-23/+41
| | | | | Instead of referencing the un-tokenized “raw” command string, strdup() each argv. This way, the input string can be ‘const’.
* config: remove duplicated error logs for invalid colorsDaniel Eklöf2021-06-20-18/+6
|
* config: add csd.button-color optionDaniel Eklöf2021-06-20-0/+11
| | | | | | | | This option controls the foreground color of the minimize/maximize/close buttons. I.e. the color used to draw the minimize/maximize/close glyphs. It defaults to default background color.
* config: work around clang-11.0 issueDaniel Eklöf2021-06-18-62/+62
| | | | | | Clang-11.0 doesn’t seem to understand that our ‘static const’ key modifiers are compile-time constant. Clang-11.1 doesn’t appear to have this issue.
* config: don’t use tllist where it isn’t necessaryDaniel Eklöf2021-06-18-231/+292
| | | | | | | | | | | | | | | | tllists are great when dealing with dynamically changing lists. They are also very easy to use when building lists/arrays where the final size is unknown. However, this ease of use comes at a price: code size. tll-macros expand to a lot of code. Since things in the config are static, once the config has been loaded, using tllists for configuration data structures doesn’t make much sense. This patch replaces nearly all tllists used by the configuration, with dynamically allocated arrays.
* config: add underline-offset optionDaniel Eklöf2021-06-17-4/+13
| | | | | | | | This option allows the user to configure a custom underline offset. That is, use the user provided offset instead of the font provided one. Closes #490
* Override options from command lineRyan Farley2021-06-12-83/+154
| | | | | | | | | Allow any configuration option to be overridden with -o/--override 'section.key=value' arguments, as suggested in #554 update completitions for override slight refactoring to ease footclient support
* config: demote “no configuration found, using defaults” to a mere warningDaniel Eklöf2021-06-10-1/+1
| | | | | And don’t notify the user in the terminal window, only log it on stderr.
* config: change “no configuration found, using defaults” from error to warningDaniel Eklöf2021-06-10-1/+1
|
* config: add boolean option tweak.pua-double-widthDaniel Eklöf2021-06-01-0/+7
| | | | | | | When enabled, PUA (Private Usage Area) codepoints are always treated as double-width glyphs, regardless of the actual glyph width. Requires allow-overflowing-double-width-glyphs=yes
* config: add ‘include’ directiveDaniel Eklöf2021-05-28-19/+49
| | | | | | | | | | | | | | | This allows you to include sub-configurations. For example, theme files. The ‘include’ directive is a top-level keyword. I.e. it cannot be used inside sections. * The included file must be specified with an absolute path * The included file is parsed in its own scope * Nested includes are allowed * Multiple include directives are allowed Closes #555
* config: notify: change default value to use ${app-id}Daniel Eklöf2021-05-27-1/+1
| | | | | Make the default value of ‘notify’ use ${app-id} for icon and application name.
* config: bind ctrl+c to "cancel" in search/url mode by defaultCraig Barnes2021-05-25-0/+2
| | | | Closes #544
* config: url.protocols: make it comma separated, for consistencyDaniel Eklöf2021-05-22-5/+15
|
* config: add url.protocolsDaniel Eklöf2021-05-22-0/+66
| | | | | | | This makes the protocols recognized by auto-detected URLs configurable. Closes #531
* config: move url-mode related options to a dedicated section, ‘url’Daniel Eklöf2021-05-22-13/+87
|
* config: add cursor.underline-thicknessDaniel Eklöf2021-05-22-0/+8
| | | | | | | | | | | | | Works in pretty much the same way as ‘beam-thickness’, except that the default value is “the font’s underline thickness”. This means, that when unset, the cursor underline thickness scales with the font size. But, when explicitly set, either to a point size value, or a pixel size, it remains fixed at that size. Closes #524
* notifications: use \e[22m to disable boldDaniel Eklöf2021-05-20-4/+7
| | | | | | | | | | | \e[21m was previously used to disable bold. That changed a while ago, to align foot with the majority of other terminal emulators. \e[22m now disables both bold and dim. When this change was done, the user notifications were not updated, meaning the ‘message’ part was always in bold. This was never the intended behavior.
* config: add tweak.box-drawing-solid-shades=yes|noDaniel Eklöf2021-05-17-0/+9
| | | | | | | | | | When enabled, shades are rendered as solid blocks, using a darker variant of the current foreground color. When disabled, shades are instead rendered in a checker box pattern, using the foreground color unmodified. Default is enabled.
* Merge branch 'simplify-parse_section_colors'Craig Barnes2021-05-08-16/+14
|\
| * config: simplify parse_section_colors()Craig Barnes2021-05-08-16/+14
| |
* | config: simplify parsing of "scaling-filter" values slightlyCraig Barnes2021-05-08-12/+9
|/
* Merge branch 'config-code-size'Daniel Eklöf2021-05-08-71/+108
|\
| * config: avoid tll() code expansion when generating default bindingsDaniel Eklöf2021-05-07-28/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | tll_push_back() is a macro that results in quite a lot of instructions. Expanding this macro explicitly in many places thus causes code explosion. This is what happened in when we generate the default key/mouse bindings. Fix by calling tll_push_back() in a no-inline function. Reduces code size with ~4-5K
| * config: don’t inline str_to_*() functionsDaniel Eklöf2021-05-07-8/+8
| |
| * config: implement LOG_AND_NOTIFY_* macros in terms of no-inline functionsDaniel Eklöf2021-05-07-35/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduces code size by quite a lot: From: section size addr .text 37857 0 ... Total 45169 To: section size addr .text 31681 0 ... Total 38993 LTO release build goes from 500K -> 492K
* | configure full color palette in foot.iniRyan Farley2021-05-08-1/+14
|/ | | | | Allow the use of numeric keys in [colors] to configure the full set of 256 colors in the palette. Fixes #489
* consistent booleans in config, reset legacy bellRyan Farley2021-05-07-3/+9
|
* clearly mark bell as a sectionRyan Farley2021-05-07-1/+1
|
* style, consistent bool names, deprecate old configRyan Farley2021-05-07-0/+26
|
* enhanced bell configurationRyan Farley2021-05-07-18/+34
| | | | | | | | | | Add a separate section for bell configuration, with a bell-specific command option and a setting to allow that command to run without regard to keyboard focus (for those of us who enjoy being beeped at at all times, for example). The actions are also no longer mutually exclusive; this is primarily anticipating urgency support which cannot be replicated outside the process (in server mode anyway) and would thus be complementary to any notification or arbitrary command.
* config: fix color cube generationDaniel Eklöf2021-05-06-3/+8
| | | | Closes #479
* config: add ‘beam-thickness’ optionDaniel Eklöf2021-04-30-3/+12
| | | | | | | | | | | * Rename cursor.style value ‘bar’ to ‘beam’. ‘bar’ remains recognized, but should eventually be deprecated and then removed. * Add ‘cursor.beam-thickness’ option, a pt-or-px value specifying the thickness of the beam cursor. Defaults to 1.5pt. * Rename (and export) pt_or_px_as_pixels() to term_pt_or_px_as_pixels() * Change term_pt_or_px_as_pixels() to round point values instead of truncating them.
* config: bold-text-in-bright: add ‘palette-based’ as a special valueDaniel Eklöf2021-04-17-3/+13
| | | | | | | | | When ‘bold-text-in-bright’ is set ‘to palette-based’, colors matching one of the 8 regular palette colors are brightened by using the corresponding bright palette color. Other colors, or all colors if ‘bold-text-in-bright’ is set to ‘yes|true’, are brightened by increasing the luminance.
* config: add box-drawings-uses-font-glyphs=no|yes optionDaniel Eklöf2021-04-09-0/+4
| | | | | | | | | When disabled, we render box drawing characters ourselves. This is the default. When enabled, we instead use font glyphs. I.e. no special treatment. Closes #430
* config/terminal: refactor: remove “default_*” color members from terminal structDaniel Eklöf2021-04-07-19/+38
| | | | Access the original colors in the configuration instead.
* config: make {search,url}_binding_action_map[] function localDaniel Eklöf2021-04-05-34/+34
| | | | | | | | | This ensures we don’t accidentally reference them from places we shouldn’t. Unfortunately, binding_action_map[] (for “normal” key bindings) cannot easily be made function local since it is used when parsing both key- and mouse bindings (i.e. it’s used in multiple functions).
* config: parse_key_binding_section(): use provided action-mapDaniel Eklöf2021-04-05-1/+1
| | | | | | | | Don’t call has_key_binding_collisions() with ‘binding_action_map’ unconditionally; use the provided ‘action_map’ instead. This fixes wrong error messages for key combo collisions in key binding sections other than the regular “key-bindings”.
* config: open_config(): remove unused argument ‘conf’Daniel Eklöf2021-03-16-2/+2
|
* input: repair key combos containing both explicit modifier and shifted symbolDaniel Eklöf2021-03-04-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user-provided key combo contains both an explicit modifier, and the shifted symbol it produces, replace the symbol with its un-shifted version. Example: Control+Shift+U contains both ‘Shift’, and ‘U’, where ‘Shift’ is the modifier that shifts ‘u’ to ‘U’. Such modifiers are “consumed”, i.e. filtered out, when matching key combos. As such, Control+Shift+U will never trigger since we’ll never be able to match the consumed modifier ‘Shift’. The above combo can be written in two ways: - Control+U - Control+Shift+u To be able to detect that Control+Shift+U is an invalid combination, we need to check all *shifted* symbols for all key *codes*. Once we’ve detected a shifted symbol (and where it differs from the un-shifted symbol), we loop all modifier sets that produce the shift level where our shifted symbol is. For each such set, check if it intersects with the user-provided key combo’s modifier set. If there is an intersection, it means the user provided a key combo containing a modifier and symbol, such that the modifier is consumed when the symbol is produced. In this case, we replace the symbol with its un-shifted version.
* config: parse_key_combos: lower case manually, instead of calling tolower()Daniel Eklöf2021-03-04-1/+1
| | | | tolower() is locale dependent, something we do not want in this case.
* config: fix default key binding for extend-to-next-whitespaceDaniel Eklöf2021-03-04-1/+1
| | | | Bindings now use lower-cased keys
* input: rewrite of how we match foot’s own key bindingsDaniel Eklöf2021-03-04-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bindings are matched in one out of three ways: * By translated (by XKB) symbols * By untranslated symbols * By raw key codes A translated symbol is affected by pressed modifiers, some of which can be “consumed”. Consumed modifiers to not partake in the comparison with the binding’s modifiers. In this mode, ctrl+shift+2 maps to ctrl+@ on a US layout. Untranslated symbols, or un-shifted symbols refer to the “base” symbol of the pressed key, i.e. it’s unaffected by modifiers. In this mode, consumed modifiers *do* partake in the comparison with the binding’s modifiers, and ctrl+shift+2 maps to ctrl+shift+2 on a US layout. More examples: ctrl+shift+u maps to ctrl+U in the translated lookup, while ctrl+shift+u maps to ctrl+shift+u in the untranslated lookup. Finally, we also match raw key codes. This allows our bindings to work using the same physical keys when the user switches between latin and non-latin layouts. This means key bindings in foot.ini *must* not include both +shift+ and a *shifted* key. I.e. ctrl+shift+U is not a valid combo as it cannot be triggered. Unfortunately, this was how you were supposed to write bindings up until now... so, we try to detect such bindings, log a deprecation warning and then “fix” the binding for the user. When specifying bindings in foot.ini, both ctrl+U and ctrl+shift+u are valid, and will work. The latter is preferred though, since we cannot detect the raw key code for the former variant. Personally, I also prefer the latter one because it is more explicit; it’s more obvious which keys are involved. However, in some cases it makes more sense to use the other variant. Typically for non-letter combos.
* Fix typo.L3MON4D32021-03-01-1/+1
|
* config: reuse HAVE_TERMINFO via DEFAULT_TERMChloe Kudryavtsev2021-02-26-5/+1
| | | | | add detection in --help output also make it more easily accessible for other locations to change
* Merge branch 'rename-_errno'Daniel Eklöf2021-02-22-3/+3
|\
| * errno: don’t use ‘_errno’ as a variable name; _ are reserved for use as identifiersDaniel Eklöf2021-02-21-3/+3
| |
* | config: typo: osc8-underline=always means ALWAYSDaniel Eklöf2021-02-21-1/+1
| |
* | config: osc8-underline: default to ‘url-mode’Daniel Eklöf2021-02-21-1/+1
| |
* | urls: OSC-8 URLs can now optionally be underlined outside of url-modeDaniel Eklöf2021-02-21-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new configuration option, ‘osc8-underline=url-mode|always’. When set to ‘url-mode’, OSC-8 URLs are only highlighted (i.e. underlined) in url-mode, just like auto-detected URLs. When set to ‘always’, they are always underlined, regardless of mode, and regardless of their other attributes. This is implemented by tagging collected URLs with a boolean, instructing urls_render() and urls_reset() whether they should update the cells’ ‘url’ attribute or not. The OSC-8 collecter sets this based on the value of ‘osc8-underline’. Finally, when closing an OSC-8 URL, the cells are immediately tagged with the ‘url’ attribute if ‘osc8-underline’ is set to ‘always’.
* | config: change default key binding for toggle-url-visible to ‘t’Daniel Eklöf2021-02-21-1/+1
| |
* | urls: add key binding that toggles whether URLs are displayed on jump-labelDaniel Eklöf2021-02-21-0/+2
|/ | | | | | | | | | | | | | | | | By default, the URL isn’t shown on the jump-label. For auto-detect URLs, doing so is virtually always useless, as the URL is already visible in the grid. For OSC-8 URLs however, the URL is often _not_ visible in the grid. Many times, seeing the URL is still not needed (if you’re doing ‘ls --hyperlink’, you already know what the URIs are). But it is still useful to have a way to show the URLs. This patch adds a new key binding action that can be used in url-mode to toggle the URL on and off in the jump label. It is bound to ctrl+t by default.
* config: add jump-label-letters optionDaniel Eklöf2021-02-13-0/+12
|
* config: refactor: add str_to_wchars(), use it when parsing word-delimitersDaniel Eklöf2021-02-13-8/+24
|
* Convert some uses of xassert(false) to BUG("some error message")Craig Barnes2021-02-09-1/+1
|
* Merge branch 'refactor-key-bindings'Daniel Eklöf2021-02-08-204/+76
|\
| * key-bindings: refactor: use a single type for all key bindingsDaniel Eklöf2021-02-08-204/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, the various key binding modes (“normal”, “search” and “url”) have used their own struct definitions for their key bindings. The only reason for this was to have a properly typed “action” (using the appropriate “action” enum). This caused lots of duplicated code. This patch refactors this to use a single struct definition for the “unparsed” key bindings handled by the configuration, and another single definition for “parsed” bindings used while handling input. This allows us to implement configuration parsing, keymap translation and so on using one set of functions, regardless of key binding mode.
* | misc: when free:ing tll lists, prefer tll_remove() over tll_free()Daniel Eklöf2021-02-08-4/+6
|/ | | | | | | | | | | | | | | | | | | In many places we have the following pattern: tll_foreach(list, it) free(it->item.thing); tll_free(list); Since all tll functions are macros, and thus inlined, and since tll_free in itself expands to a tll_foreach(), the above pattern expands to more native code than necessary. This is somewhat smaller: tll_foreach(list, it) { free(it->item.thing); tll_remove(list, it); }
* config: add colors.jump_labels and colors.urlsDaniel Eklöf2021-02-07-13/+55
| | | | | | | | | | * colors.jump_labels configures the foreground and background colors used when rendering URL jump labels. Defaults to “regular0 regular3” (i.e. black on yellow). * colors.urls configures the color to use when highlighting URLs in URL mode. Note that we aren’t currently doing any highlighting... Defaults to regular3 (i.e. yellow).
* config: use a packed bitfield for “use custom color” flagsDaniel Eklöf2021-02-07-2/+4
|
* config: add show-urls-copy actionDaniel Eklöf2021-02-07-0/+1
| | | | | | This works just like show-urls-launch, except that instead of opening the URL (typically using xdg-open), it is placed in the clipboard when activated.