~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to src/nvim/move.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20160418214219-1e6d4o1fwqarzk46
Tags: 0.1.3-1
* New upstream release.  (Closes: #820562)
* debian/control:
  + Remove unnecessary luarocks Build-Depends
  + Add libkvm-dev Build-Depends for kfreebsd-*
  + Add python(3)-neovim to Recommends.  (Closes: #812737)
  + Declare compiance with policy 3.9.8, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1288
1288
   * - at least 'scrolloff' lines above and below the cursor
1289
1289
   */
1290
1290
  validate_cheight();
1291
 
  int used = curwin->w_cline_height;
1292
 
  if (curwin->w_cursor.lnum < curwin->w_topline)
 
1291
  int used = curwin->w_cline_height;  // includes filler lines above
 
1292
  if (curwin->w_cursor.lnum < curwin->w_topline) {
1293
1293
    scrolled = used;
 
1294
  }
1294
1295
 
1295
1296
  if (hasFolding(curwin->w_cursor.lnum, &top, &bot)) {
1296
1297
    --top;
1301
1302
  }
1302
1303
  new_topline = top + 1;
1303
1304
 
1304
 
  /* count filler lines of the cursor window as context */
 
1305
  // "used" already contains the number of filler lines above, don't add it
 
1306
  // again.
 
1307
  // Hide filler lines above cursor line by adding them to "extra".
1305
1308
  int extra = diff_check_fill(curwin, curwin->w_cursor.lnum);
1306
 
  used += extra;
1307
1309
 
1308
1310
  /*
1309
1311
   * Check if the lines from "top" to "bot" fit in the window.  If they do,
1312
1314
  while (top > 0) {
1313
1315
    int i = hasFolding(top, &top, NULL)
1314
1316
            ? 1  // count one logical line for a sequence of folded lines
1315
 
            : plines(top);
 
1317
            : plines_nofill(top);
1316
1318
    used += i;
1317
1319
    if (extra + i <= off && bot < curbuf->b_ml.ml_line_count) {
1318
1320
      if (hasFolding(bot, NULL, &bot))