This allows users to change the size of the favicon independently from
the size of the font/tab, in order to adjust the balance between
favicons and text. The drawing code is also adjusted to place the icon
relative to the text center, rather than the text top.
Works as expected even for values of 0.0 (which is equivalent to hiding
the favicon completely).
Closes#2549.
Before, we just returned the same data for both, but then we'll run into
same-origin restrictions as qute:history and qute:history/data are not the same
host.
Problem: I like to edit `~/.config/qutebrowser/qutebrowser.conf`
manually with Vim. This works great, except that the current format is a
bit of a pain to deal with:
[section-name]
# section description
#
# [ Description of all the options]
actual options
So if I want to know the description or what the default value is, I
need to scroll up and back down.
Solution: change the order of the comments to:
# section description
[section-name]
# Option description
option = value
# Option description two
optiontwo = value
# Hello, world!
[section-two]
...
Which is much more convenient (and also what almost any other program
does).
(This patch changes much less code than it looks in the diff; I just
de-looped and moved `_str_option_desc` below `_str_items` as that makes
more sense since it gets called by `_str_items`).
- adds new `general` -> `default-open-dispatcher` setting (string)
- if set, will be used instead of QDesktopServices.openUrl (xdg-open backend)
- fixes the 'download handlers' part of issue #841
- note that this is only relevent to the `:download-open` command and other
methods of opening downloaded files from qutebrowser
Chooses the next value from the provided list of values (string-wise
comparison). Technically, the 'option!' syntax for toggling bools is now
redundant, but a translation from 'option!' to '--cycle option false
true' is kept for backwards compatibility.
The '--cycle' flag could also be technically optionally, since the only
thing that depends on it is preserving the error message for specifying
multiple values. (But I think it's best to keep it explicit, as a
principle-of-least-surprise thing)
Note: The business logic of picking the next value and setting it was
moved out to a separate function to avoid tripping pylint's
too-many-branches detector.
Fixes#47
Between v0.8.4 and now, the default keybinding for Ctrl-PgDown changed:
- ('tab-focus', ['J', '<Ctrl-PgDown>']),
+ ('tab-next', ['J', '<Ctrl-PgDown>']),
The existing keybinding was lower-cased in the config, but _is_new
didn't lowercase the new one, causing a conflict to show up.
Fixes#1835
See #1958
Supersedes #1986
Created configuration configdata.
Load and use template defined on configdata.
TODO: ability to conserve information between restart
TODO: ability to update title on configuration change
Done so far:
Two new commands pin/unpin, both accept a index to help the organization
(maybe this should be more a flag and not exactly two commands)
Crtl+p to pin, Crtl+O to unpin (not sure which should a good default
shortcut)
If user tries to close a pinned tab it's asked to confirm
If user tries to open a URL in a pinned tab it receives a message with a
information that the tab is pinned and ignore the openurl command
Preserve the pinned information across restart if session is activated
Missing:
Visual indication of the tab being pinned
Tab appearance being distinct over other tabs
Make pinned tabs to be the firsts on the tab bar
This is not ready, but it would be good to get some feedback earlier
There is no reason I guess to do this with an environment variable. On
top of that, introducing a settings also documents the netrc feature
itself (Closes #1975?).
The note was out of place in keys.conf as it's not about keyinput. Since
we have a top-level documentation for commands now, let's keep the info
in once place. People will look there anyway for the documentation of
commands they want to bind.
If the clipboard contains "-a" then "open {clipboard}" will fail because
-a gets parsed as an option. "open -- {clipboard}" doesn't do that. See
some comments in #1791.
Fixes#1060.
In the process of adding this, I also decided to rewrite
mainwindow.get_window() for clarity (and also because flake8 was warning
about complexity).
Also adds some tests to the new-instance-target mechanism, in particular
a specific test for the issue in question.
Implement `completion-item-focus next-category` and
`completion-item-focus prev-category` to jump through completions by
category rather than by item.
Resolves#1567.
I usually use my browser with a one-window-per-workspace flow. If I
click on a URL anywhere, I personally would prefer it to go to the
browser instance that's on the same workspace.
To this end, the easiest way to accomplish this is to simply track when
windows are made visible and register them as the last visible object.
(To get finer control for when you have multiple windows on the same
workspace, focus changes also update the last visible object - the
implication being here that focusing something also means you're looking
at it)
Not all users may like this behavior, so I consider it strictly optional.
Returning a defaultdict made the caller's code look confusing, as it
wasn't clear why there wouldn't be a Keyerror in some cases. Instead,
let the caller explicitly use `get`.
Various code (like src2asciidoc.py) relies on all @cmdutils.register
decorators being called when qutebrowser.app is imported.
Moving the keyconf import to _init_key_config broke that assumption, as
keyconf isn't imported anywhere anymore - which caused :bind and :unbind
to vanish from the generated documentation.
In the long run we should perhaps use venusian:
http://docs.pylonsproject.org/projects/venusian/
But for now, this is the easiest solution.
This adds the ability to open new tabs in the last-focused window
instead, which fixes#1801.
Right now the only other option is probably not that useful for human
users but it's required to make tests behave deterministically and
consistently. (But with #881 on the roadmap, I would implement this as
another choice)
To this end, also make the test framework set this option to preserve
the invariant against which existing tests are written: that spawning a
new window would effectively also focus it.
This was currently almost completely broken, yet nobody complained. The
new behavior (in the previous commit) makes this always hide the mouse
cursor, even when an input field has focus.
Since the only two easy options to implement are "never hide" and
"always hide", combined with the fact that both are sort of useless to
an end-user, just remove the option until somebody wants it back.
Changed the description for the 'hints/auto-follow-timeout', 'input/timeout' and 'input/partial-timeout' settings to specify that the time should be given in milliseconds
Completion.empty existed to fill a slot in the old Command.completions
interface if the first positional arg had no completions but the second
did, as is the case for the `bind` command. Now that
`Command.completions` is replaced by `Command.get_pos_arg_info`, this
is no longer needed.
Changes :yank's flag arguments to a positional "what" argument
specifying the object to be yanked. Including "selection" as a
possibility allows for the replacement of :yank-selected with
:yank selection.
This makes commands like `:open web.archive.org/web/{url}` possible.
This commit also adds a no_replace_variables command register argument
that stops the replacement from happening, which is important for
commands like `:bind` and `:spawn` that take a command as an argument.
This was originally added in #868, but since then we changed the default
binding for gt (for :buffers).
It also accidentally shadowed the T binding which should be bound to
:tab-focus. See #1753.
This only affects drawing hints, JS is still used if possible to
actually click them.
It seems like for many people, the JS implementation was a lot slower
than the Python one...
Per one of the diff comments on #1597:
> I used to use a tuple for constant things, but nowadays I'd actually
> prefer a list as a tuple is something more heterogeneous (i.e. it
> makes sense to have a `(x, y)` point as a tuple, but a list of points
> would be a list).
> At some point I should probably change it to a list everywhere 😉
- Use the whole home row
- Produce easier chords
- 2-key chords alternate hands first (f[aoeui][dhtns])
- This is indeed a poor patch for easier chords as it should work on
every home-row, but there are not that much homerows around.
This makes it possible to switch to an alternative implementation if
there are weird issues like #1568. Some users might also prefer the
slightly better performance over more accurate hints.
Both set mode=None, then later checked if mode == 'None' and set it to
'normal'.
This reduces the function complexity just enough that pylint will stop
complaining.
Load all special keystrings (e.g. <ctrl-a>) into memory as lowercase,
and automatically lowercase any special keystring given to bind/unbind.
This prevents <ctrl-a> and <Ctrl-A> from being treated differently.
Resolves#816.
Also resolves#1544 (dupe).
Replace the setting ui.show-keyhints with ui.keyhint-blacklist, which
is a list of globs for keychains that shouldn't be hinted. This allows
users to prevent showing keyhints for keychains they already know.
keyhint-blacklist='*' is equivalent to show-keyhints=False.
Resolves#1515.
From code review:
- escape all strings used in the keyhint html
- read the prefix color each time the hint is shown
- use show/hide instead of setVisible
- clean up pylint/flake8 errors
- use CssColor instead of QssColor for keyhint.fg.suffix
- add some padding to the keyhint popup
When the current keystring is a partial match for one or more bindings,
show the possible bindings in a small overlay.
The overlay is partially transparent by default, but the background
color is configurable as ui->keystring.bg.
All commands will be offered as completions for the <command> argument
of :bind.
Due to the way completers parse the command line, the following
bind --mode caret j
will throw off completions as 'caret' is treated as a positional arg in
terms of the argument count for completions.
In the above example, completion will be triggered for 'j' and no
completions will be given for the actual command.
bind --mode=caret j will complete correctly, though completions are not
filtered by the given mode.
I attempted an approach to filter the commands based on the mode but it
ended up being messy and flaky.
The <command> arg is now optional. If omitted, :bind prints the current
binding as a message. If --mode is given, the binding for that mode is
printed.
Allow a variable amount of whitespace for rgb, rgba, hsv, and hsva
strings in the config.
Previously only 'rgb(0, 0, 0)' was allowed. Now things like
'rgb(0,0,0)' are permitted.
The repeated 3-digit segments of the regexes were separated out to
reduce repetition and line length.
Those were added in #443, inspired by luakit.
However, all other bindings follow dwb's defaults, and dwb uses `gt` for
showing buffers. To be consistent, let's rebind gt to show :buffer.
Before, in fonts -> _monospace we preferred Liberation Mono to Courier and
Courier New. Unfortunately, that font looks horrible on Windows if it's
installed, so let's avoid using it if possible.
On Linux, hopefully Courier New/Courier isn't available, and Liberation Mono
will get picked up instead (or one of the other alternatives).
I tried to set my editor to `termite -e "vim -f {}"`, termite being a
pretty cool and light terminal I use within my i3wm Arch linux box.
So when I open my editor I want it to launch a terminal with Vim inside
instead of GVim for various reasons.
The validation rejected this at first because it was looking for '{}'
inside ['foo', 'bar', 'baz {}'], essentially. So I need it to look
inside the sub-strings, not just the list.
Then after validation I need to perform the '{}' replacement inside the
sub-string too, not just replacing the whole string.
The Shift+Ins key should arguably insert primary selection, not the
clipboard selection as every Qt program does. This commit makes it
possible via the hidden paste-primary command (enabled by default).
Unfortunately QtWebKit does not provide any straightforward way to
insert text at cursor position into editable fields, so we work around
this by executing a JavaScript snippet - inspired by this SO answer:
http://stackoverflow.com/a/11077016
Since 2a705e2eb6 non-specialized config types are
String. However, String had an overloaded complete() which defaulted to
returning None.
Now we use the normal complete() which relies on valid_values if completions
isn't given instead.
Fixes#1223.
tabs -> hide-auto was removed in d8017a04a8
because it was easier to do so compared to transforming it correctly when tabs
-> show was introduced. However, tabs -> auto-hide (the even older version)
wasn't removed, breaking config migration from earlier versions.
Fixes#1171.
The ua_fetch.py has been re-written entirely to find specific entries for
each browser based on diversity rather than sole popularity. The output
is now formatted to print the entries for each browser grouped together.
Instead of being a boolean value indicating whether or not to instantly remove
downloads when they finish, it's now an integer value representing the
number of milliseconds to wait before removing downloads when they
finish. The default value, -1, means that the downloads will not be
removed when they finished. This is the same behavior as the previous
default value of false.
The automatically fetched list includes popular user-agents but does not
guarantee any kind of diversity, so there are now a few statically
printed UAs from mobile browsers.
The script is based on a gist posted by @averrin and has been modified
to print the output according to the format expected by qutebrowser,
ready to be pasted into configtypes.py.