Commit Graph

506 Commits

Author SHA1 Message Date
Florian Bruhin
b1a95a3930 Add automatic backend selection in earlyinit 2017-02-05 17:09:04 +01:00
pkill9
8ad28719ab Add "QUTE_COMMANDLINE_TEXT" environment variable for userscripts.
- Added "QUTE_COMMANDLINE_TEXT" environment variable for userscripts.
 - Updated documentation to include "QUTE_COMMANDLINE_TEXT" environment
variable for userscripts.
2017-02-01 09:29:05 +00:00
Florian Bruhin
864b9870a5 Also catch UnicodeDecodeError on Windows 2016-12-28 23:03:37 +01:00
Florian Bruhin
9727d6c74f Improve error output 2016-12-28 23:03:30 +01:00
Fritz Reichwald
eb03f79978 Add error handling for UnicodeDecodeError 2016-12-27 22:51:30 +01:00
Florian Bruhin
552e0551af Revert zero counts
This initially seemed like a nice feature, but it means 0 can't be bound
as a separate key anymore, and 0<Esc> gives weird error messages...

Reverts #1953.
Fixes #2032.
2016-11-23 08:37:29 +01:00
Florian Bruhin
81d67f8a2c Remove support for an empty data/config/cachedir
See #2115
2016-11-14 23:13:21 +01:00
Florian Bruhin
5d30105a53 Merge branch 'macros' of https://github.com/blyxxyz/qutebrowser into blyxxyz-macros 2016-11-10 06:50:21 +01:00
Florian Bruhin
ac2df2f253 Merge branch 'webengine-downloads-3' 2016-11-09 19:09:58 +01:00
Jan Verbeek
a778b7184c Revert back to objreg to avoid circular import 2016-11-09 19:07:56 +01:00
Jan Verbeek
f1c3bc89ec Further cleanup 2016-11-09 14:56:41 +01:00
Jan Verbeek
e5dec949b0 Merge https://github.com/The-Compiler/qutebrowser into macros 2016-11-09 12:17:04 +01:00
Florian Bruhin
b6195d4e77 Fix handling of typing.Union with newer Python 3.5 versions 2016-11-05 22:11:52 +01:00
Florian Bruhin
6eef79e180 Adjust imports/objreg 2016-11-04 18:49:24 +01:00
Jan Verbeek
f2b05a0395 Move keyboard macro system to MacroRecorder object 2016-10-20 02:50:00 +02:00
Jan Verbeek
2a304d7a6b Merge branch 'master' of https://github.com/The-Compiler/qutebrowser into macros
Conflicts:
	qutebrowser/commands/runners.py
2016-10-17 19:14:58 +02:00
Ryan Roden-Corrent
fbc084e416 Remove :<count>:cmd syntax support.
CommandRunner.parse had some logic for handling commands of form
:<count>:cmd. However, this complicated the parsing logic for something
that appears to only be used in tests. One could use it in a
userscript, but this is unlikely as it is undocumented. Removing
support for this simplifies the logic of parse.

The commnd `run-with-count` is added to provide this functionality.
It works like `repeat` but passes the count along to the command
instead of running the command multiple times.

This resolves #1997: Qutebrowser crashes when pasting commands.
This bug was caused by excess stripping of ':' from the command string
by _parse_count.
2016-10-10 08:02:30 -04:00
Jan Verbeek
33ff0ba715 Interactively get macro register 2016-10-08 21:17:47 +02:00
Jan Verbeek
7aaaadac1a Add keyboard macros 2016-10-06 22:24:04 +02:00
Florian Bruhin
c7b74edfbe Merge branch 'issue1940' of https://github.com/HolySmoke86/qutebrowser into HolySmoke86-issue1940 2016-10-03 06:41:19 +02:00
Daniel Karbach
a3e9fe1fd7 removed duplicate userscript path lookup 2016-09-30 09:50:49 +02:00
Daniel Karbach
dc344989c6 revised missing userscript error messages 2016-09-30 09:50:49 +02:00
Daniel Karbach
eaa754648d common base for userscript exceptions 2016-09-30 09:26:43 +02:00
Florian Bruhin
822c100f52 Make 0 a usable count for :tab-focus
Fixes #1768
2016-09-30 08:33:16 +02:00
Daniel Karbach
cbbfbabfc4 reorganize and document 2016-09-29 14:37:40 +02:00
Daniel Karbach
8eb12c6cb9 improved error messages for inexistent userscripts
fixes #1940
2016-09-29 13:29:39 +02:00
Ryan Roden-Corrent
6aaa138619 Use a set instead of a list for Command._modes. 2016-09-26 08:30:28 -04:00
Ryan Roden-Corrent
6fdd007dbb Simplify mode-checking in command.
Rather than maintaining separate _modes and _not_modes lists, just
build a single _modes list in the constructor.
2016-09-26 08:30:28 -04:00
Jakub Klinkovský
a72efe4a3e also prettify url:pretty variable 2016-09-22 19:25:54 +02:00
Florian Bruhin
04a891cbf0 Merge branch 'kwonly-default-fix' of https://github.com/Kingdread/qutebrowser into Kingdread-kwonly-default-fix 2016-09-15 17:19:26 +02:00
Florian Bruhin
018e9ef4a3 Merge branch 'completion_split' of https://github.com/rcorre/qutebrowser into rcorre-completion_split 2016-09-15 16:44:54 +02:00
Daniel Schadt
794eb84805 add parameter name in error message 2016-09-15 16:38:18 +02:00
Daniel Schadt
0ef5d338bd make sure keyword-only arguments have a default
Fixes #1872.

