Skip to content

Empty file can't be decrypted after setting password #19416

@smss2022

Description

@smss2022

Steps to reproduce

  1. Open vim
  2. :set cm=xchacha20v2
  3. :X
  4. enter "test", confirm password
  5. :w test
  6. Quit vim
  7. Open vim
  8. :o test
  9. vim doesn't correctly decrypt the file (i.e. display an empty file), but shows the binary content of the encrypted file.

Expected behaviour

vim should be able to create an encrypted empty template i.e. a file that normal users could edit and save, without having to think about encryption technicalities or editing their vimrc files.

Version of Vim

VIM - Vi IMproved 9.2 (2026 Feb 14, compiled Feb 14 2026 12:17:29)

Environment

Operating system: Windows 11 [Version 10.0.22631.6199]
Shell: Powershell 5.1.22621.613

Logs and stack traces

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions