Commit Graph

1418 Commits (24cdf78a93656e1ded587659271aca55181f9a6e)

Author SHA1 Message Date
Benno Schulenberg cddfcb1b9d tweaks: rename a struct element, to make sense 2019-03-21 17:23:49 +01:00
Benno Schulenberg aac4fc46e9 tweaks: rename a type, to make more sense 2019-03-21 17:08:52 +01:00
Benno Schulenberg 513d2ae905 build: fix compilation when configured with --disable-utf8 2019-03-15 16:41:02 +01:00
Benno Schulenberg 47f3dc75d8 display: use non-breaking space instead of dot for VTE-bug workaround
When UTF-8 is available, it is better to use a character that displays
as a space.

This improves the fix for https://savannah.gnu.org/bugs/?55896.
2019-03-15 14:58:37 +01:00
Benno Schulenberg 5f529a48e6 tweaks: don't bother trying to draw characters beyond the screen's edge 2019-03-15 14:04:23 +01:00
Benno Schulenberg d9faac618d display: dot the stripe when it's in the last column, to defeat a VTE bug
This addresses https://savannah.gnu.org/bugs/?55896.
2019-03-15 13:49:12 +01:00
David Lawrence Ramsey 93ee0a8a65 display: show the guide stripe for double-width/multi-byte characters
Determine the actual number of bytes the striped character consists of,
instead of assuming it's simply one, and determine the real column that
the character starts in, instead of assuming it's the stripe column.

This fixes https://savannah.gnu.org/bugs/?55917
and fixes https://savannah.gnu.org/bugs/?55922.

Condensed-by: Benno Schulenberg <bensberg@telfort.nl>
2019-03-15 13:29:11 +01:00
Benno Schulenberg 15959346fb tweaks: exclude the guide-stripe code from the tiny version
The option is not available, so including the code is pointless.
2019-03-14 19:34:35 +01:00
Benno Schulenberg 902b4674f9 display: account for horizontal scrolling when drawing the guide stripe
That is, draw the stripe relative to the column at which the current
"chunk" starts.

This fixes https://savannah.gnu.org/bugs/?55920.
2019-03-14 17:01:48 +01:00
Benno Schulenberg a20340b5a8 copyright: update the years for significantly changed files 2019-03-10 17:03:42 +01:00
Benno Schulenberg 916b4d81d0 rcfile: add 'stripecolor' for changing the color of the guiding stripe
The default is now simply reverse video, which works better than a
"loud" colored bar in an interface that for the rest is monochrome.
2019-03-09 09:27:08 +01:00
Benno Schulenberg 66c6eb5166 new feature: option --guidestripe that shows a vertical guiding bar
Option -J (--guidestripe) takes a column number as argument and then
shows a vertical, colored bar over the entire height of the buffer,
to aid the user in regulating the width of the text when the terminal
is wider than this desired width.

This fulfills https://bugs.debian.org/916392.
Requested-by: Arturo Borrero González <arturo@debian.org>
And fulfills https://savannah.gnu.org/bugs/?55315.
Requested-by: Bryan Christ <bryan.christ@gmail.com>
2019-03-09 09:27:08 +01:00
David Lawrence Ramsey 43b42246d3 display: properly handle double-width characters when spotlighting
When the right half of a two-column character gets overwritten by the
">" continuation character, then represent its left half as "[" also
when spotlighting a replacement candidate.  Achieve this by calling
display_string() in the overshooting case with 'isprompt' set to TRUE,
which also makes this function reserve space for the ">" continuation
character so spotlight() doesn't need to do this any more.

This fixes https://savannah.gnu.org/bugs/?55679.

Improved-by: Benno Schulenberg <bensberg@telfort.nl>
2019-03-08 19:56:52 +01:00
David Lawrence Ramsey 40a74e46e6 display: correct the logic for making room for the ">" character
The change in commit edc0d628 was flawed.  The old logic covered
every case but one: having reached the end of 'buf' but 'column'
still having overshot the screen width.  Now cover this latter
case too.

This fixes https://savannah.gnu.org/bugs/?55638 properly,
allowing the next commit to fix another buglet.

Condensed-by: Benno Schulenberg <bensberg@telfort.nl>
2019-03-08 19:52:33 +01:00
David Lawrence Ramsey f13dd140eb display: correctly trim an overshooting character from a prompt answer
Tell display_string() explicitly when we're at a prompt, instead of
letting it glean this from the current menu not being MMAIN, which
fails in some circumstances.

This improves the fix for https://savannah.gnu.org/bugs/?55620,
fixes https://savannah.gnu.org/bugs/?55680 in a better way,
and fixes https://savannah.gnu.org/bugs/?55773.
2019-02-28 19:47:55 +01:00
Benno Schulenberg 1eb639d55e display: show "[" for half of two-column character also when softwrapping
This should have been part of commit ad505e7f.
2019-02-24 21:45:53 +01:00
Benno Schulenberg 79ca3ceabf copyright: update the years for the FSF 2019-02-24 19:35:56 +01:00
Benno Schulenberg 7c30d1fa69 display: account for zero-width characters when reserving space for '>'
That is: keep nibbling off characters until a character is eaten that
takes up at least one column.

This fixes https://savannah.gnu.org/bugs/?55759.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>

Bug existed since version 2.8.0, commit 5283acdc.
2019-02-24 11:28:52 +01:00
Benno Schulenberg 82492ead47 tweaks: rename two variables, to be less confusing 2019-02-20 16:43:03 +01:00
Benno Schulenberg 420fe4d1e6 tweaks: switch from checking MORE_SPACE to checking EMPTY_LINE 2019-02-19 19:53:19 +01:00
Benno Schulenberg 322a6f46fa tweaks: switch from checking SMOOTH_SCROLL to checking JUMPY_SCROLLING 2019-02-19 19:52:57 +01:00
Benno Schulenberg 252bb60036 display: highlight the ">"/"<" continuation characters in reverse video
To make it obvious that they are not actual characters in the file.

