On Wed, 07 May 2025, Jim Harkins wrote:

> I started by looking at the feasibility and wound up with a proof of
> concept, though I intended to get feedback earlier.
> 
> Feature Proposal
> 
> Enable fold text lines to be hidden, allowing more unfolded lines to
> be displayed.
> 
> Use Case
> 
> This feature pairs well with foldmethod=expr. With foldexpr that
> matches, for example, a variable name, only lines with that variable
> are displayed allowing rapid scanning. In this use case, the fold text
> tends to get in the way. If desired, the gaps can be made apparent by
> turning on line numbers, ":set nu".
> 
> Precedent
> 
> Xedit, Kedit, and THE editors implement the ALL command that shows
> only lines that match a target. By default. a "shadow line" is
> displayed to represent excluded lines. The shadow line can be disabled
> by "SET SHADOW OFF". I've seen other editors support this but I can't
> name them.
> 
> While searching for an existing workaround or prior attempt at
> implementing this feature, I easily found occasional requests for this
> functionality going back at least 20 years.
> 
> Status
> 
> I have a proof of concept that I think could be improved with
> feedback.
> 
> Implementation details:
> 
> I've implemented a boolean option with window scope provisionally
> named "foldline" (abbr. "fdln"). This defaults to TRUE, which enables
> current behavior. Setting foline to FALSE (:set nofoldline) suppresses
> the display of fold text lines. I also considered naming the option
> "showfoldline", but I think starting a fold related command with
> "fold" is expected. I'm not convinced "foldlin" is the best name, but
> ":set nofoldline" or ":set nofdln" has felt okay in use.
> 
> Documentation (could use improvement)
> 
> doc/quickref.txt:
> 
> 
>     'foldline'       'fdln'    set to display fold text line for a
>     closed line
> 
> 
> doc/options.txt
> 
> 
>        *'foldline'* *'fdln'* *'nofoldline'* *'nov'* 'foldline' 'fdln'
>     boolean (default on) local to window {not available when compiled
>     without the |+folding| feature} When off, fold line is not
>     displayed. See |folding|.
> 
> 
> Code
> 
> https://github.com/jimhark/vim/tree/foldline
> 
> Tests
> 
> Have not been implemented. If this feature is accepted I can write the
> tests. These would be a big help:
> 
>  1. Pointer to your testing documentation and recommended resources 2.
>  Example test code: 1. For a window scope boolean option. 2. For a
>  feature that changes the way the screen is drawn.
> 
> I look forward to feedback and an opportunity to get this feature
> accepted.

Hi,
thanks for that. I think this would match nicely with the existing 
folding feature. For one, I think the option should be called 
'foldshowline' or similar so that as suggested it matches the existing 
'fold' options.

However, I'd strongly suggest to somehow mark those hidden lines (e.g. 
by some different highlighting), to make it apparent to the user, that 
the lines are really just hidden and they are not accidentally lost 
their file content.

For precedent, you may want to check some of the existing local-window 
option. See :h options.txt and search for "local to window". 
Documentation for the option value should go to this help file and for 
the specifics of hiding lines, please add something to fold.txt
For changing the way text is rendered, check the conceal feature in 
win_line().

Thanks,
Christian
-- 
It is the quality rather than the quantity that matters.
                -- Lucius Annaeus Seneca (4 B.C. - A.D. 65)

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/aB%2BxmMn%2BLZySngzI%40256bit.org.

Raspunde prin e-mail lui