Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make \edit synonymous with the \e command#1636

Merged
rolandwalker merged 1 commit intomainfrom
RW/spell-out-slash-edit
Feb 27, 2026
Merged

Make \edit synonymous with the \e command#1636
rolandwalker merged 1 commit intomainfrom
RW/spell-out-slash-edit

Conversation

@rolandwalker
Copy link
Contributor

Description

Make \edit synonymous with the \e command, and preferred in the documentation. Technically, \e becomes an alias for \edit.

At first glance there appears to be an ambiguity, due to the fact that \e is a leading substring of \edit, but there is not one, because we require a space between the command and filename in the leading form, and because there is no ambiguity in the trailing form.

Adding the space separator requirement here is reasonable because

  • that is how it works for other commands such as \o/\once (which also happens to share the same potential ambiguity)
  • the leading \e form is currently broken without a space: a command such as \escript.sql attempts to edit a literal query script.sql rather than opening a file, contrary to the documentation

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker changed the title Make "\edit" synonymous with the "\e" command Make \edit synonymous with the \e command Feb 26, 2026
@rolandwalker rolandwalker force-pushed the RW/spell-out-slash-edit branch from 94f0bae to 7b50a9c Compare February 26, 2026 11:34
@github-actions
Copy link

Findings

  1. Possible test fixture drift (medium)
    test/features/fixture_data/help_commands.txt now shows <null> for many Shortcut entries that weren’t touched by this PR (e.g. \G, \clip, \dt, etc.). There’s no corresponding code change that would alter those values, so this looks like a baseline regen with a different null-string config. Please confirm this reflects actual default output and not a local config artifact; otherwise, narrow the fixture change to just the \edit row.
    File: test/features/fixture_data/help_commands.txt

  2. Missing test coverage for new alias behavior (low)
    You updated editor_command tests, but there’s no direct coverage for get_filename and get_editor_query with \edit. Add cases to confirm:

  • get_filename(r"\edit filename") == "filename"
  • get_editor_query("select 1\\edit") == "select 1"
    File: test/test_special_iocommands.py

Notes

  • I didn’t run tests locally.

Questions / Assumptions

  • Is the <null> shortcut output now the expected default? If yes, could you point to the config change that makes it deterministic?

@rolandwalker rolandwalker self-assigned this Feb 26, 2026
@rolandwalker rolandwalker force-pushed the RW/spell-out-slash-edit branch from 7b50a9c to 10227e2 Compare February 26, 2026 11:37
and preferred in the documentation.  Technically, "\e" becomes an alias
for "\edit".

At first glance there appears to be an ambiguity, due to the fact that
"\e" is a leading substring of "\edit", but there is not one, because
we require a space between the command and filename in the _leading_
form, and because there is no ambiguity in the _trailing_ form.

Adding the space separator requirement here is reasonable because
 * that is how it works for other commands such as "\o"/"\once" (which
   also happens to share the same potential ambiguity)
 * the leading "\e" form is currently broken without a space: a command
   such as "\escript.sql" attempts to edit a literal query "script.sql"
   rather than opening a file, contrary to the documentation
@rolandwalker rolandwalker force-pushed the RW/spell-out-slash-edit branch from 10227e2 to de0cf01 Compare February 27, 2026 10:55
@rolandwalker rolandwalker merged commit 58dce0c into main Feb 27, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/spell-out-slash-edit branch February 27, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants