1. 07 Jul, 2017 4 commits
    • David Lawrence Ramsey's avatar
      replacing: make spotlight() account for varying chunk width · aa04ad4f
      David Lawrence Ramsey authored
      spotlight() now displays softwrapped lines chunk by chunk instead of all
      at once.  Since softwrapped lines are no longer of constant width, the
      latter approach would fail if softwrapping breaks the spotlighted text.
      
      Instead of taking a string, spotlight() now takes the starting and ending
      columns of that string.  Also, its handling of softwrapped lines is now
      split off into a separate function, spotlight_softwrapped().
      aa04ad4f
    • David Lawrence Ramsey's avatar
      softwrap: in do_mouse(), keep the cursor before a softwrap breakpoint · 4d7735c8
      David Lawrence Ramsey authored
      Add the new function actual_last_column() to accomplish this.
      4d7735c8
    • David Lawrence Ramsey's avatar
      softwrap: add new functions for chunks of varying width · e375995d
      David Lawrence Ramsey authored
      get_chunk_row() replaces the formula "column / editwincols".
      
      get_chunk_leftedge() replaces "(column / editwincols) * editwincols".
      
      get_last_chunk_row() replaces "strlenpt() / editwincols".
      
      get_last_chunk_leftedge() replaces "(strlenpt() / editwincols) * editwincols".
      
      This prepares us for any changes in those formulas, and for more such
      functions later.
      e375995d
    • David Lawrence Ramsey's avatar
      softwrap: prepare for allowing the chunk width to vary · 35f6a176
      David Lawrence Ramsey authored
      The new function find_softwrap_breakpoint() returns the column number
      of the last position in screen range where we can wrap the given text
      without breaking a two-column character in half (as was done until now).
      The returned column number is the leftedge of the next softwrapped chunk.
      
      If the end of the text is reached while searching for a wrapping point,
      the parameter end_of_line is set to TRUE.
      
      The new function get_chunk() uses find_softwrap_breakpoint() to find the
      row and leftedge corresponding to a given column of a given line.
      35f6a176
  2. 06 Jul, 2017 1 commit
  3. 04 Jun, 2017 2 commits
  4. 29 May, 2017 1 commit
  5. 11 May, 2017 1 commit
  6. 09 May, 2017 2 commits
  7. 08 May, 2017 4 commits
  8. 05 May, 2017 1 commit
  9. 03 May, 2017 1 commit
  10. 01 May, 2017 4 commits
  11. 30 Apr, 2017 1 commit
  12. 28 Apr, 2017 3 commits
  13. 25 Apr, 2017 2 commits
  14. 17 Apr, 2017 2 commits
  15. 09 Apr, 2017 2 commits
  16. 06 Apr, 2017 1 commit
    • Benno Schulenberg's avatar
      bindings: make ^Home and ^End go to top and tail of buffer · cb0806b2
      Benno Schulenberg authored
      On some terminal emulators, Ctrl+Home and Ctrl+End produce special
      keycodes, distinct from plain Home and End.  Make the users of those
      emulators (and of the Linux console) glad by making ^Home and ^End
      do the obvious thing, and the combinations with Shift too.
      cb0806b2
  17. 04 Apr, 2017 2 commits
  18. 22 Mar, 2017 6 commits
    • David Lawrence Ramsey's avatar
      softwrap: adjust firstcolumn when the window width changes · 0389a1d9
      David Lawrence Ramsey authored
      If the number of columns in the edit window changes (which currently
      only happens in two places: in regenerate_screen(), called when the
      window is resized; and in main(), when line numbering mode is toggled),
      the display will break if we're in softwrap mode and firstcolumn is
      nonzero.  This is because the column width of softwrapped chunks has
      changed, and firstcolumn is no longer the starting column of a chunk,
      an assumption that all code using firstcolumn relies on.
      
      To fix this problem, add a new function, ensure_firstcolumn_is_aligned(),
      to adjust firstcolumn to the starting column of the chunk it's on, and
      use it when the number of columns in the edit window changes.
      
      (Note that this function uses the simplest possible fix, and could
      probably be made more sophisticated.)
      0389a1d9
    • David Lawrence Ramsey's avatar
      softwrap: move the updating of a softwrapped line to a new function · 2f6c8987
      David Lawrence Ramsey authored
      The new function, update_softwrapped_line(), is called from inside
      update_line() when softwrap mode is on, so that existing calls remain
      unchanged.  It takes no index, instead displaying edittop from column
      firstcolumn, and all other lines from column zero.
      
      If current is on edittop, it's displayed using the edittop rules, but
      this is not a problem: if current[current_x] is above edittop at column
      firstcolumn, it's offscreen, and that should be handled before calling
      update_line() anyway.
      
      Together with the preceding bunch of changes,
      this fixes https://savannah.gnu.org/bugs/?47667.
      2f6c8987
    • David Lawrence Ramsey's avatar
      weeding: remove ensure_line_is_visible() · 80b3a301
      David Lawrence Ramsey authored
      Since all lines can be partially scrolled off the screen now
      (except for the top line of the edit window, which is forthcoming),
      ensure_line_is_visible() is no longer needed.
      80b3a301
    • David Lawrence Ramsey's avatar
      weeding: remove maxlines and related code · 812ecaeb
      David Lawrence Ramsey authored
      Since all lines can be partially scrolled off the screen now
      (except for edittop, which is forthcoming), the maxlines global
      variable and its computation mechanism are no longer needed.
      812ecaeb
    • David Lawrence Ramsey's avatar
      tweaks: add a parameter to do_home() and do_end() · a5e106d7
      David Lawrence Ramsey authored
      Add the parameter be_clever to both functions.  When be_clever is FALSE,
      smart home and dynamic home are disabled in do_home(), and dynamic end is
      disabled in do_end(), so that these functions only move to the beginning
      or end of the current line or chunk.
      
      This simple home and end functionality is needed to improve do_left()
      and do_right()'s horizontal behavior with softwrapped chunks, which is
      forthcoming.
      a5e106d7
    • David Lawrence Ramsey's avatar
      tweaks: prepare for improvements to do_home() and do_end() · d8189703
      David Lawrence Ramsey authored
      These improvements will eventually make do_home() and do_end() take
      parameters.  Since the global function lists can hold only functions
      without parameters, preemptively add do_home_void() and do_end_void(),
      and make the global function lists use them.
      d8189703