- 28 Feb, 2017 11 commits
-
-
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
-
- 26 Feb, 2017 2 commits
-
-
Benno Schulenberg authored
Of course 'row' needs to be initialized to zero for the softwrap case.
-
Benno Schulenberg authored
This addresses https://savannah.gnu.org/patch/?9215 . Inspired-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
- 25 Feb, 2017 4 commits
-
-
Benno Schulenberg authored
Add its explanation as a separate paragraph. Also: improve the argument of the --syntax option, as this is a <name> and not merely a bundle of characters like the other <str> arguments.
-
David Lawrence Ramsey authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
In this last loop of break_line(), the pointer 'line' is one step ahead of the index 'lastblank'. So the loop should first add the length of the preceding character to 'lastblank' before determining the length of the current character (and using this to advance 'line').
-
- 24 Feb, 2017 10 commits
-
-
Benno Schulenberg authored
(There is something wrong in the last loop: line is one character ahead of lastblank, but the current character length is added to both of them. It thus assumes that all blank characters are the same number of bytes. For spaces and tabs this works fine. But for more exotic blanks...)
-
Benno Schulenberg authored
Also, remove an assert and adjust some comments.
-
David Lawrence Ramsey authored
-
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
-
David Lawrence Ramsey authored
In softwrap mode, the entire line is onscreen, so the word is never partially offscreen, so we always have enough columns to show it. This fixes https://savannah.gnu.org/bugs/?50389 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Give the strlenpt() routine its own implementation, so that it avoids a needless comparison plus subtraction in the inner loop.
-
David Lawrence Ramsey authored
Instead of allocating enough space to convert the entire passed string, just allocate space for converting the part that will be converted -- that is: starting from start_index. This still allocates far too much (if the passed string is very long and its tail part won't fit on the screen), but it's better than before.
-
- 23 Feb, 2017 3 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
- 22 Feb, 2017 3 commits
-
-
Mike Frysinger authored
-
Benno Schulenberg authored
This fixes https://savannah.gnu.org/bugs/?50379.
-
Benno Schulenberg authored
Cap the number of pauses when displaying ALERT messages, to avoid making the user wait for ages when tens or hundreds of files were specified on the command line. This fixes https://savannah.gnu.org/bugs/?50362 . Reported-by:
Mike Frysinger <vapier@gentoo.org>
-
- 21 Feb, 2017 3 commits
-
-
Benno Schulenberg authored
Reflect the significant changes in painting and regex searching in the copyright notices.
-
Mike Frysinger authored
-
Mike Frysinger authored
-
- 17 Feb, 2017 2 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.
-