This prevents inspect.Parameter.empty from slipping through to the
command.
2016-09-15 15:44:33 +02:00
Florian Bruhin
e5293d34de Add missing str() calls 2016-09-15 14:51:21 +02:00
Florian Bruhin
f16b96aa28 Initial implementation of new messages 2016-09-15 14:51:21 +02:00
Ryan Roden-Corrent
b867b87955 Don't crash Completer on unknown command.
The CommandRunner's fallback parsing behavior treated whitespace
differently than the normal flow. When a user entered an unknown
command, trailing whitespace would be stripped and the cmdline length
would be less than the cursor position.

This is fixed by making the fallback use the ShellLexer just as the
'normal' parsing does.
2016-09-12 22:19:44 -04:00
Florian Bruhin
97edc59f03 Add some logging to argparse.multitype_conv 2016-09-12 18:22:49 +02:00
Daniel Schadt
22ac19b151 style fixes 2016-09-06 20:33:48 +02:00
Daniel Schadt
1c76f121a2 userscripts: fix FIFO on Windows
The userscript FIFO on Windows suffered the same problem that open-editor
once did, because files on Windows can't be opened with write access by
two different processes. We kept the oshandle around and only closed it
when the process exited, which means that userscripts could not actually
write any commands to the FIFO.

This patch closes the file earlier, allowing the userscript to actually
write commands to it.

See also
https://lists.schokokeks.org/pipermail/qutebrowser/2016-September/000256.html
2016-09-06 18:03:53 +02:00
Florian Bruhin
5f58ebebbf Remove needs_js for @cmdutils.register
This gets rid of a QtWebKit import in commands.py, and also makes those
checks work later when we have per-domain settings.
2016-09-05 18:11:01 +02:00
Jakub Klinkovský
3518fe19e8 move explanation of ;; to commands documentation
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.
2016-09-02 19:52:45 +02:00
Jakub Klinkovský
f36b8acec1 adjust wording in commands top-level documentation
There is no "commandline" for bindings in keys.conf, so describing it as
for "command arguments" should be more accurate.
2016-09-02 19:52:45 +02:00
Florian Bruhin
553eaee467 Fix pylint false-positive 2016-08-26 05:21:10 +02:00
Florian Bruhin
be7abb53ad cmdutils: Assert on positional-only params 2016-08-25 22:16:25 +02:00
Florian Bruhin
943dc564b2 Fix choices validation with unannotated args
Something like:

    @cmdutils.argument('foo', choices=['one', 'two'])
    def func(foo):
        # ...

didn't actually validate the foo argument, since the inferred type of
the argument is None, and that skipped all conversion (and thus
validation).

Fixes #1871
See #1885

This is a reworked version of 12061b8bb1
which lets special parameters (count/win_id/flags) through correctly.
2016-08-25 22:16:25 +02:00
Florian Bruhin
445d287955 Revert "Fix choices validation with unannotated args"
This reverts commit 12061b8bb1.
2016-08-23 23:34:02 +02:00
Florian Bruhin
12061b8bb1 Fix choices validation with unannotated args
Something like:

    @cmdutils.argument('foo', choices=['one', 'two'])
    def func(foo):
        # ...

didn't actually validate the foo argument, since the inferred type of
the argument is None, and that skipped all conversion (and thus
validation).

Fixes #1871
See #1885
2016-08-23 22:01:21 +02:00
Florian Bruhin
5ecef0004c Add some docs for command replacements 2016-08-16 13:32:53 +02:00
Jakub Klinkovský
befaf4f6dc fix nested expansion of {variables} in command args 2016-08-14 15:29:16 +02:00
Jan Verbeek
63b9b61e75 Add ClipboardError superexception 2016-08-10 12:33:01 +02:00