The default highlighting is in reverse video, but this can be changed
to bold by using --bold or 'set boldtext'.

This fulfills https://savannah.gnu.org/bugs/?55571.
2019-02-15 17:15:28 +01:00
Benno Schulenberg 6d34b8a5cd display: change the "$" continuation character to ">" and "<"
The angular brackets look a bit like arrows and thus hint much more
at the idea of continuation than a dollar sign.

With-help-from: David Lawrence Ramsey <pooka109@gmail.com>
2019-02-15 17:12:57 +01:00
Benno Schulenberg ad505e7fff display: represent half of a double-width character with "[" and "]"
When the screen's edge leaves just one column for a two-column
character, then show its left half as "[" and its right half as "]".

(They used to be shown as ">" and "<", but these characters will be
repurposed in the next commit.)

This addresses https://savannah.gnu.org/bugs/?55657.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2019-02-15 17:12:34 +01:00
Benno Schulenberg 5618189643 prompt: trim a double-width character at the screen's edge
It needs to be trimmed and substituted with a single-width placeholder
to prevent the continuation character ">" from getting pushed to the
next row.

Also, use the correct width for the answer so that the continuation
character is only displayed when the answer does not fit any more.

This fixes https://savannah.gnu.org/bugs/?55620.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>

Original-patch-by: David Lawrence Ramsey <pooka109@gmail.com>
2019-02-07 20:04:56 +01:00
David Lawrence Ramsey edc0d6280a display: properly trim double-width characters at the edit window's edge
When a line ends with a two-column character, and this character straddles
the edit window's edge, then, although we've reached the end of 'buf', we
have exceeded the 'beyond' column and this two-column character needs to
be trimmed from the 'converted' string, otherwise it would get printed on
the next row.

This fixes https://savannah.gnu.org/bugs/?55638.

Bug existed since version 2.8.0, commit 5283acdc.
2019-02-06 10:09:55 +01:00
David Lawrence Ramsey e771503ee5 tweaks: adjust indentation after the previous commit 2019-01-15 19:47:11 +01:00
David Lawrence Ramsey 194d18586c input: properly handle <Escape>s followed by a shifted Meta+letter
After a series of escapes, also <Shift+Meta+letter> should be recognized
as a command keystroke, not just <Meta+letter>.

This fixes https://savannah.gnu.org/bugs/?55442.

Bug existed since the ignoring of <Escape>s before a valid command
keystroke was introduced in version 3.0, commit ecc9211a.
2019-01-15 19:41:48 +01:00
Benno Schulenberg 15320d3b96 tweaks: word some comments more concisely 2018-12-30 21:30:26 +01:00
Benno Schulenberg 0e9fb6a0da tweaks: rename two variables, to be more descriptive 2018-12-30 20:18:29 +01:00
Benno Schulenberg fb4ce71cfc tweaks: correct a comment typo, and trim a few other comments 2018-12-30 18:00:28 +01:00
Benno Schulenberg 7a2c851dfc tweaks: reorder some ifs, to reduce the average number of comparisons 2018-12-30 17:50:10 +01:00
Benno Schulenberg 4d55748999 tweaks: reduce a bunch of repetitious comments to their essence
And in the bargain add two missing equivalences.
2018-12-30 17:31:36 +01:00
Benno Schulenberg e7198f49a4 tweaks: elide an unneeded intermediate variable 2018-12-30 16:48:48 +01:00
Benno Schulenberg 997826d794 tweaks: rename a symbol, to match its corresponding option 2018-12-28 17:47:03 +01:00
Benno Schulenberg 0946153b47 tweaks: hard-bind ASCII DEL in a slightly more economical way
And in the bargain get rid of a duplicate help-text entry for
either "Del" or "Bsp".
2018-12-28 17:20:18 +01:00
Benno Schulenberg 9b2c2697cb options: make -d (--rebinddelete) work without -K (--rebindkeypad)
When the terminfo selected by TERM does not match the terminal and
the <Delete> key behaves the same as <Backspace> (deleting leftward)
or the <Backspace> key behaves the same as <Delete> (deleting without
moving the cursor), then using just -d or --rebinddelete should make
the deviant key behave correctly again without affecting the other.
2018-12-28 17:19:09 +01:00
Benno Schulenberg 55537dc218 display: show it in title bar when starting up in restricted mode 2018-12-03 12:33:00 +01:00
David Lawrence Ramsey 5474a9f34b input: properly consume a modified Delete key also in the tiny version
This fixes https://savannah.gnu.org/bugs/?54981.

Bug existed since commit fb8d981b from a month ago.
2018-11-08 18:12:39 +01:00
Benno Schulenberg e938c24d04 tweaks: renumber a couple of symbols, and reshuffle a bit of code
Also, contract the regex for key strings.
2018-11-07 19:30:04 +01:00
David Lawrence Ramsey f55a3fabef input: recognize some escape sequences for <Shift+Delete>
Also, hard-bind <Shift+Delete> in the same way as <Backspace>.

This fixes https://savannah.gnu.org/bugs/?54948,
and fixes https://savannah.gnu.org/bugs/?54975.
2018-11-07 19:17:16 +01:00
Benno Schulenberg 7ee07af081 tweaks: reshuffle a couple of conditions, to group things better 2018-11-06 20:56:16 +01:00
Benno Schulenberg 15ec0eb3ee bindings: make <Alt+Up> and <Alt+Down> work also on a Linux console
This fixes https://savannah.gnu.org/bugs/?54964.
2018-11-06 20:55:09 +01:00
Benno Schulenberg 7dad21f4f4 tweaks: don't bother asking ncurses for keycodes for shifted Left/Right
These modified keys have codes by default: KEY_SLEFT and KEY_SRIGHT.
It's just the shifted Up/Down keys that don't have default codes.
2018-11-06 19:18:54 +01:00
Benno Schulenberg 9923b073af tweaks: include an extra function call only where it is needed
And fix a typo.
2018-11-05 10:21:17 +01:00
Benno Schulenberg 9d9ae8dc76 tweaks: add two more translator hints 2018-11-05 09:54:06 +01:00
Benno Schulenberg 77826c2b06 tweaks: stop setting and requiring the Meta flag for special keycodes
Set the Meta flag only for the regular Meta keystrokes: "M-" plus a
printable ASCII character.  The special keycodes are unique and do
not need any extra flags to differentiate them.
2018-11-04 20:35:15 +01:00
Benno Schulenberg 89760cd6ec tweaks: reshuffle some conditions, putting the least likely one first 2018-11-04 20:34:50 +01:00
David Lawrence Ramsey f02e2d3b6e input: properly recognize Alt+Delete when using -K/--rebindkeypad
This works for xterm, rxvt, Eterm, Konsole, and xfce4-terminal, which
generate "Esc [ 3 ; 3 ~", but not for urxvt, which generates one of
its double-escape sequences, "Esc Esc [ 3 ~".
2018-11-04 11:47:09 +01:00
Brand Huntsman 252f14796e bindings: hard-bind the zap function to M-Del (Alt+Delete)
So that the function is available in a default setup.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-11-04 11:47:03 +01:00
Benno Schulenberg 518a2b4c45 tweaks: remove some old debugging code 2018-10-24 17:41:32 +02:00
Benno Schulenberg b7f53096fb display: use a different color when showing a linting message
This is a second step to address https://savannah.gnu.org/bugs/?54714.
2018-10-23 19:31:40 +02:00
Benno Schulenberg f7f7767e7d display: let the title bar show when nano is in linting mode
This is a first step to address https://savannah.gnu.org/bugs/?54714.
2018-10-23 19:30:22 +02:00
Brand Huntsman d342cbbff8 display: make all dying messages end in a newline
So that the following shell prompt will not be glued onto the message
but will be on a line by itself.

Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-10-21 17:27:58 +02:00
David Lawrence Ramsey 6ed0a12d80 tweaks: join two lines, and add a clarifying comment 2018-10-16 19:18:58 +02:00
David Lawrence Ramsey dda9d4e357 input: don't detect <Ctrl+Shift+Delete> on Linux console in tiny version 2018-10-16 19:15:33 +02:00
David Lawrence Ramsey 53865ced9d weeding: remove the 'active' parameter from spotlight()
After the previous change, it is always TRUE and thus pointless.
2018-10-09 20:03:52 +02:00
David Lawrence Ramsey c2e4f77594 display: do spotlighting as part of drawing the screen
When something is spotlighted, it should survive a refresh of
the screen and an excursion to a help text, so the spotlight
should get painted whenever the edit window is drawn.

This fully fixes https://savannah.gnu.org/bugs/?54721.
2018-10-09 20:03:47 +02:00
Benno Schulenberg 826be439db bindings: make the Shift+arrow keys work by default on more terminals
Ask ncurses for the codes for the Shift+arrow keys, so that also
<Shift+Up> and <Shift+Down> can be recognized, for which ncurses
doesn't have standard codes.

This fixes https://savannah.gnu.org/bugs/?54790.
Reported-by: Javier Valencia <javiervalencia80@gmail.com>
2018-10-07 10:17:10 +02:00
Benno Schulenberg 8bffc8ea53 tweaks: add a comment, and correct an indentation 2018-10-05 20:32:02 +02:00
Benno Schulenberg fb8d981bfa tweaks: exclude word-deletion keystrokes from the tiny version
Because word deletion is not available there.
2018-10-05 19:24:38 +02:00
Benno Schulenberg 0b63de335e tweaks: elide a wrapper function that is no longer useful 2018-09-28 20:09:12 +02:00
Benno Schulenberg 628eef28b3 bindings: make the linter separately accessible, through M-B by default
This allows running the speller (default binding: ^T) also on files for
which a linter has been defined.  This makes it possible to spell check
comment blocks in source files, for example.

This fulfills https://savannah.gnu.org/bugs/?54711.
Requested-by: Mike Frysinger <vapier@gentoo.org>
2018-09-28 20:08:59 +02:00
Benno Schulenberg 600295a3af bindings: when implanting a string, make sure to use positive values
This fixes https://savannah.gnu.org/bugs/?54712.
2018-09-28 19:51:53 +02:00
Benno Schulenberg e998814bbc help: show the keystroke <Ctrl+Shift+Delete> as "Sh-^Del"
And in the bargain always return a fixed code instead of searching for
a keystroke that is bound to 'cutwordleft' (which might fail).
2018-09-23 19:57:04 +02:00
Benno Schulenberg fe6cb6e516 bindings: recognize <Ctrl+Shift+Delete> also on a Linux console
This fixes https://savannah.gnu.org/bugs/?54716.
2018-09-23 19:43:27 +02:00
Benno Schulenberg 65e4784eec bindings: bind ASCII DEL during startup instead of repeatedly at runtime 2018-09-18 19:14:05 +02:00
Benno Schulenberg 4e7b92ed4c tweaks: sharpen an optimization, to allow DEL to be a shortcut 2018-09-16 19:21:27 +02:00
Benno Schulenberg b84d7bf7a5 input: keep the cursor in edit window after message, also on NetBSD
This fixes https://savannah.gnu.org/bugs/?54632.
2018-09-12 15:22:53 +02:00
Benno Schulenberg 6840205e84 tweaks: remove a superfluous comment and a redundant assignment 2018-09-12 15:07:44 +02:00
Benno Schulenberg 3c5e5d4b6f input: recognize the sequences for Ctrl+Shift+Delete on xterm and urxvt
This fixes https://savannah.gnu.org/bugs/?54648.
2018-09-12 15:04:59 +02:00
Benno Schulenberg c7affe17c0 build: fix compilation again when configured with --enable-tiny 2018-09-08 12:24:12 +02:00
Benno Schulenberg e6429e782a bindings: hard-bind <Ctrl+Shift+Delete> to 'cutwordleft'
On FreeBSD and NetBSD (when reached through ssh from a Linux machine)
this has the absurd effect of making <Ctrl+Backspace> do a 'cutwordleft'
by default, out of the box, without needing any rebindings.  Weird, but
wonderful, because the ideal behavior.

Also ensure that <Shift+Delete> always does a Backspace.

This makes that we have the following set of "congruent" keys:

  <Tab> moves text to the right,
  <Shift+Tab> moves text to the left,
  <Delete> "eats" a character to the right,
  <Shift+Delete> "eats" a character to the left,
  <Ctrl+Delete> "eats" a word to the right,
  <Shift+Ctrl+Delete> "eats" a word to the left.
2018-09-07 19:31:38 +02:00
Brand Huntsman 6e80772311 tweaks: correct four spaces of indentation to a tab, in two places
Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-08-29 18:01:21 +02:00
Brand Huntsman 25e9877607 statusbar: elevate three messages to an ALERT, to make them more visible
Signed-off-by: Brand Huntsman <alpha@qzx.com>
2018-08-28 20:02:59 +02:00
Benno Schulenberg 975b491235 dropping a feature: remove the ability to use the 'formatter' command
Since the last version, the user can filter an entire buffer through
an external command.  This external command can also be a formatting
program, so there is no longer any need for this specific and special
formatter command.
2018-08-09 20:29:30 +02:00
Marco Diego Aurélio Mesquita a67f6c6031 input: erase the next word when Ctrl is held while pressing Delete
Bind the until-now unbound function 'cutwordright' to <Ctrl+Delete>.
The complementary function, 'cutwordleft', is not bound by default
because on many terminals the keystroke <Ctrl+Backspace> generates
^H -- the canonical ASCII backspace character.  We cannot change the
existing action of ^H without upsetting some users.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2018-07-22 19:27:50 +02:00
Benno Schulenberg 46f5d51fb5 input: fully consume modified PgUp and PgDn keys also in the tiny version
They should not enter a digit plus a squiggle into the buffer.
2018-07-17 18:28:55 +02:00
Benno Schulenberg b99ec28a60 tweaks: recognize escape sequences of modified Ins/Del more precisely
The third character after the escape must be a semicolon.
2018-07-16 18:45:41 +02:00
Benno Schulenberg b2acffe5be input: stop <Alt+Insert> from entering "3~" into the buffer 2018-07-16 18:45:21 +02:00
Benno Schulenberg 2fef7f647d input: stop a modified Delete key from entering stuff into the buffer
When using option -K on an xterm-like terminal, pressing <Shift+Del>,
<Alt+Del>, or <Ctrl+Del> would enter "2~", "3~", or "5~", respectively,
into the buffer.  Now it will just report an "Unknown sequence".
2018-07-15 09:22:55 +02:00
Benno Schulenberg 89c0e7493f tweaks: don't call va_start() without calling va_end() [coverity scan] 2018-07-14 21:15:23 +02:00
Benno Schulenberg ecc9211afc input: ignore any <Escape>s before a valid command keystroke
Just like an <Esc> before a Ctrl+letter keystroke is ignored, an <Esc>
before an Alt+letter keystroke should be ignored too -- it should not
be interpreted as if the user had typed <Esc> <Esc> letter.

This fixes https://savannah.gnu.org/bugs/?54301.
2018-07-13 09:27:38 +02:00
Benno Schulenberg ab0897072a input: consume the whole escape sequence for modified PgUp and PgDn keys
Even when we don't act on most of these combinations, at least eat up
the whole sequence so the unknown keystroke doesn't enter things like
"3~" into the buffer.

This fixes https://savannah.gnu.org/bugs/?54291.
2018-07-13 09:25:01 +02:00
David Lawrence Ramsey fce54a724d tweaks: fix some grammar plus a typo in the comments 2018-05-27 20:19:46 +02:00
Benno Schulenberg 455899fe27 credits: sort the names roughly according to amount of influence
And spell-fix a name.
2018-05-16 12:05:40 +02:00
Benno Schulenberg 87283711ee tweaks: improve a couple of comments 2018-05-10 18:10:23 +02:00
Benno Schulenberg 0da554e6d7 startup: suggest using ^D to finish reading from standard input
Also, add a period after the "Read nn lines" message, and
don't let the next shell prompt overwrite this message.

This addresses https://savannah.gnu.org/bugs/?53779.
2018-05-01 11:15:19 +02:00
Benno Schulenberg d4304ca88c search: use a better value to mean "nothing was typed"
When the keyboard buffer is empty, return a value that is not equivalent
to <Ctrl+Space>, so that typing a bunch of these while searching is going
on will not result in some of them getting executed afterward.
2018-04-13 20:13:05 +02:00
Benno Schulenberg bf1a080923 build: exclude more things when configured with --disable-multibuffer
This will make the tiny version slightly smaller.
2018-03-23 11:09:37 +01:00
Benno Schulenberg 1ebb1da382 tweaks: elide a parameter that is always 1
And adjust the comments accordingly.
2018-03-10 12:43:33 +01:00
Benno Schulenberg 5eccaa7633 tweaks: refactor the implanting of a key expansion 2018-02-27 13:34:32 +01:00
Benno Schulenberg ffebd31cbb tweaks: shorten the name of two record elements
Exclude the confusing, pleonastic 'sc' abbreviation from their names.
2018-02-24 19:31:11 +01:00
Benno Schulenberg b027263a37 small addition: allow customizing the color of an error message
The new option 'set errorcolor' allows the user to specify the color
combination for the status bar when an error message is displayed.
2018-02-23 12:35:17 +01:00
Benno Schulenberg a083d7f1e1 tweaks: rename a variable to be more distinct and greppable 2018-02-04 18:25:10 +01:00
Benno Schulenberg 58ed3a8152 display: wipe the status bar when doing a total refresh
This fixes https://savannah.gnu.org/bugs/?52997.
2018-01-28 21:08:28 +01:00
Benno Schulenberg e11021a7a5 input: recognize the deviant keycode for <Ctrl+End> in urxvt
This fixes https://savannah.gnu.org/bugs/?52972.
Reported-by: Brand Huntsman <alpha@qzx.com>
2018-01-28 16:15:21 +01:00
Benno Schulenberg 83c264939b tweaks: move a bunch of comments to the lines that they refer to 2018-01-28 13:41:46 +01:00
Benno Schulenberg b18e76d4d8 tweaks: drop two unneeded initializations, and trim a comment 2018-01-27 20:26:15 +01:00
Benno Schulenberg f5c87a7fee tweaks: swap the row and col parameters to a more consistent order 2018-01-27 20:00:14 +01:00
Benno Schulenberg 18bf2af9c1 tweaks: rename a function, to be more distinct
So one doesn't find it when grepping for get_input().
2018-01-27 11:29:11 +01:00
Benno Schulenberg f72fecee9b copyright: update the years for the FSF
And one for me, for the much changed keyboard stuff.
2018-01-24 10:14:43 +01:00
Benno Schulenberg fa7e9b11df input: recognize more escape sequences for <Shift+Home> and <Shift+End>
This fixes the second part of https://savannah.gnu.org/bugs/?52960.
2018-01-23 19:44:18 +01:00
Benno Schulenberg 838b175d4f input: recognize escape sequences for <Shift+PageUp> and <Shift+PageDown>
This fixes the first part of https://savannah.gnu.org/bugs/?52960.
2018-01-23 19:32:13 +01:00
Benno Schulenberg 6795d079b1 tweaks: mark the two blocks that have a deviant indentation
Also, reshuffle a case, to put the short one first and lose a line.
2018-01-23 18:10:22 +01:00
Benno Schulenberg e739448cd0 input: consume only the actual length of an escape sequence
Instead of assuming that the entire contents of the keybuffer are an
escape sequence (even if this is far longer than any escape sequence
can be), remove from the keybuffer only those integers that actually
constituted a sequence, valid or invalid.

This fixes https://savannah.gnu.org/bugs/?48659.
2018-01-23 17:31:48 +01:00
Benno Schulenberg 8e328e43c2 input: make <Shift+Tab> do an unindent also on a Manjaro console
This fixes https://savannah.gnu.org/bugs/?52943.
2018-01-23 16:52:51 +01:00
Benno Schulenberg 4ad0490ce4 tweaks: rename a variable, for more contrast 2018-01-20 18:22:24 +01:00
Benno Schulenberg 96b47f2877 tweaks: transform a parameter, from a pointer to the value itself 2018-01-15 20:09:03 +01:00
Benno Schulenberg 7da391beb7 tweaks: drop a superfluous parameter, as it is always 1 2018-01-15 19:54:12 +01:00
Benno Schulenberg 90cf4838d2 tweaks: don't bother to reallocate when the keybuffer size decreases
It will be reallocated soon enough when the size increases again.
2018-01-15 19:46:16 +01:00
Benno Schulenberg caeed6821c tweaks: reshuffle two condition series, to look better 2018-01-11 13:02:55 +01:00
Benno Schulenberg eb1bf8f927 tweaks: rename a variable, and further condense some comments 2018-01-11 12:52:14 +01:00
Benno Schulenberg 2c8b99d5e9 tweaks: condense and rewrap some comments, and reindent two lines
Also drop an old debugging fragment.
2018-01-11 10:51:18 +01:00
Benno Schulenberg 091dd71f08 tweaks: remove a superfluous case -- there can never be four digits 2018-01-11 10:31:23 +01:00
Benno Schulenberg 837475519b input: fully reset state when a three-digit character code is cut short
There shouldn't be two separate variables (but with the same name) that
count the number of digits seen.  Fuse them into a single static var.

This fixes https://savannah.gnu.org/bugs/?52863.
2018-01-11 10:17:51 +01:00
Benno Schulenberg 31540e3e7e tweaks: remove a superfluous check, as we insert always one code 2018-01-10 21:32:32 +01:00
Benno Schulenberg ae3b8579fa tweaks: condense a condition and a comment, and reshuffle a line 2018-01-10 21:25:19 +01:00
Benno Schulenberg e1199cd94d tweaks: elide a tiny intermediate buffer, and rename two variables
Use the same method as in parse_verbatim_kbinput() for Unicode input.
2018-01-10 20:33:12 +01:00
Benno Schulenberg 45d2458b47 tweaks: don't bother freeing the key buffer, just reallocate it 2018-01-10 19:25:23 +01:00
Benno Schulenberg 4c505e5127 tweaks: rename a function, for aptness, and drop a superfluous check 2018-01-10 17:40:07 +01:00
Benno Schulenberg 0bb6c0234f tweaks: condense the conditional compilation of shortcut reassignments
These three functions are needed only when both linter and speller
are available.
2018-01-09 13:31:58 +01:00
Benno Schulenberg 17429d7f38 tweaks: fix some whitespace errors, and convert alignment tabs to spaces 2017-12-29 21:35:14 +01:00
Benno Schulenberg 87206c0607 tweaks: convert the indentation to use only tabs
Each leading tab is converted to two tabs, and any leading four spaces
is converted to one tab.  The intended tab size (for keeping most lines
within 80 columns) is now four.
2017-12-29 20:06:50 +01:00
Benno Schulenberg b574f73e60 tweaks: add a separate function that actually wipes the status bar 2017-12-29 17:40:41 +01:00
Benno Schulenberg 12073001c2 tweaks: condense, reword, and rewrap a bunch of comments 2017-12-26 22:14:25 +01:00
David Lawrence Ramsey 62ebd93579 tweaks: use printf's z modifier for (s)size_t, instead of casting 2017-12-26 14:11:18 +01:00
Benno Schulenberg 7ad5afb935 tweaks: remove some unneeded parentheses, and shorten two function calls 2017-12-17 20:32:17 +01:00
Benno Schulenberg e1b0f2b275 display: ensure that cursor is visible when compiled with --with-slang
This fixes https://savannah.gnu.org/bugs/?52651.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-12-17 16:34:02 +01:00
Benno Schulenberg 0e0fb452a3 input: optimize a bit for non-shortcut keys, as they are most frequent 2017-12-17 12:49:04 +01:00
David Lawrence Ramsey f66432e999 input: support backtab when Slang and/or --rebindkeypad is used
The escape sequence "Esc [ Z" is a backtab on most supported terminals,
so make sure convert_sequence() treats it as such.
2017-12-17 12:11:35 +01:00
Benno Schulenberg 08e9d30fa2 tweaks: condense some debugging code, and rewrap a line 2017-12-16 21:50:10 +01:00
Benno Schulenberg 031305c205 tweaks: strip some debugging stuff, and condense a bit of code 2017-12-16 19:56:15 +01:00
Benno Schulenberg 09958ebdff input: allow using <Tab> and <Shift+Tab> to (un)indent selected region
When the mark is on, instead of letting a <Tab> simply insert a Tab
character at the cursor position, let it indent the marked region.

