1. 09 Jan, 2017 1 commit
  2. 02 Jan, 2017 1 commit
    • David Lawrence Ramsey's avatar
      weeding: remove unnecessary settings of openfile->current_y · b1c20629
      David Lawrence Ramsey authored
      Many of the adjustments of the value of openfile->current_y appear to be
      a holdover from the days when certain functions had to account for what
      is now called STATIONARY scrolling mode, which depends on the value of
      current_y.  Remove these adjustement where they are superfluous.
      
      do_para_begin(), do_para_end(), and do_bracket_match() update the screen
      through edit_redraw(), which uses either CENTERING or FLOWING scrolling
      mode, so their setting of current_y is redundant and useless, as it will
      be ignored and then overridden by the next call to reset_cursor().
      
      findnextstr() is called by go_looking() [which calls edit_redraw(), see
      above], and by do_replace_loop() and do_int_spell_fix(), which both call
      edit_refresh(), which in this case only uses CENTERING scrolling mode
      since focusing is TRUE.
      
      (Additionally, the adjustments of current_y in findnextstr() and
      do_bracket_match() use incorrect values when in softwrap mode.)
      
      find_paragraph() doesn't need to save or restore current_y, because it
      doesn't do any screen updates.  do_justify() calls edit_refresh() with
      focusing set to TRUE, so it uses the CENTERING scrolling mode.
      
      do_alt_speller() and do_formatter() do not need to save and restore
      current_y, because they don't modify it in any way.
      
      This addresses https://savannah.gnu.org/patch/?9197.
      b1c20629
  3. 09 Dec, 2016 2 commits
  4. 28 Oct, 2016 1 commit
  5. 27 Oct, 2016 1 commit
  6. 23 Oct, 2016 1 commit
  7. 20 Oct, 2016 1 commit
  8. 18 Oct, 2016 2 commits
  9. 15 Oct, 2016 1 commit
  10. 12 Oct, 2016 2 commits
  11. 20 Sep, 2016 1 commit
  12. 14 Sep, 2016 2 commits
  13. 13 Sep, 2016 1 commit
  14. 29 Aug, 2016 2 commits
  15. 21 Aug, 2016 2 commits
  16. 01 Aug, 2016 4 commits
  17. 28 Jul, 2016 1 commit
  18. 24 Jul, 2016 1 commit
  19. 27 May, 2016 1 commit
  20. 04 May, 2016 1 commit
    • Benno Schulenberg's avatar
      scrolling: center the cursor when inserted stuff does not fit on screen · 318ed6b1
      Benno Schulenberg authored
      Since nano-2.4.1, reading in or pasting a large piece of text would put
      the cursor on the bottom line, leaving only one line of the non-read or
      non-pasted text visible.  This is different from the centering behavior
      of Pico, and somewhat disorienting, as you can't see "where you are" any
      more in relation to the file as it was.
      
      So now center the cursor whenever the read or pasted text is larger than
      the screen, but don't center it when the text fits entirely on the screen.
      (The latter avoids the effect of the screen jumping unnecessarily when
      inserting just a few lines while the cursor is near the bottom.)
      
      To achieve this behavior: default to focusing, and temporarily set it to
      FALSE when the focusing effect is unwanted.
      
      This fixes https://savannah.gnu.org/bugs/?47841.
      318ed6b1
  21. 25 Apr, 2016 2 commits
    • Benno Schulenberg's avatar
      screen: rename 'edit_refresh_needed' to 'refresh_needed' · 53f4a9f5
      Benno Schulenberg authored
      For a little contrast with the function edit_refresh() -- it's
      annoying that when you search for the latter you get to see all
      the settings of the flag too.
      53f4a9f5
    • Benno Schulenberg's avatar
      screen: don't always set 'edit_refresh_needed' when adjusting edittop · b97c36c2
      Benno Schulenberg authored
      The function edit_update() is called by edit_refresh() itself, so it is
      silly that the first sets 'edit_refresh_needed' to TRUE.  This setting
      is needed only in a few cases -- in the others it's not needed because
      the screen does not need to be refreshed (it was just about positioning
      the cursor), or 'edit_refresh_needed' has already been set by a call to
      goto_line_posx().  So, just set the flag in the five places that need it
      and spare the other four calls.
      b97c36c2
  22. 15 Apr, 2016 1 commit
    • Benno Schulenberg's avatar
      softwrap: adjust for current_x when computing the amount to scroll · 2d50c4f2
      Benno Schulenberg authored
      The number of lines to scroll is: the y position of the start of the
      current line, plus the extra lines that this line occupies, plus the
      extra lines that the next line occupies, plus one, minus the y position
      of the last window line.
      
      The y position of the start of the current line is current_y -
      xplustabs() / COLS, the extra lines are strlenpt(data) / COLS,
      and the y position of the last window line is editwinrows - 1.
      
      Note that we first compute the amount to scroll before actually moving
      to the next line, because we need the current value of current_x, not
      the one that it will have in the next line.  The placewewant value is
      not good either, because it might be beyond where we actually are.
      
      This fixes https://savannah.gnu.org/bugs/?47665.
      2d50c4f2
  23. 13 Apr, 2016 3 commits
    • Benno Schulenberg's avatar
      screen: don't redraw some lines when doing a full refresh anyway · 503654e6
      Benno Schulenberg authored
      When in softwrap mode and scrolling down a line, and thus going to
      do a full refresh, get out and don't bother redrawing the current
      and prior lines first.
      503654e6
    • Benno Schulenberg's avatar
      screen: don't redraw the current line unnecessarily · e393a6c3
      Benno Schulenberg authored
      When moving the cursor up or down one line, redraw the new current
      line only when the target column (placewewant) is beyond the screen,
      or when the mark is on.
      
      (This still redraws the current and prior lines unnecessarily when
      they are in fact shorter than the screen is wide and the mark is off,
      but we'll let that pass for now.)
      
      Also, when softwrap is on, we don't have have to redraw the current
      and prior lines at all (when the mark is off): they are in full view,
      there is nothing to show or hide.
      e393a6c3
    • Benno Schulenberg's avatar
      screen: a full refresh is only needed when softwrap is on · 9d793032
      Benno Schulenberg authored
      When scrolling down a line, a full refresh of the edit window is only
      needed when softwrap is on, because only then the movement is irregular.
      When each file line takes up just one screen line (softwrap is off),
      edit_scroll() is perfectly able to scroll and redraw only the necessary
      lines.
      
      (But... when doing a full refresh anyway with softwrap, why bother
      scrolling at all?  Why not just adjust edittop and call refresh?)
      9d793032
  24. 11 Apr, 2016 1 commit
    • Benno Schulenberg's avatar
      screen: concentrate the setting of placewewant · aa1ae0a1
      Benno Schulenberg authored
      Instead of saving the current value of placewewant, then setting the
      new value, and then passing the old value to edit_redraw() in seven
      different places, just let edit_redraw() do this saving and setting.
      
      In the bargain placewewant is now only recalculated when it matters
      -- when allow_update is TRUE -- and not when it's superfluous.
      aa1ae0a1
  25. 07 Apr, 2016 1 commit
  26. 05 Apr, 2016 1 commit
  27. 22 Feb, 2016 1 commit
  28. 08 Dec, 2015 1 commit