- 28 Apr, 2017 1 commit
-
-
Benno Schulenberg authored
An iterator should not be called "start_col", because it is only the starting column at the very beginning. Also, start_col (after the rename) can never be /larger/ than column.
-
- 25 Apr, 2017 2 commits
-
-
Benno Schulenberg authored
And in the process transform the token DISABLE_HELP to ENABLE_HELP.
-
Rishabh Dave authored
Allow the user to search in a help text with ^W and M-W. Achieve this by not writing the help text directly to the screen but first writing it to a temporary file and then opening this file in a new buffer, and treating it specially: the normal file-reading feedback is suppressed, the titlebar shows the headline of the text, the cursor is hidden, and the menu is limited to just the up and down movements and searching. This fulfills https://savannah.gnu.org/bugs/?28994 . Signed-off-by:
Rishabh Dave <rishabhddave@gmail.com>
-
- 17 Apr, 2017 2 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Because nothing gets reset to zero or to some initial value.
-
- 09 Apr, 2017 2 commits
-
-
Benno Schulenberg authored
These functions are used only in the file in which they are declared, and they are declared before they are used.
-
Benno Schulenberg authored
The interval 2013-2017 for the Free Software Foundation is valid because in those years there were releases with changes by either Chris or David, and the GNU maintainers guide advises to mention a new year in all files of a package, not just in the ones that actually changed, and be done with it for the rest of the year.
-
- 06 Apr, 2017 1 commit
-
-
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.
-
- 04 Apr, 2017 2 commits
-
-
Benno Schulenberg authored
Verify at startup that the number is not too small.
-
Kamil Dudka authored
Use futimens() instead of utime() to change the timestamps on a backup file. Otherwise, a non-privileged user could create an arbitrary symlink with the name of the backup file and in this way fool a privileged user to call utime() on the attacker-chosen file. Import the relevant gnulib module to make sure futimens() is available.
-
- 22 Mar, 2017 10 commits
-
-
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.)
-
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.
-
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.
-
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.
-
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.
-
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.
-
David Lawrence Ramsey authored
The old name made it sound as if it didn't apply in softwrap mode. But it does: in softwrap mode a line needs updating when the mark is on.
-
David Lawrence Ramsey authored
Add the new functions current_is_above_screen() (which doesn't account for softwrapped chunks yet, but will when we can scroll edittop partially off the screen, which is forthcoming), current_is_below_screen() (which determines whether current[current_x] is past the softwrapped chunk at the bottom of the screen), and current_is_offscreen() (the union of the previous two functions). edit_redraw() and edit_refresh() now use current_is_offscreen() to check whether they should adjust the viewport, and adjust_viewport() now uses current_is_above_screen() to determine whether current is on or below the screen in FLOWING mode.
-
David Lawrence Ramsey authored
Add the new function less_than_a_screenful() to accomplish this. It uses go_back_chunks() to count the number of softwrapped chunks between the end point and the starting point of the paste. Now softwrap mode and non-softwrap mode behave the same way when uncutting fewer than editwinrows rows of text. Accordingly, remove the call to ensure_line_is_visible(), as it no longer applies.
-
David Lawrence Ramsey authored
These functions, go_back_chunks() and go_forward_chunks(), take a number of softwrapped chunks (screen rows) to move, a pointer to a buffer, and a location (specifically, a starting column of a softwrapped chunk). If they move successfully, they will update the buffer pointer and location to point to the beginning of the softwrapped chunk they moved to. Since non-softwrap mode is effectively just a subset of softwrap mode in which every line takes up one chunk, these functions also work in non-softwrap mode. In this case, their starting column will always be zero, as it would be in softwrap mode on a line that takes up one chunk. Nothing uses these functions yet, but that is forthcoming.
-
- 20 Mar, 2017 1 commit
-
-
Benno Schulenberg authored
-
- 06 Mar, 2017 5 commits
-
-
Mike Frysinger authored
Now that we pull in the gnulib getopt-gnu module, we can assume it exists.
-
Mike Frysinger authored
Now that we pull in the gnulib regex module, we can assume it exists.
-
Mike Frysinger authored
Switch over to gnulib for these.
-
Mike Frysinger authored
Switch over to gnulib for these.
-
Mike Frysinger authored
These are provided by gnulib now.
-
- 28 Feb, 2017 2 commits
-
-
David Lawrence Ramsey authored
With read_file() revamped, it now uses partition_filestruct() indirectly via ingraft_buffer(), so we can't use partition_filestruct() to replace marked text in the alternate spell checker anymore without segfaulting. Add the new function replace_marked_buffer() to accomplish this instead. Based on replace_buffer(), it uses extract_buffer() to throw away the marked un-spell-checked text, and then uses read_file() to insert the spell-checked text at the position where the mark was. Accordingly, remove unneeded partitioning and related stuff from do_alt_speller(). Besides pasting the file into the buffer at current[current_x], ingraft_buffer() also deals with renumbering, updating totsize, and handling a magicline, so do_alt_speller() doesn't need to do those anymore.
-
David Lawrence Ramsey authored
Move buffer handling and '\r' stripping from read_line() to read_file(), so that the file gets its format determined and gets stored in its own buffer entirely in one function. Then use ingraft_buffer() to insert this new buffer into the current one. In addition to pasting the file at current[current_x], ingraft_buffer() also deals with renumbering, the updating of totsize, and the handling of a magicline, so read_file() doesn't need to do those anymore. Note that all this makes read_file() depend on the position of current[current_x] to know where to insert the file. Accordingly, set current_x to zero in initialize_buffer_text() instead of in make_new_buffer(), so that replace_buffer() keeps working properly.
-
- 24 Feb, 2017 2 commits
-
-
David Lawrence Ramsey authored
Also, rename a parameter to be less cryptic, and remove an entire condition because the relevant block will never be reached when getting called from the help routines: if blank_loc is negative, the function will have bailed out in the preceding if.
-
Benno Schulenberg authored
-
- 17 Feb, 2017 3 commits
-
-
David Lawrence Ramsey authored
Later on we're going to need the ability to graft a buffer into the current file buffer without making a copy of it first.
-
David Lawrence Ramsey authored
The name "filestruct" was a mistake. What was meant was: buffer -- a linked list of structs that each describe a line.
-
David Lawrence Ramsey authored
-
- 13 Feb, 2017 1 commit
-
-
Benno Schulenberg authored
When replacements are made, nothing needs to be reset any more (it was done insufficiently anyway). Just make sure the screen is refreshed when all is done -- this may be superfluous when doing interactive replacements, but not when replacing all.
-
- 10 Feb, 2017 1 commit
-
-
Benno Schulenberg authored
Just like when spell-checking, there is no need to wrap around when doing replacements in a region, because a region cannot straddle the buffer's edges. This is the proper fix for https://savannah.gnu.org/bugs/?50158, and fixes https://savannah.gnu.org/bugs/?50273.
-
- 05 Feb, 2017 1 commit
-
-
David Lawrence Ramsey authored
Scrolling works on rows, not on lines. Accordingly, rename the nlines variable to nrows. And rows should be of the type int, not ssize_t.
-
- 26 Jan, 2017 1 commit
-
-
Benno Schulenberg authored
When the user answered No to a replacement prompt, skip the match at the current position, so we don't stay stuck there. Also, when replacing in the backward direction, or the match is of length zero, skip the match at the current position, to not get stuck. This fixes https://savannah.gnu.org/bugs/?50126 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com> This also fixes https://savannah.gnu.org/bugs/?50137, and refixes https://savannah.gnu.org/bugs/?48635, and fixes https://savannah.gnu.org/bugs/?50144.
-
- 12 Jan, 2017 2 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
- 09 Jan, 2017 1 commit
-
-
Benno Schulenberg authored
-