Original-idea-by: Chris Allegretta <chrisa@asty.org>
2017-12-12 20:37:41 +01:00
Benno Schulenberg a95c6c5fe8 tweaks: condense or rewrap a bunch of repetitious comments 2017-12-11 20:02:43 +01:00
Benno Schulenberg c24e95e3d6 tweaks: elide the 'mark_set' boolean -- the 'mark' pointer is enough
The pointer not being NULL is enough indication that the mark is set.

Also, rename the pointer from 'mark_begin' to simply 'mark', since
the former is kind of pleonastic.
2017-11-21 21:14:33 +01:00
Benno Schulenberg 2b438e6ef4 input: make the macro key discoverable by giving feedback when undefined 2017-11-20 19:57:33 +01:00
Benno Schulenberg 5239e7c52b copyright: update some years, and standardize on the dashed format 2017-11-12 10:46:20 +01:00
Benno Schulenberg 0c2b54a276 tweaks: rename a function plus two parameters, to be more fitting 2017-11-11 20:58:56 +01:00
David Lawrence Ramsey 477b246771 tweaks: use printf's z modifier for most of the size_t/ssize_t types
Also, properly refer to numreplaced as signed, since it's ssize_t
(even though it's only shown when positive).
2017-11-07 17:55:21 +01:00
Benno Schulenberg d054044d30 tweaks: transform the token DISABLE_EXTRA to ENABLE_EXTRA 2017-11-01 20:33:14 +01:00
Benno Schulenberg d5ac1ed395 tweaks: transform the token DISABLE_COLOR to ENABLE_COLOR 2017-11-01 19:45:50 +01:00
Benno Schulenberg c4d2a92d4c tweaks: reshuffle some code in order to elide a variable
Initialize 'breaking_col' to what it needs to be when the current chunk
consists of only a tab -- a tab that spreads across both start and end
of the chunk -- so that the last 'if' can move into the preceding one,
which allows the elision of 'char_len'.
2017-10-30 21:02:23 +01:00
David Lawrence Ramsey d344c3d042 display: don't cut off zero-width characters at the end of a chunk
This fixes https://savannah.gnu.org/bugs/?52258.
Reported-by: Peter Passchier <peter@passchier.net>
2017-10-25 19:07:38 +02:00
Marco Diego Aurélio Mesquita 501d05c5d1 new feature: the ability to record and play back a series of keystrokes
Allow the user to record and run a single macro.  The default binding
for starting and stopping the recording is M-: (Alt + colon) and for
running the macro M-; (Alt + semicolon).

This fulfills https://savannah.gnu.org/bugs/?50314.
Requested-by: Peter Passchier <peter@passchier.net>

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-10-15 20:40:40 +02:00
Benno Schulenberg ca8317e820 tweaks: reduce a bit of code duplication
This also removes a call of ungetch(), as it does not seem to be
needed any more: nano does not lose a character when waking from
suspension.
2017-10-04 21:51:47 +02:00
Benno Schulenberg 1bd17c44b0 display: keep the cursor switched on when resizing the screen
This fixes https://savannah.gnu.org/bugs/?52149.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-10-04 21:38:46 +02:00
Benno Schulenberg c8a2f36e87 input: recognize Option+Arrow keys on iTerm2 in "xterm mode"
Inspired-by: Mike Frysinger <vapier@gentoo.org>

This kind of addresses https://savannah.gnu.org/bugs/?51685.
2017-09-26 21:44:01 +02:00
Benno Schulenberg f2f7498f12 tweaks: rename two variables, for contrast, and frob some comments 2017-09-26 20:54:04 +02:00
Benno Schulenberg 762f997244 tweaks: elide two variables by using a pointer instead of an index 2017-09-26 20:39:58 +02:00
David Lawrence Ramsey 504a97256b softwrap: break before multi-column Unicode blanks when they overshoot
In atblanks mode, if a softwrapped chunk ends with a double-width space
character (say, Unicode 003000, Ideographic Space), and that would put
half of the character past the edge of the screen, break before it.

This fixes https://savannah.gnu.org/bugs/?51671.
2017-09-26 19:56:48 +02:00
Benno Schulenberg 7c3c3cbb3b tweaks: discard some obsolete debugging stuff 2017-09-22 21:59:51 +02:00
Benno Schulenberg c74d2632bb tweaks: make the switching on and off of the cursor a bit more compact 2017-09-22 21:31:01 +02:00
Benno Schulenberg ae34825f58 display: rework the switching on and off of the cursor
The basic idea is that the cursor is always off, except when it needs
to be on: when waiting for text input, and in a few other cases: when
something was searched and found in the help viewer, and in the file
browser when option -g is in effect.

This fixes https://savannah.gnu.org/bugs/?51923.
Reported-by: Mike Frysinger <vapier@gentoo.org>
2017-09-20 21:35:25 +02:00
Benno Schulenberg 153dea1732 tweaks: discard another set of useless asserts 2017-09-13 19:34:45 +02:00
Benno Schulenberg bb8d65e89c tweaks: reshuffle some code, and rename a variable 2017-09-13 19:34:28 +02:00
Benno Schulenberg f9bf320fd5 titlebar: don't show nano's name and version when in the file browser 2017-09-13 19:34:14 +02:00
Benno Schulenberg 9738c7997b titlebar: drop the prefix "File: " from before the filename 2017-09-13 19:30:07 +02:00
Benno Schulenberg cbf4f77d6b titlebar: don't reshow version when dropping back to a single buffer
When multiple files were open and [x/n] was being shown in the title
bar, don't show nano's name and version number when just one buffer
remains open, but show [1/1] instead.  It is less surprising.
2017-09-13 19:29:56 +02:00
Marco Diego Aurélio Mesquita 3fc89e0853 new feature: show current and total number of open buffers in title bar
When multiple buffers are open, replace nano's name and version number
with an indication how many buffers are open preceded by the sequence
number of the current buffer.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-09-13 19:29:38 +02:00
Benno Schulenberg ae25e15d61 startup: don't produce more than three consecutive beeps
This fixes https://savannah.gnu.org/bugs/?51918.
2017-09-02 15:31:02 +02:00
Benno Schulenberg 21ffa883f7 tweaks: use mnemonic constants instead of TRUE and FALSE
And use these constants in another context too.
2017-08-31 22:14:06 +02:00
David Lawrence Ramsey 59451da3ac softwrap: correctly move vertically through overwide tabs
Don't skip rows that contain something when moving up, and do put
the cursor in the desired column whenever possible when moving down.

This fixes http://savannah.gnu.org/bugs/?51827
and fixes http://savannah.gnu.org/bugs/?51828.
2017-08-26 10:14:01 +02:00
Benno Schulenberg 243380c4a2 mouse: one click of the wheel should move three lines, not three pages
This fixes https://savannah.gnu.org/bugs/?51802.
2017-08-20 20:45:56 +02:00
David Lawrence Ramsey 5fcda555ea display: constrain line numbers on softwrapped lines with sprawling tabs
Check the column number, not the character index, when suppressing the
line number on chunks other than the first, since the index can be zero
when in fact we're on a later chunk.

This fixes https://savannah.gnu.org/bugs/index.php?51790.
2017-08-19 20:50:01 +02:00
Benno Schulenberg 86e71fa09d tweaks: specify more directly in what manner to move the viewport 2017-08-18 21:46:55 +02:00
David Lawrence Ramsey e09dbf18b1 display: do show the visible character for a tab when it starts a row
Regardless of whether the row start is at a multiple of the tab size.

This completes the fix for https://savannah.gnu.org/bugs/?51669.
2017-08-17 20:09:50 +02:00
David Lawrence Ramsey f08d169aa1 softwrap: make sure char_len is set when a tab is wider than a chunk
This fixes https://savannah.gnu.org/bugs/?51770,
and fixes https://savannah.gnu.org/bugs/?51768.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-17 19:39:51 +02:00
Benno Schulenberg cf14ee2ef3 moving: the current chunk is always 0 when not in softwrap mode
This is a partial fix for https://savannah.gnu.org/bugs/?51770.
Analysis-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-17 19:33:43 +02:00
David Lawrence Ramsey 566a2daf12 tweaks: remove unneeded parentheses and blank line and braces 2017-08-14 21:46:25 +02:00
Benno Schulenberg 9f6c3a6269 display: don't doubly show tabs that cross a chunk boundary
This fixes https://savannah.gnu.org/bugs/?51669.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-14 21:31:55 +02:00
Benno Schulenberg 4562401505 bindings: hard-bind Alt+Up and Alt+Down to findprevious and findnext
So that these functions have bindings by default, and easy bindings.
Add them to the help viewer too, so that searching backward becomes
possible there.
2017-08-14 10:34:15 +02:00
Urja Rannikko 1cc030f7c1 bindings: hard-bind Alt+Left and Alt+Right to buffer switching
This also fixes https://savannah.gnu.org/bugs/?51735.
Reported-by: Urja Rannikko <urjaman@gmail.com>

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2017-08-14 10:06:29 +02:00
David Lawrence Ramsey 65d1655134 softwrap: don't push a straddling tab to the next chunk
Tabs are of variable length depending on position, so allow them
to be displayed partially on one chunk and partially on another.

This fixes http://savannah.gnu.org/bugs/?51621.
2017-08-13 21:06:23 +02:00
Benno Schulenberg ee3254b614 tweaks: simply set the proper scrolling mode, instead of imitating it 2017-08-10 12:28:39 +02:00
Benno Schulenberg 938aa63dfa tweaks: drop some debugging stuff 2017-08-08 22:09:22 +02:00
Benno Schulenberg 06ffcfaf40 display: catch all cases where the cursor can be pushed offscreen
Discarding (in commit 6f9bb53b) the cap on the number of chunks to
move backwards had as an unforeseen side effect that the screen can
fail to scroll when the cursor is somehow pushed offscreen.

Fix this by setting the target row (for smooth scrolling) always to
the bottom row of the edit window when nano notices that the cursor
has gone offscreen.

This fixes https://savannah.gnu.org/bugs/?51676.
Reported-by: David Lawrence Ramsey <pooka109@gmail.com>
2017-08-08 22:06:55 +02:00
Benno Schulenberg 11072ed587 tweaks: sort the includes, so it's a little easier to see what is there 2017-08-06 19:40:30 +02:00
David Lawrence Ramsey 1c1cbae6bc small addition: allow customizing the color of selected text
The new option 'set selectedcolor' applies to marked text, to the
currently selected file in the file browser, and to the highlighted
match during interactive search-and-replace.
2017-08-06 09:30:32 +02:00
Benno Schulenberg 80686bb525 tweaks: remove includes that appear to be superfluous
Without them, nano still compiles for me, with everything enabled,
even when using --enable-debug, --enable-utf8, and --with-slang.
2017-08-06 09:08:30 +02:00
David Lawrence Ramsey ac2c81fad1 tweaks: correct a comment typo and an indentation error 2017-07-31 21:42:39 +02:00
David Lawrence Ramsey 381a386b01 weeding: drop the forreal parameter from place_the_cursor()
Commit 28beb3f 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 8490f4a),
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.
2017-07-24 21:07:42 +02:00
David Lawrence Ramsey 6f9bb53b2d tweaks: set the target row for smooth scrolling more directly
The function place_the_cursor() assumes that the viewport is up to date,
i.e., that current is in range of edittop.  When uncutting or inserting,
however, place_the_cursor() gets called on the out-of-date viewport
first, and then a screen refresh is scheduled (which would put the
viewport up to date).  This is backwards: the refresh should come before
the cursor placement, and the only reason it works anyway is because the
cap on the number of chunks to move backward papers over the problem by
keeping current_y in screen range regardless.

