Saturday, May 9, 2020

Re: Encryption is not considered a change by the :x command

Ninu-Ciprian Marginean wrote:

> When we look at the quickref documentation we find:
>
> :xit :x[it][!] [file] like ":wq" but write only when changes have
> been made
>
> If we open an existing file and we do not do any changes except for
> changing the encryption key(with the ":X" command) and then use the ":x"
> command to exit, the changes to the encryption key will not be applied.
> Note that the ":X" is not mandatory to be used, the behavior is the same
> even if we use ":set key=value". By changing the encryption key I mean all
> 3 scenarios(1 - file is not encrypted to file is encrypted; 2 - file is
> encrypted to file is encrypted, but with a different key; 3 - file is
> encrypted to file is not encrypted), since a key with an empty value means
> the file is not encrypted.
>
> Note that ":wq" does change the encryption.
>
> Is this a bug? Is it intended? Anyways, I just wanted to leave this here
> for people to know the workaround. If it's a bug, I'm willing to report one
> on github.

This is similar to changing the 'fileformat' option. The buffer is
considered modified then. So yes, I think we can call this a bug.
I'll add it to the todo list. You can create an issue on github for
more visibility.

--
hundred-and-one symptoms of being an internet addict:
78. You find yourself dialing IP numbers on the phone.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202005091540.049Fe0ur003568%40masaka.moolenaar.net.

No comments: