aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-09-26 16:56:19 +0200
committerGitHub <noreply@github.com>2021-09-26 16:56:19 +0200
commitd4fa1649fbafe7bedb4bee0b014dd4723ad0ee97 (patch)
tree55324b1771b69ff551677801e328d76215d1d4cd /src/nvim/diff.c
parentc273eb310098a4ddae577401aca5e07b45107f48 (diff)
parent392c658d4d0f9457f143748adf98ecd4cdc8dc85 (diff)
downloadrneovim-d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97.tar.gz
rneovim-d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97.tar.bz2
rneovim-d4fa1649fbafe7bedb4bee0b014dd4723ad0ee97.zip
Merge pull request #15351 from bfredl/virt_line
feat(screen): virtual lines
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 93c0d636fa..5c43b2498e 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -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