Fix this properly by simply setting current_y to the bottom row of the
screen instead of calling place_the_cursor().  This value of current_y
is only ever used when in smooth scrolling mode and the insertion (or
paste) pushed the cursor offscreen.  In other situations, this value is
overridden when place_the_cursor() gets called after a screen refresh.

After that fix, the cap on the number of chunks to move backward is no
longer needed.
2017-07-23 12:16:59 +02:00
David Lawrence Ramsey ee8681d7cc tweaks: only compensate for a partially-offscreen line in softwrap mode
A line can only be partially offscreen when doing softwrapping.
2017-07-20 12:27:40 +02:00
Benno Schulenberg a1fba43452 pasting: restore the cap on the number of chunks to move backward
This fixes https://savannah.gnu.org/bugs/?51514.
2017-07-20 09:41:27 +02:00
Benno Schulenberg 0e4cbd4bfd softwrap: when possible, go back a whole bunch of chunks at a time
This improves https://savannah.gnu.org/bugs/?51479 for the +-1 case.
2017-07-19 09:47:56 +02:00
David Lawrence Ramsey ce68f81b2b softwrap: remove unneeded caps on the number of chunks to move 2017-07-19 09:45:22 +02:00
Benno Schulenberg 43a5c87682 suspension: prevent entering an invalid byte upon resume (with S-Lang)
For some reason, when returning from suspension, SLang will produce
either a clipped error code (0xFF instead of 0xFFFF, when returning
from an externally induced suspension), or it will clip the code of
first subsequent keystroke to a single byte (when returning from a
normal, in-editor suspension: ^Z).

