- 07 Jul, 2017 3 commits
-
-
David Lawrence Ramsey authored
get_chunk_row() and get_chunk_leftedge() now become wrappers around get_chunk(); the latter is only used directly in place_the_cursor() when we need to get both the row and the leftedge. get_chunk() now uses the proper formula to implement varying chunk width. Since chunk width now varies, place_the_cursor() sets the x position relative to the leftedge in a different way that works regardless of chunk width, update_softwrapped_line() loops until it gets all softwrap breakpoints instead of calculating the full length in advance and getting one full row at a time, the chunk iterators now count leftedges instead of rows, and fix_firstcolumn() does a full recalculation of the chunk that firstcolumn is on instead of simply shifting it back. Also, in update_softwrapped_line(), when a line's softwrap breakpoint is before the last column of the edit window, a ">" is now added to the end of it. The workaround in place_the_cursor() for when two-column characters straddle the edge of the screen is removed, as it's no longer needed now that chunks end before such characters. Furthermore, do_home() and do_end() use xplustabs() instead of placewewant again when calculating the leftedge, since placewewant refers to a column that may or may not be available (if it's not, the cursor will be placed wrongly). Make get_edge_and_target() use xplustabs() instead of placewewant for the same reason; this also lets us simplify get_edge_and_target(), since xplustabs() will never be greater than strlenpt(). Finally, since do_end() now has to calculate rightedge as well as rightedge_x, use the former to implement the same time-saving optimizations as in do_home(). The cursor is not yet adjusted when we try to go directly to a column past the end of a softwrap breakpoint, and placewewant handling in the vertical movement code is not yet adjusted for varying chunk lengths, but fixes for these are forthcoming. This fixes https://savannah.gnu.org/bugs/?49440.
-
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
The new function find_softwrap_breakpoint() returns the column number of the last position in screen range where we can wrap the given text without breaking a two-column character in half (as was done until now). The returned column number is the leftedge of the next softwrapped chunk. If the end of the text is reached while searching for a wrapping point, the parameter end_of_line is set to TRUE. The new function get_chunk() uses find_softwrap_breakpoint() to find the row and leftedge corresponding to a given column of a given line.
-
- 02 Jul, 2017 2 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
- 30 Jun, 2017 1 commit
-
-
Benno Schulenberg authored
When also --nohelp is active and the terminal is so narrow that the message that --constantshow displays on the bottom row does not fit, this causes the cursor to be pushed "offscreen". Some terminal emulators don't handle this case correctly, and leave the cursor in an invisible or mistaken position. Compensate for this by moving the cursor back to the start of the row. This fixes https://savannah.gnu.org/bugs/?51335 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
- 04 Jun, 2017 3 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
Benno Schulenberg authored
-
- 31 May, 2017 3 commits
-
-
Benno Schulenberg authored
This fixes a secondary part of https://savannah.gnu.org/bugs/?51124.
-
Benno Schulenberg authored
When receiving a SIGCONT, don't call regenerate_screen() directly but act as if a SIGWINCH occurred. Also insert a dummy key, and thus let the relevant input routine redraw the relevant subwindows. Use KEY_F0 as the dummy key, as both Ncurses and Slang know it, and it should normally do nothing at all. This fixes https://savannah.gnu.org/bugs/?51124.
-
Benno Schulenberg authored
When we are in the file browser, browser_refresh() will take care of redrawing the title bar and the file list, so total_refresh() should leave those two subwindows alone in that case. This fixes https://savannah.gnu.org/bugs/?51147.
-
- 29 May, 2017 3 commits
-
-
Benno Schulenberg authored
Achieve this by making the suppression flag global, so that we can just reset it instead of making an improper call of do_cursorpos(). This fixes the secondary part of https://savannah.gnu.org/bugs/?51134.
-
Benno Schulenberg authored
Also, remove a useless assert.
-
Benno Schulenberg authored
This fixes https://savannah.gnu.org/bugs/?51134.
-
- 19 May, 2017 1 commit
-
-
Benno Schulenberg authored
-
- 16 May, 2017 1 commit
-
-
Benno Schulenberg authored
-
- 11 May, 2017 1 commit
-
-
Benno Schulenberg authored
When spotlighting the string to be replaced, placewewant isn't valid, so tell place_the_cursor() to ignore its value to avoid the cursor getting mistakenly placed at the beginning of the next row. This fixes https://savannah.gnu.org/bugs/?50997 . Reported-by:
David Lawrence Ramsey <pooka109@gmail.com>
-
- 08 May, 2017 1 commit
-
-
Benno Schulenberg authored
Also, allow Ctrl+Left/Right with --enable-tiny --enable-browser.
-
- 07 May, 2017 1 commit
-
-
David Lawrence Ramsey authored
Add missing spaces, remove excess spaces, and replace groups of indentation spaces with tabs.
-
- 05 May, 2017 2 commits
-
-
Benno Schulenberg authored
-
David Lawrence Ramsey authored
When the editing space gets narrower, either by toggling line numbers on or making nano's window smaller, and when the cursor is near the bottom, it can be pushed offscreen. In that case, don't get it back onscreen by centering the current line but by putting it on the bottom row. This makes for a smoother experience. This fixes http://savannah.gnu.org/bugs/?50933.
-
- 01 May, 2017 2 commits
-
-
Benno Schulenberg authored
Also, trim some comments and avoid an unused-variable warning.
-
Benno Schulenberg authored
Also, reshuffle two initializations to go sit with the other ones.
-
- 30 Apr, 2017 1 commit
-
-
Benno Schulenberg authored
This avoids https://savannah.gnu.org/bugs/?49912 while at the same time avoiding to draw the edit window twice in a row -- the first drawing would use a wrong margin, which results in a visible and irritating shift left or right of the content upon the second drawing. This fixes https://savannah.gnu.org/bugs/?50877.
-
- 28 Apr, 2017 3 commits
-
-
Benno Schulenberg authored
-
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.
-
Benno Schulenberg authored
The mbwidth() function itself checks whether UTF-8 is being used and does the right thing.
-
- 25 Apr, 2017 5 commits
-
-
Benno Schulenberg authored
Also, mention that help texts can now be searched through, update a copyright notice, and update and simplify a copyright year.
-
Benno Schulenberg authored
And in the process transform the token DISABLE_HELP to ENABLE_HELP.
-
Benno Schulenberg authored
The top-left corner changing is far more conspicuous than the top right.
-
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>
-
Benno Schulenberg authored
This fixes https://savannah.gnu.org/bugs/?50872.
-
- 24 Apr, 2017 1 commit
-
-
Benno Schulenberg authored
The go_back_chunks() function will do this clipping. This fixes https://savannah.gnu.org/bugs/?50866.
-
- 19 Apr, 2017 1 commit
-
-
Benno Schulenberg authored
It takes almost no code and is a useful little improvement over Pico.
-
- 17 Apr, 2017 5 commits
-
-
Benno Schulenberg authored
-
Benno Schulenberg authored
Because nothing gets reset to zero or to some initial value.
-
Benno Schulenberg authored
To avoid an ncurses hiccup (miscoloring) when running on musl. This fixes https://savannah.gnu.org/bugs/?50787 . Reported-by:
Avi Halachmi <avihpit@yahoo.com>
-
Benno Schulenberg authored
The cursor needs to be placed in its proper spot in the edit window /only/ when nano is about to accept input from the user and needs to show where this input will go. (This might cause a scrolling issue to appear, because reset_cursor() does not just place the cursor, it also recomputes current_y, which is used in several places to determine whether and how much to scroll. If it so happens, we'll deal with that fallout later.)
-
Benno Schulenberg authored
-