[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fill column indicator functionality

From: Ergus
Subject: Re: Fill column indicator functionality
Date: Sat, 9 Mar 2019 14:22:09 +0100
User-agent: NeoMutt/20180716

On Fri, Mar 08, 2019 at 10:06:41PM +0200, Eli Zaretskii wrote:
Date: Fri, 8 Mar 2019 19:57:46 +0100
From: Ergus <address@hidden>
Cc: address@hidden

I have been playing with the display engine in order to try to implement
this functionality (at least a proof of concept). But after reading the
comments and the ~33E3 lines in xdisp.c there are more questions now
than answers.

Feel free to ask the questions here.

The simplest approach I see is to add a '|' (or similar) in the desired
column in the "at_end_of_line:" label. But maybe there is a better

You are on the right track.  But I'd suggest to do this inside the
function extend_face_to_end_of_line.  It is called near that label,
but you will see that it's called in several more places; I expect at
least some of them to need the same changes.

Hi Eli, I just finished a working version (pretty simple as a proof of
concept). That works in terminal mode. But in graphical mode we should
look for another approach because extend_face_to_end_of_line returns in:

  && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
  && face->box == FACE_NO_BOX
  && FACE_COLOR_TO_PIXEL (face->background, f) == FRAME_BACKGROUND_PIXEL (f)
  && !face->stipple
  && !it->glyph_row->reversed_p)

So it don't write until the line end.

In graphical mode maybe it is better to do this change writing directly
a vertical line in the windows' frame background. That way it will be maybe
more efficient because we only do it once. But I don't know if this is

Else, we can follow a similar approach than in terminal version and
generate a glygh for that cases. What do you think?

BTW: Is it possible to generate a single wider glyph instead of doing a

The glyph concept is actually not  clear for me yet, specially in
graphical mode.

My approach is somehow based on the display_line_numbers, but taking
into account that in this case the characters are always the same, maybe
there is a way to set them in the background and it will be simpler?

Simpler than what?  Can you tell what kind of complexity did you want
to avoid?

Display of line numbers needs to calculate the number of each screen
line, and that of course is not needed in this case.  You just need
to calculate the width of a stretch glyph that will display as
whitespace between the end of the line and the fill column.  You will
see that extend_face_to_end_of_line already does something similar in
the case of R2L lines.

Is it there any documentation about this?

Maybe, but to point you to it I need to understand what "this" means
in this context.

specially the relations between the data structures?

Which data structures? there are quite a few of them, so please be
more specific.

glyph <-> it: why this looks so complex? Because "it" has too many
properties I can't understand their functionalities and sometimes I
think I could reinvent the wheel.

because the it and the glyphs are very confusing.

Feel free to ask any questions about these two, especially about what
confuses you.

Any help please?

I'm here to help.

And thanks for working on this.

Thanks to you.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]