Side-step this by ignoring the clipped error code, and by using an
undefined control code as the first fake keystroke.  Ignoring the
clipped error code is not possible when using a single-byte locale,
otherwise the user would not be able to type the character with
code 0xFF (although it could still be entered with Esc Esc 255).

This fixes https://savannah.gnu.org/bugs/?51477.
2017-07-16 13:55:59 +02:00
Benno Schulenberg 8b3213cadb tweaks: chuck some debugging stuff 2017-07-15 11:49:56 +02:00
David Lawrence Ramsey 4f3249de56 display: when converting tabs, don't go beyond the screen width
This fixes https://savannah.gnu.org/bugs/?51427.
2017-07-10 09:34:55 +02:00
Benno Schulenberg fbbf501f8f tweaks: rename four functions, to be more distinct 2017-07-09 21:07:38 +02:00
Benno Schulenberg 09723b07a8 tweaks: fix compilation with --enable-tiny 2017-07-07 13:07:10 +02:00
David Lawrence Ramsey dd667ce92c softwrap: don't flag EOL too early, nor break continuous text too early
This should eliminate all cases where the newline is pushed off the edge
of the screen in non-atblanks softwrap mode.  Also, it allows the use of
the last column of the screen in atblanks softwrap mode when a piece of
text does not contain any blanks.

This avoids the unreachable end-of-line reported on the mailing list:
http://lists.gnu.org/archive/html/nano-devel/2017-06/msg00011.html.
2017-07-07 13:07:10 +02:00
Benno Schulenberg 482fb352b8 tweaks: elide unneeded calls of get_last_chunk_leftedge()
And then elide the function entirely as it's called just once.
2017-07-07 13:07:10 +02:00
Benno Schulenberg 8766e7bdcb tweaks: reshuffle some things to condense the code 2017-07-07 13:07:10 +02:00
David Lawrence Ramsey bb4d0d548a new feature: allow lines to be softwrapped at whitespace
Extend get_softwrap_breakpoint() to break softwrapped lines on
whitespace when a flag is set.  This flag is controlled by the new
rcfile option "atblanks".  The '>' characters marking two-column
characters at the edge of the screen are disabled when it's on.

If get_softwrap_breakpoint() can't find whitespace in screen range, it
will break the line on the screen edge.  (In this case, a blank can be
on the last column of the screen, but text can't, so that a blank on the
last column doesn't become invisible and possibly break the display.)

This fulfills https://savannah.gnu.org/bugs/index.php?49959.
Requested-by: Nicholas Boel <axxisd@gmail.com>
2017-07-07 13:07:10 +02:00
David Lawrence Ramsey aa04ad4f83 replacing: make spotlight() account for varying chunk width
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().
2017-07-07 13:07:10 +02:00
David Lawrence Ramsey 4d7735c8f9 softwrap: in do_mouse(), keep the cursor before a softwrap breakpoint
Add the new function actual_last_column() to accomplish this.
2017-07-07 13:07:10 +02:00
David Lawrence Ramsey 8490f4acab softwrap: make the changes to actually allow the chunk width to vary
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.
2017-07-07 13:07:10 +02:00
David Lawrence Ramsey e375995d98 softwrap: add new functions for chunks of varying width
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.
2017-07-07 13:07:10 +02:00