mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
feat(decorations): support virtual lines (for now: only one block at a time)
This commit is contained in:
@@ -1985,26 +1985,6 @@ static int diff_cmp(char_u *s1, char_u *s2)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Return the number of filler lines above "lnum".
|
||||
///
|
||||
/// @param wp
|
||||
/// @param lnum
|
||||
///
|
||||
/// @return Number of filler lines above lnum
|
||||
int diff_check_fill(win_T *wp, linenr_T lnum)
|
||||
{
|
||||
// be quick when there are no filler lines
|
||||
if (!(diff_flags & DIFF_FILLER)) {
|
||||
return 0;
|
||||
}
|
||||
int n = diff_check(wp, lnum);
|
||||
|
||||
if (n <= 0) {
|
||||
return 0;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
/// Set the topline of "towin" to match the position in "fromwin", so that they
|
||||
/// show the same diff'ed lines.
|
||||
///
|
||||
@@ -2030,6 +2010,7 @@ void diff_set_topline(win_T *fromwin, win_T *towin)
|
||||
}
|
||||
towin->w_topfill = 0;
|
||||
|
||||
|
||||
// search for a change that includes "lnum" in the list of diffblocks.
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) {
|
||||
if (lnum <= dp->df_lnum[fromidx] + dp->df_count[fromidx]) {
|
||||
@@ -2255,6 +2236,13 @@ bool diffopt_closeoff(void)
|
||||
return (diff_flags & DIFF_CLOSE_OFF) != 0;
|
||||
}
|
||||
|
||||
// Return true if 'diffopt' contains "filler".
|
||||
bool diffopt_filler(void)
|
||||
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
|
||||
{
|
||||
return (diff_flags & DIFF_FILLER) != 0;
|
||||
}
|
||||
|
||||
/// Find the difference within a changed line.
|
||||
///
|
||||
/// @param wp window whose current buffer to check
|
||||
|
Reference in New Issue
Block a user