Re: [vim/vim] :delete reports one fewer line when deleting the entire buffer (Issue #21049)

Narendran Gopalakrishnan (Vim Github Repository) <[email protected]>
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/issues/21049/[email protected]>
gnarendran left a comment (vim/vim#21049)

> That is correct. `1,$d` deletes all lines, but your buffer will still have a single line. A buffer always has at least one line (otherwise the cursor couldn't be placed on it), so the output of `3 fewer lines` is actually correct.

This stand is defensible provided it is consistent. But look at what happens next with undo. Vim says "4 more lines". Vim doesn't say I already had that one empty line, now there are 4 lines, so only "3 more lines". So either delete's message is wrong, or the undo's.

I personally feel undo is appropriate, and delete is misleading, as from the user's perspective they have deleted 4 lines and only 3 lines deletion recognized. In fact if there was only one line and it was deleted, no message appears.

OTOH, this is only informational and the user can live with it (unless someone programmatically depends on the message). I will set the expectation right in the plugin about this inconsistency.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/21049#issuecomment-5312066469
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/issues/21049/[email protected]>

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/21049/5312066469%40github.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.