Fix lint / changelog

This commit is contained in:
Florian Bruhin 2022-03-31 20:38:33 +02:00
parent 1af602b258
commit ecf63880dc
2 changed files with 10 additions and 6 deletions

View File

@ -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
~~~~~

View File

@ -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)