- 22 Mar, 2017 15 commits
-
-
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
Make do_end() more useful in softwrap mode: let it move to the end of the current chunk instead of the end of the line; only when already at the end of a chunk, let it move to the end of the line. This is "dynamic end".
-
David Lawrence Ramsey authored
Make do_home() more useful in softwrap mode: let it move to the beginning of the current chunk instead of to the beginning of the whole line; only when already at the beginning of a chunk, let it move to the beginning of the line. This is called "dynamic home'. The above rules are ignored when --smarthome is in effect and the cursor is somewhere in the leading whitespace of a line -- then the cursor is moved to the first non-whitespace character of the line.
-
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
Use go_back_chunks() and go_forward_chunks() to move from the row current_y is on to the row mouse_row is on. Now softwrap mode and non-softwrap mode will behave the same way when we can scroll edittop partially off the screen, which is forthcoming. Accordingly, remove the call to ensure_line_is_visible(), as it no longer applies. The old code did work, but it behaved differently between softwrap mode (which counted down from edittop) and non-softwrap mode (which counted up or down from current_y to take less time, and used a double loop to keep current from going to NULL). The new code counts up or down from current_y in both softwrap mode and non-softwrap mode. In non-softwrap mode, it also avoids the double loop, since go_back_chunks() and go_forward_chunks() keep the filestructs they operate on from going to NULL.
-
David Lawrence Ramsey authored
Use go_back_chunks() to adjust edittop, instead of special casing the computation of goal when softwrapping. Now softwrap mode and non-softwrap mode will behave the same way when edittop can be partially scrolled off the screen, which is forthcoming. (Note that the top line of the screen can't be partially scrolled yet, so we have to work around that for now.)
-
David Lawrence Ramsey authored
Use go_back_chunks() and go_forward_chunks() to adjust edittop and to move up or down to the scrolled region before updating the rows there. Now softwrap mode and non-softwrap mode will behave the same way when we can scroll the top line of the screen partially off the screen, which is forthcoming. (Note that the top line of the screen can't be partially scrolled yet, so we have to work around that for now.)
-
David Lawrence Ramsey authored
Not drawing a line on a row if we're on the top row and scrolled down, or if we're on the bottom row and scrolled up, will only work properly if the line on that row takes up only that row. The latter might not be the case in softwrap mode: if the line occupies multiple chunks and begins on that row -- in that case none of the chunks would be drawn.
-
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
In softwrap mode, nano doesn't horizontally scroll lines at all, so in this case get_page_start() should always return zero.
-
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
Use less_than_a_screenful() again, just as in do_uncut_text().
-
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
Use go_forward_chunks() to count softwrapped chunks between the current cursor position and the bottom of the file. Now softwrap mode and non-softwrap mode behave the same way when moving to a line and column non-interactively, instead of the former's always centering the screen.
-
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 4 commits
-
-
Benno Schulenberg authored
And modify a few wordings too.
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Most of these variables are freed moments later -- reallocating them is thus a waste of time.
-
Benno Schulenberg authored
-
- 16 Mar, 2017 1 commit
-
-
Benno Schulenberg authored
This addresses a followup of https://savannah.gnu.org/bugs/?50362 . Reported-by:
Mike Frysinger <vapier@gentoo.org>
-
- 14 Mar, 2017 2 commits
-
-
Mike Frysinger authored
Our use of globbing (for syntax files) doesn't care about such symlinks. This avoids an unnecessary increase in size of eight kilobytes -- see https://lists.gnu.org/archive/html/nano-devel/2017-03/msg00036.html.
-
Benno Schulenberg authored
Instead of redetermining the entire span of the converted string, simply move one character left, and then bite it off to make place for the trailing $.
-
- 09 Mar, 2017 1 commit
-
-
Mike Frysinger authored
These functions aren't available on mingw toolchains, so include the gnulib modules so we can fall back on them.
-
- 08 Mar, 2017 1 commit
-
-
Benno Schulenberg authored
If the last two columns of a row would be taken up by a double-width character (and the line is longer than that), don't print it, because it wouldn't leave any room for the $ character. This fixes https://savannah.gnu.org/bugs/?50491 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
- 06 Mar, 2017 16 commits
-
-
David Lawrence Ramsey authored
It's already in the external documentation; it should be here as well.
-
Hans-Bernhard Broeker authored
The platform's default char type might be signed, which could cause problems in 8-bit locales. This addresses https://savannah.gnu.org/bugs/?50289 . Reported-by:
Hans-Bernhard Broeker <HBBroeker@T-Online.de>
-
Mike Frysinger authored
This is used by systems that lack sys/wait.h, like Windows.
-
Mike Frysinger authored
Windows doesn't have this, so add some build time checks.
-
Mike Frysinger authored
Pull in the sigaction module from gnulib, and add ifdef checks for a bunch of signals that don't exist on Windows.
-
Mike Frysinger authored
This is used by systems that lack lstat(), like Windows.
-
Mike Frysinger authored
Not all curses implementations provide this function, so drop it from depending on slang (and assuming ncurses) to a general build time test.
-
Mike Frysinger authored
Windows doesn't have *nix style account databases.
-
Mike Frysinger authored
This is used by systems that lack glob.h, like Windows.
-
Mike Frysinger authored
Since gnulib provides these now, we can assume them.
-
Mike Frysinger authored
The gnulib imports handle this for us now.
-
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.
-