[vim/vim] diff_filler(line("$")+1) gives the number of EOF Filler lines, but is undocumented (Issue #20990)

Narendran Gopalakrishnan (Vim Github Repository) <[email protected]> Sun, 09 Aug 2026 20:20:27 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/issues/[email protected]>
gnarendran created an issue (vim/vim#20990)

### Steps to reproduce

The current documentation :help diff_filler merely says:
```text
diff_filler({lnum}) ... Returns the number of filler lines above line {lnum}. ...
```
However, filler lines can also occur after the last buffer line, at the end of the file. As no valid line number follows these EOF filler lines, the documentation does not clarify how their number can be obtained, or even how EOF filler lines can be detected.

A working solution (proposed by Gemini and perhaps informally known in the Vim/Neovim community) is to assume a virtual line number `line("$")+1` following the EOF filler lines. However, only Vim/Neovim documentation can establish whether this is intended and supported behavior.

So please include this special case in the documentation:

***As a special case, if filler lines occur after the last buffer line, they are considered to be above a virtual line number `line("$")+1`. Thus, `diff_filler(line("$")+1)` returns the number of filler lines at the end of the file.***

### Expected behaviour

Documentation of diff_filler() should also state:

**As a special case, if filler lines occur after the last buffer line, they are considered to be above a virtual line number line("$")+1. Thus, diff_filler(line("$")+1) returns the number of filler lines at the end of the file.**

### Version of Vim

9.2.390

### Environment

Fedora44
xterm
xterm-256color
bash

### Logs and stack traces

```shell

```

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

Message ID: <vim/vim/issues/[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/20990%40github.com.