- 12 Sep, 2017 3 commits
-
-
Benno Schulenberg authored
-
David Lawrence Ramsey authored
This is modeled after the comment/uncomment code. Each line's individual indent is saved in the string array of the undo group structure. This fixes http://savannah.gnu.org/bugs/?46860.
-
David Lawrence Ramsey authored
The function does not contain any comment-specific code, so it can be used to handle any kind of multiline undo item. Also, extend the undo group structure to contain an array of strings, one for each line in the group. When indent/unindent is hooked up to the undo/redo code, this will allow the latter to restore the exact original indents.
-
- 10 Sep, 2017 5 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Also, remove an unneeded null_at() -- the null byte has been copied, and reallocating the string would recover very little memory. Also, call charmove() without using the & operator.
-
Benno Schulenberg authored
-
David Lawrence Ramsey authored
-
David Lawrence Ramsey authored
This is modeled after the undo/redo code for commenting. do_indent() now calls indent_a_line() on each line it covers. The latter function will eventually be used by the undo/redo code.
-
- 16 Aug, 2017 3 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Also reshuffle an initialization and drop two useless asserts.
-
Benno Schulenberg authored
The preceding 'for' loop has already established that all the lines are either unindentable or composed of only blanks. So if now a line cannot be unindented, it means it is fully blank, so it can be simply skipped. This fixes https://savannah.gnu.org/bugs/?51760 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
- 15 Aug, 2017 3 commits
-
-
Benno Schulenberg authored
Also, trim or improve some comments.
-
David Lawrence Ramsey authored
Also, only unindent when all selected lines can be unindented, which means that the relative indentation will be preserved. For this purpose, it ignores empty lines and lines consisting of only whitespace. When unindenting is not possible, a message is shown. This fixes https://savannah.gnu.org/bugs/?47684.
-
David Lawrence Ramsey authored
Instead of inserting the extra whitespace after the current indentation of a line, add it to the start of the line. This causes a fixed amount of visual whitespace to be added regardless of whether --tabstospaces is used or not. This fixes http://savannah.gnu.org/bugs/?51438, and its ancestor https://savannah.gnu.org/bugs/?51408.
-
- 06 Aug, 2017 2 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Without them, nano still compiles for me, with everything enabled, even when using --enable-debug, --enable-utf8, and --with-slang.
-
- 31 Jul, 2017 1 commit
-
-
David Lawrence Ramsey authored
-
- 29 Jul, 2017 1 commit
-
-
Benno Schulenberg authored
Assume that a linter line that contains an actual error message or warning includes a colon followed by a space -- something that that opening message from a modern gcc lacks.
-
- 27 Jul, 2017 3 commits
-
-
Benno Schulenberg authored
-
David Lawrence Ramsey authored
-
Benno Schulenberg authored
-
- 26 Jul, 2017 1 commit
-
-
Benno Schulenberg authored
Human column numbers are one-based, whereas x positions are zero-based. Converting from the one to the other involves subtracting one. But when the linter message does not provide a column number, the latter defaults to zero. Catch that case and change the number to one. This fixes https://savannah.gnu.org/bugs/?51550.
-
- 25 Jul, 2017 1 commit
-
-
David Lawrence Ramsey authored
The charalloc() macro does exactly this.
-
- 24 Jul, 2017 1 commit
-
-
David Lawrence Ramsey authored
Commit 28beb3f9 added the 'forreal' parameter to prevent spotlight() from placing the cursor wrongly due to an invalid placewewant. However, since the variable-width softwrap overhaul (specifically, since commit 8490f4ac), place_the_cursor() no longer checks placewewant, so the parameter is no longer needed. Furthermore, dropping 'forreal' and thus always setting current_y won't affect the operation of spotlight(), since the only functions that use spotlight() (do_replace_loop() and do_int_spell_fix()) both call edit_refresh() beforehand, which means that current_y will already have been set to the value it will be set to again.
-
- 14 Jul, 2017 2 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
- 13 Jul, 2017 1 commit
-
-
Benno Schulenberg authored
The help lines need to be redrawn one step after a justification (whether it has been undone or not, to replace "Unjustify" with "Uncut" again for ^U), and after switching buffers (to update a possibly changed tag for ^T). This fixes https://savannah.gnu.org/bugs/?51455.
-
- 12 Jul, 2017 7 commits
-
-
David Lawrence Ramsey authored
Make them reflect the split into two functions, the direct use of tabsize, and the difference in behavior between indent and unindent.
-
David Lawrence Ramsey authored
Since all indentation and unindentation is by a tab, or by a tab's worth of spaces, use tabsize directly.
-
David Lawrence Ramsey authored
Also remove one unneeded blank line.
-
David Lawrence Ramsey authored
-
David Lawrence Ramsey authored
-
David Lawrence Ramsey authored
The parameter 'cols', that indicates how many columns to indent or unindent, is changed to be always positive, so the check for being negative can go. And it could never be zero anyway.
-
David Lawrence Ramsey authored
This is the first step toward splitting them into two dedicated functions, instead of letting do_indent() handle both cases.
-
- 09 Jul, 2017 2 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
- 07 Jul, 2017 4 commits
-
-
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().
-
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.
-
David Lawrence Ramsey authored
If the position of the cursor changes horizontally, placewewant should change with it. This fixes https://savannah.gnu.org/bugs/?51407 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
Benno Schulenberg authored
-