- 22 Mar, 2017 3 commits
-
-
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 3 commits
-
-
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 1 commit
-
-
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 $.
-
- 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 14 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
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
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
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.
-
Mike Frysinger authored
On a system with up-to-date GNU tools, this does not change the size of nano's binary. We start off with importing only a few modules, although we don't yet delete the fallback logic for them.
-
- 01 Mar, 2017 3 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
The mark only needs to be off when calling replace_marked_buffer(), because this indirectly calls ingraft_buffer(), which fiddles with the end points if the mark is on.
-
- 28 Feb, 2017 12 commits
-
-
Benno Schulenberg authored
This fixes https://savannah.gnu.org/bugs/?50415.
-
Benno Schulenberg authored
Running strlenpt() on a string that takes up more than 80 columns (the width of an average terminal) takes /more/ time than simply converting an extra character (the one that will be overwritten by the "$" at the edge of the terminal). So... just convert one more character than necessary when the line is overlong. In the most common case, however, the line will fit fully onscreen, and we save a whole call of strlenpt().
-
David Lawrence Ramsey authored
Since we only need span columns of the string, stop scanning the string as soon as we have that many columns, instead of scanning the string all the way to the end. This speeds up the conversion of very long lines.
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
This fixes https://savannah.gnu.org/bugs/?50403 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
David Lawrence Ramsey authored
Replace partitioning with calls to extract_buffer() and ingraft_buffer(). In addition to pasting the unjustified text back into the buffer at current[current_x], ingraft_buffer() also deals with renumbering and updating totsize, so do_justify() doesn't need to do those anymore when unjustifying.
-
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
-
David Lawrence Ramsey authored
With read_file() revamped to handle inserting a file at the current position, partitioning the buffer is no longer needed.
-
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.
-
- 27 Feb, 2017 2 commits
-
-
Benno Schulenberg authored
Also, avoid a warning with with --enable-tiny --enable-browser.
-
Benno Schulenberg authored
-