summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-03-31 20:38:33 +0200
committerFlorian Bruhin <me@the-compiler.org>2022-03-31 20:38:33 +0200
commitecf63880dc04e2ec5825b5e692ad0c3895c0b8d8 (patch)
tree99f643d02bc58ba1bdf5d5c2495f176eef1e2944
parent1af602b258b97aaba69d2585ed499d95e2303ac2 (diff)
downloadqutebrowser-ecf63880dc04e2ec5825b5e692ad0c3895c0b8d8.tar.gz
qutebrowser-ecf63880dc04e2ec5825b5e692ad0c3895c0b8d8.zip
Fix lint / changelog
-rw-r--r--doc/changelog.asciidoc3
-rw-r--r--qutebrowser/components/readlinecommands.py13
2 files changed, 10 insertions, 6 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index b8999d68b..665b526b7 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -71,6 +71,9 @@ Changed
* `qt.process_model` -> `qt.chromium.process_model`
- System-wide userscripts are now discovered from the correct location when
running via Flatpak (`/app/share` rather than `/usr/share`).
+- Filename prompts now don't display a `..` entry in the list of files anymore.
+ To get back to the parent directory, either type `../` manually, or use the new
+ `:rl-filename-rubout` command, bound to `<Ctrl-Shift-W>` by default.
Added
~~~~~
diff --git a/qutebrowser/components/readlinecommands.py b/qutebrowser/components/readlinecommands.py
index 66e327897..6c2a2399f 100644
--- a/qutebrowser/components/readlinecommands.py
+++ b/qutebrowser/components/readlinecommands.py
@@ -20,7 +20,7 @@
"""Bridge to provide readline-like shortcuts for QLineEdits."""
import os
-from typing import Iterable, Optional, MutableMapping
+from typing import Iterable, Optional, MutableMapping, Any, Callable
from PyQt5.QtWidgets import QApplication, QLineEdit
@@ -187,7 +187,8 @@ class _ReadlineBridge:
bridge = _ReadlineBridge()
-def _register(**kwargs):
+
+def _register(**kwargs: Any) -> Callable[..., Any]:
return cmdutils.register(
modes=[cmdutils.KeyMode.command, cmdutils.KeyMode.prompt],
**kwargs)
@@ -289,12 +290,12 @@ def rl_unix_filename_rubout() -> None:
@_register()
def rl_rubout(delim: str) -> None:
- """Delete backwards using the given characters as boundaries.
+ r"""Delete backwards using the given characters as boundaries.
With " ", this acts like readline's `unix-word-rubout`.
With " /", this acts like readline's `unix-filename-rubout`, but consider
- using `:rl-filename-rubout` instead: It uses the OS path seperator (i.e. `\\`
+ using `:rl-filename-rubout` instead: It uses the OS path seperator (i.e. `\`
on Windows) and ignores spaces.
Args:
@@ -306,11 +307,11 @@ def rl_rubout(delim: str) -> None:
@_register()
def rl_filename_rubout() -> None:
- """Delete backwards using the OS path separator as boundary.
+ r"""Delete backwards using the OS path separator as boundary.
For behavior that matches readline's `unix-filename-rubout` exactly, use
`:rl-rubout "/ "` instead. This command uses the OS path seperator (i.e.
- `\\` on Windows) and ignores spaces.
+ `\` on Windows) and ignores spaces.
"""
bridge.rubout(os.sep)