Re: Retaining marks column on folded line

83 views
Skip to first unread message

Christian Brabandt

unread,
Jan 11, 2011, 12:08:17 PM1/11/11
to vim...@googlegroups.com, vim...@vim.org
On Tue, January 11, 2011 5:25 pm, Ben Fritz wrote:
> On Jan 10, 10:25�am, AK <andrei....@gmail.com> wrote:
>> I suspect this isn't possible in current vim but I'm wondering if it's
possible to add this to the next version.. Currently, if you have a
marks column and a folded line, marks column is blocked and overwritten
with a blank background of folded column.
>> When you have many folded functions or classes, that looks really ugly.
I think majority of people would prefer either to have contents of mark
of 1st folded line there or at least blank space of the same colour of
marks column.
>
> What is the "marks column"? Is it some plugin you have installed? And
can you post a screenshot? I really am having trouble picturing what you
are describing.

I think, if you have defined a sign in a line and this line is folded away
the sign won't be shown. I can reproduce it here.

I would consider this a bug, therefore forwarding to vim-dev.

regards,
Christian


Christian Brabandt

unread,
Jan 12, 2011, 4:00:57 PM1/12/11
to vim...@vim.org

I think, the attached patch fixes it.


regards,
Christian

sign_display.diff

Bram Moolenaar

unread,
Jan 15, 2011, 3:14:41 PM1/15/11
to Christian Brabandt, vim...@vim.org

Christian Brabandt wrote:

Thanks for the patch.

Is there a simple way to see the effect, e.g., using src/fold.c?

--
Contrary to popular belief, Unix is user friendly.
It just happens to be selective about who it makes friends with.
-- Dave Parnas

/// Bram Moolenaar -- Br...@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 ///

Christian Brabandt

unread,
Jan 16, 2011, 8:25:31 AM1/16/11
to Bram Moolenaar, vim...@vim.org
Hi Bram!

On Sa, 15 Jan 2011, Bram Moolenaar wrote:

> Thanks for the patch.
>
> Is there a simple way to see the effect, e.g., using src/fold.c?

Open fold.c with your vim.
:sign define marks text='a texthl=Search
:sign place 1 line=20 name=marks buffer=1

In a non-patched vim, the sign-column, won't be shown and be overdrawn
by the folds. Additionally, a sign, that is on the first line of the
fold, won't be shown as well.

regards,
Christian

Bram Moolenaar

unread,
Jun 12, 2011, 9:43:13 PM6/12/11
to Christian Brabandt, vim...@vim.org

Christian Brabandt wrote:

I finally had time to look into this. Sorry for the delay.

I think the current behavior is correct. Showing a sign only when it
happens to be on the first line of a closed fold doesn't seem right.
Why not show a sign on the second line or last line of the fold?

Since we don't show signs for the folded region, I think it's good to
also use the closed-fold color in the sign column.

--
If Microsoft would build a car...
... Occasionally, executing a maneuver such as a left turn
would cause your car to shut down and refuse to restart, in
which case you would have to reinstall the engine.

Christian Brabandt

unread,
Jun 13, 2011, 7:50:03 AM6/13/11
to Bram Moolenaar, vim...@vim.org
Hi Bram!

On Mo, 13 Jun 2011, Bram Moolenaar wrote:

> I finally had time to look into this. Sorry for the delay.
>
> I think the current behavior is correct. Showing a sign only when it
> happens to be on the first line of a closed fold doesn't seem right.
> Why not show a sign on the second line or last line of the fold?

Basically for the same reason, you show the line number of the first
line in the fold. But I don't have a strong feeling for it anyway. The
current behaviour is fine for me.

I just took the chance, when this question came up, to look into it and
give something back to the community.

> Since we don't show signs for the folded region, I think it's good to
> also use the closed-fold color in the sign column.

I don't really mind. In my opinion, it looks a little bit odd, though.

regards,
Christian
--

Reply all
Reply to author
Forward
0 new messages