Commit Graph

366 Commits (3d6dcb956804d3e9e5ed12597596478180c35afb)

Author SHA1 Message Date
Benno Schulenberg 30fc197b66 tweaks: adjust a couple of types, to reduce the number of warnings
This avoids eleven warnings of the kind "comparison between signed
and unsigned integer expressions [-Wsign-compare]".
2018-03-22 19:33:22 +01:00
Benno Schulenberg 8b8c6bb818 tweaks: factor out the check for 'viewok' into its own function
And also prevent a theoretical crash for restricted prompt functions.
2018-03-20 20:10:08 +01:00
David Lawrence Ramsey 7b1f3f4fe7 tweaks: correct several parameter types
This avoids a bunch of warnings when compiled with -pedantic:

	ISO C forbids comparison of ‘void *’ with function pointer
2018-03-18 20:01:25 +01:00
Benno Schulenberg 5eccaa7633 tweaks: refactor the implanting of a key expansion 2018-02-27 13:34:32 +01:00
Benno Schulenberg d9ac785a07 input: handle the implant() function separately also for the prompt
To prevent getting kicked out of it.

This fixes https://savannah.gnu.org/bugs/?53234.
2018-02-27 13:20:27 +01:00
Benno Schulenberg 53a10ddcaf tweaks: elide an unneeded variable
A shortcut's function must be among the existing ones, otherwise
nano's code is fundamentally broken.
2018-02-24 20:47:17 +01:00
Benno Schulenberg 65bf04060b tweaks: remove another superfluous check
Commit bb667beb removed do_gotolinecolumn_void() from the MWHEREIS
menu (replacing it with the empty flip_goto() function), so there
is no longer any need to check for this one special case.
2018-02-24 20:47:01 +01:00
Benno Schulenberg a95fb64dd6 tweaks: remove a superfluous check
A shortcut's function can never be NULL.
2018-02-24 19:53:19 +01:00
Benno Schulenberg b235404ade tweaks: elide an unused variable and parameter
It is only ever set and never referenced.
2018-02-24 19:42:43 +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 e55227f65f tweaks: unabbreviate two variable names 2018-02-24 18:20:30 +01:00
Benno Schulenberg b77b54bf73 tweaks: elide two unneeded booleans 2018-02-24 17:51:27 +01:00
Benno Schulenberg 2428620b16 prompt: disallow pasting when in restricted mode 2018-02-24 13:54:49 +01:00
Benno Schulenberg 5b870a7632 goto: avoid a segfault, by initializing 'answer' when it is NULL
This fixes https://savannah.gnu.org/bugs/?53157.
2018-02-14 19:40:30 +01:00
Benno Schulenberg 1635060ba6 tweaks: plug a memory leak when using Verbatim Input at a prompt
This fixes https://savannah.gnu.org/bugs/?53089.
2018-02-08 17:54:31 +01:00
Benno Schulenberg 9ceeabda38 memory: avoid a leak when toggling from Search to Goto
This fixes https://savannah.gnu.org/bugs/?53088.
2018-02-07 19:34:52 +01:00
Benno Schulenberg 6d111c9343 new feature: allow binding a key to a string (in a nanorc file)
In this way a single keystroke can produce a fragment of text or a
series of commands, or a mix of the two.  It is like a prerecorded
macro.

This fulfills https://savannah.gnu.org/bugs/?52931.
2018-02-04 12:44:12 +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 90ebff00ca tweaks: rename two variables, and swap their declaration order 2018-01-27 19:47:00 +01:00
Benno Schulenberg cdc9a29598 tweaks: move two functions to their proper place, orderingwise 2018-01-27 19:33:03 +01:00
Benno Schulenberg 97cbbb0cc8 prompt: show whitespace only in the filename, not in the whole line
That is, call display_string() just on the filename, not on the rest
of the prompt text.

This fixes https://savannah.gnu.org/bugs/?52967.
Reported-by: Andreas Schamanek <schamane@fam.tuwien.ac.at>
2018-01-26 09:37:18 +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 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 f6b6e6c3ff tweaks: reshuffle a bit of code and elide an unneeded variable 2017-11-11 21:10:49 +01:00
Benno Schulenberg 0c2b54a276 tweaks: rename a function plus two parameters, to be more fitting 2017-11-11 20:58:56 +01:00
Benno Schulenberg 7e6bb91593 tweaks: add a translator hint, and adjust two others 2017-11-07 19:39:00 +01:00
Benno Schulenberg 87da3ecbe0 tweaks: remove another bit of conditional compilation 2017-10-29 20:42:20 +01:00
Benno Schulenberg ff35a61355 tweaks: transform the token DISABLE_HISTORIES to ENABLE_HISTORIES 2017-10-29 19:43:05 +01:00
Benno Schulenberg 3f27c312c4 tweaks: get rid of some cluttering conditional compilation
In the tiny version, do_prompt() will now have an extra NULL
parameter, which will cost maybe twenty extra bytes of code.
That is acceptable when it saves thirty lines in the source.
2017-10-29 11:39:27 +01: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
David Lawrence Ramsey 5237a42d65 weeding: remove the unused be_clever parameter from do_home()/do_end() 2017-08-18 20:44:46 +02:00
Benno Schulenberg 52e2e52db3 tweaks: allow enough space for the Y/N/A characters [coverity scan] 2017-08-15 12:04:52 +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
Rishabh Dave 829a1a5050 new feature: allow pasting at all input prompts
Include the shortcut for 'Uncut' into most menus, and add an uncut
function for the status bar, so that it becomes possible to paste
the first line of the cutbuffer at any text-input prompt.

This fulfills https://savannah.gnu.org/bugs/?48501.
Requested-by: Benno Schulenberg <bensberg@telfort.nl>
Signed-off-by: Rishabh Dave <rishabhddave@gmail.com>
2017-07-29 13:48:22 +02:00
Benno Schulenberg 1e2d9a697a tweaks: rename a constant, to match the corresponding option 2017-07-14 16:14:02 +02:00
David Lawrence Ramsey 7c41c8641f tweaks: remove unneeded braces, and mark empty parameter list as void
This matches the style in the rest of the code.
2017-07-03 09:52:13 +02:00
Benno Schulenberg 7b23878b42 tweaks: do actual screen refreshes in a single call, when possible 2017-05-19 16:31:08 +02:00
Benno Schulenberg a05180ed2d tweaks: transform the token DISABLE_TABCOMP to ENABLE_TABCOMP 2017-05-09 11:31:54 +02:00
David Lawrence Ramsey 03c3e2b7c0 tweaks: fix several whitespace irregularities
Add missing spaces, remove excess spaces, and
replace groups of indentation spaces with tabs.
2017-05-07 18:20:01 +02:00
Benno Schulenberg 5033cfd81a tweaks: transform the token DISABLE_MOUSE to ENABLE_MOUSE
Also, trim some comments and avoid an unused-variable warning.
2017-05-01 20:53:07 +02:00
Benno Schulenberg ac9550d4c2 tweaks: remove two superfluous calls of wnoutrefresh()
The bottomwin has just been refreshed by update_the_statusbar(),
and it should not be the responsibility of the prompt routines
to keep the edit window up to date, as they don't write anything
there.
2017-05-01 17:14:20 +02:00
Rishabh Dave 90bd25c1bb new feature: add a search facility to the help viewer
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>
2017-04-25 17:20:34 +02:00
Benno Schulenberg 953fbf8efe tweaks: elide a function that is used just once
And in the bargain avoid a duplicate call of strlenpt(prompt).
2017-04-17 11:44:04 +02:00
Benno Schulenberg 754c62c5cc copyright: update the years, use ranges, and explain this usage
The interval 2013-2017 for the Free Software Foundation is valid
because in those years there were releases with changes by either
Chris or David, and the GNU maintainers guide advises to mention
a new year in all files of a package, not just in the ones that
actually changed, and be done with it for the rest of the year.
2017-04-09 12:09:23 +02:00
Benno Schulenberg aedc3ddd49 tweaks: replace a function call or a macro with a hard number
Verify at startup that the number is not too small.
2017-04-04 19:17:02 +02:00
Benno Schulenberg 53cea142e0 tweaks: use memory on the stack instead of calling malloc() and free()
Rename some variables in the process, and remove two cluttering asserts.
2017-04-04 19:14:14 +02:00
David Lawrence Ramsey d8189703b1 tweaks: prepare for improvements to do_home() and do_end()
These improvements will eventually make do_home() and do_end() take
parameters.  Since the global function lists can hold only functions
without parameters, preemptively add do_home_void() and do_end_void(),
and make the global function lists use them.
2017-03-22 10:44:04 +01:00
Benno Schulenberg d42f71a2ef tweaks: avoid a few needless reallocations
Most of these variables are freed moments later -- reallocating
them is thus a waste of time.
2017-03-20 13:07:57 +01:00
Benno Schulenberg fd0589d8bc tweaks: remove the cluttering conditional compilation of a parameter
The conditionalizing saved negligible amounts of space, of memory, and
of speed.
2017-01-03 14:11:45 +01:00
Benno Schulenberg 908663e8fc input: discard a verbatim 0x0A or 0x00 byte, depending on the mode
This disallows entering a verbatim ^J (0x0A) when typing text or
search terms, and disallows a verbatim ^@ (0x00) when typing a
filename.  Nano beeps when the disallowed code is attempted.

This addresses https://savannah.gnu.org/bugs/?49897.
2016-12-27 16:46:09 +01:00
Benno Schulenberg 1fb820386b tweaks: chuck a special case, and reduce the scope of two variables
A KEY_WINCH does not need to be separately treated since the basic
action for anything that is not recognized at the yes-no prompt is:
to continue.
2016-12-26 20:25:06 +01:00
Benno Schulenberg 9973366685 prompt: represent newlines as ^J instead of breaking the bar
Also at the yes-no prompt, a 0x0A byte should be displayed as a ^J
instead of splitting the prompt bar in two and spreading it over
two lines.

This fixes https://savannah.gnu.org/bugs/?49934.
2016-12-26 19:59:51 +01:00
Benno Schulenberg 8bf8682b17 binding: use the code for the Enter directly instead of a function call
And certainly don't return zero when the key wouldn't have been found,
because that would have meant jumping a word to the right.
2016-12-22 12:13:03 +01:00
Benno Schulenberg a9b5a0e029 tweaks: rename a function to something less abbrevy
Also, swap the logic around, to use less braces.
2016-12-22 12:04:10 +01:00
Benno Schulenberg 1144d38316 tweaks: don't bother reallocating a string of which there is only one
And which normally is just some ten or twenty characters long, and
never gets wildly overallocated.
2016-12-18 10:28:30 +01:00
Benno Schulenberg 86121cf3fc tweaks: move a cursor-on switch to a more logical place (again)
But do it correctly this time: don't switch it on when replacing.
2016-12-05 15:47:44 +01:00
Benno Schulenberg 379b1556ed prompt: remove two fragments of dead code
None of the prompts offer a total-refresh shortcut -- only the
edit window, the help viewer, and the file browser provide this.
2016-12-04 12:34:56 +01:00
Benno Schulenberg 656563beda screen: don't restore the previous menu after a yesno prompt
There is no need for that -- it just causes flicker.

This fixes https://savannah.gnu.org/bugs/?49742.
2016-12-01 15:54:56 +01:00
Benno Schulenberg 8f95f9b1aa tweaks: reshuffle three initializations and trim some comments 2016-12-01 15:28:59 +01:00
Benno Schulenberg c6512a9717 screen: don't request an update of the edit window for every yesno prompt
Only when doing replacements does the edit window need a refresh: for
every new spotlight.  So, do the update request in the latter routine.
2016-12-01 15:20:05 +01:00
Benno Schulenberg ac41587d4e oops: the yesno prompt for replacing does not want a visible cursor 2016-11-30 13:47:50 +01:00
Benno Schulenberg 72e8bcb027 tweaks: move a switching on of the cursor to a more logical place 2016-11-30 11:11:06 +01:00
Benno Schulenberg 2dffcf101f tweaks: fix compilation with --disable-histories 2016-08-30 11:14:19 +02:00
Benno Schulenberg c11c688420 tweaks: fix compilation with --enable-tiny again 2016-08-30 09:36:49 +02:00
Benno Schulenberg 514cd9a099 update the license text to the preferred version
Mentioning "GNU nano" instead of "This program" and referring to the
website instead of to a postal address.
2016-08-29 21:27:16 +02:00
Benno Schulenberg 406e5242a3 update the copyright notices 2016-08-29 21:27:05 +02:00
Benno Schulenberg 0242d84218 tweaks: make a call in one place instead of in four different ones
And remove a superfluous call.
2016-08-28 21:27:52 +02:00
Benno Schulenberg 7275e11c4f tweaks: adjust some comments and remove needless asserts 2016-08-28 18:17:10 +02:00
Benno Schulenberg 77d140728d tweaks: don't bother trimming the prompt again
The prompt has already been trimmed in do_prompt() to fit into the
available space.
2016-08-28 17:53:44 +02:00
Benno Schulenberg 4d2ada60f5 tweaks: don't bother avoiding unneeded rewrites of the promptbar
Leave the optimization of actual screen writes to ncurses.
2016-08-28 17:37:25 +02:00
Benno Schulenberg 6ad3700a3d prompt: mouse clicks that moved the cursor need no further processing
This fixes https://savannah.gnu.org/bugs/?48917.
2016-08-27 12:00:08 +02:00
Benno Schulenberg 4f156aa6db prompt: set up the prepared answer before allowing to change it
This fixes https://savannah.gnu.org/bugs/?48916.
2016-08-27 11:59:57 +02:00
Benno Schulenberg 6142ef87b5 prompt: use angular brackets as continuation mark, as Pico does
The $ sign looks too much like an S, and it "obscures" the answer by
being so "massive".  The < and > signs are lighter and work better.
2016-08-27 09:34:54 +02:00
Benno Schulenberg da2fce90bd tweaks: elide a variable and rename some others 2016-08-27 09:34:42 +02:00
Benno Schulenberg 1e3cffbbd6 prompt: show a trailing $ when the tail of the answer is offscreen
This fixes https://savannah.gnu.org/bugs/?48894.
2016-08-26 21:42:23 +02:00
Benno Schulenberg 92c97c70d4 prompt: leave always at least the last character of the answer visible
This fixes https://savannah.gnu.org/bugs/?48912.
2016-08-26 21:32:07 +02:00
Benno Schulenberg b77b1391c3 tweaks: improve some indentation and reshuffle a few lines 2016-08-26 12:24:18 +02:00
Benno Schulenberg 7e0c4e5726 tweaks: rename a function and adjust indentation 2016-08-25 20:20:50 +02:00
Benno Schulenberg 50616148b0 prompt: recompose the statusbar text whenever the window size changes
This fixes https://savannah.gnu.org/bugs/?48796.
2016-08-25 20:12:36 +02:00
Benno Schulenberg 2f9232a493 tweaks: adjust indentation after previous change 2016-08-25 11:45:38 +02:00
Benno Schulenberg 0d5fbfb91c tweaks: reshuffle some things, and remove a misplaced comment 2016-08-25 11:45:34 +02:00
Benno Schulenberg 56147434f3 prompt: don't crash when the terminal is less than four columns wide
This fixes https://savannah.gnu.org/bugs/?48792.
2016-08-25 11:45:13 +02:00
Benno Schulenberg c22cd03f18 prompt: work around a VTE bug by outdancing an ncurses optimization
This fixes https://savannah.gnu.org/bugs/?48852.
2016-08-25 10:46:28 +02:00
Benno Schulenberg bd1fcc5fe2 tweaks: correct one comment, and adjust another 2016-08-06 12:17:24 +02:00
Benno Schulenberg 90a90365a8 tweaks: rename three constants, for clarity, and hardcode two others 2016-08-01 12:56:05 +02:00
Benno Schulenberg 9cd30d4917 tweaks: don't bother setting meta_key to false when a key is invalid
That is a task for the key-getting routine.
2016-07-31 18:32:18 +02:00
Benno Schulenberg cb10b2b908 tweaks: elide the global variable 'func_key'
There is no need to specially flag a function key or editing key --
the keycode is indication enough in itself: outside of byte range.
2016-07-31 18:13:05 +02:00
Benno Schulenberg 4cff67fdde tweaks: adjust indentation after the previous change, and edit comments 2016-07-25 12:50:03 +02:00
Benno Schulenberg aefe26d216 tweaks: factor out a common condition 2016-07-25 12:31:40 +02:00
Benno Schulenberg 8eb99e2a1d tweaks: put similar things together 2016-07-25 12:18:40 +02:00
Benno Schulenberg 960e848cc7 tweaks: elide a typedef, as it now has just one element 2016-07-12 09:35:48 +02:00
Benno Schulenberg 8507dd4bd0 color: integrate the hilite attribute into the pair number
Color-pair numbers and attributes can be OR'd together -- do so,
to save an attron() call whenever the hilite is on.
2016-07-12 09:20:09 +02:00
Benno Schulenberg 528b79b5f3 tweaks: rename a variable to be more accurate
When we get a ^J as verbatim input, it is not possible to include it
into the file buffer or the prompt answer, because this would mean
adding an encoded null to the buffer or answer, and that is not what
the user intended.  One option would have been to simply ignore a ^J
in verbatim input.  But the choice has been made to act the same way
as when the ^J (0x0A) is found in the file data: start a new line.

That is the same response as to the Enter key, yes -- but the code
for the Enter key is ^M (0x0D), not ^J.  So, to be more precise,
rename the relevant variable from 'got_enter' to 'got_newline'.
2016-07-03 16:19:27 +02:00
Benno Schulenberg 9106cc8ecc main: let the main loop restore the main menu, if needed
Don't make it the responsibility of the executed functions to restore
the list of shortcuts of the edit window.  Just detect whether another
menu was displayed, and if so, redisplay the main menu.
2016-06-21 11:03:38 +02:00
Benno Schulenberg 17cf833b9c tweaks: normalize some whitespace 2016-05-30 09:09:36 +02:00
Benno Schulenberg 1d3d30776a tweaks: more consistently use * instead of [0] when checking for '\0' 2016-05-27 21:31:55 +02:00
Benno Schulenberg 30f3c53305 tabbing: refresh the window also when Goto-Dir in browser was cancelled
This restores things to the way they were before commit 36ec76a.
Apparently all those refreshes are needed in some cases after all.
2016-04-26 17:55:56 +02:00
Benno Schulenberg 41ed690791 tabbing: refresh the edit window in case a previous tab listed names
Commit 36ec76a made the wrong change: after a tab that did not list any
file names on the screen, a refresh /is/ needed, because a previous tab
might have listed things on the screen.  But at the end of the prompt,
it is not necessary to refresh the edit window if things were listed,
because the window will be refreshed anyway after reading in a file.
2016-04-23 15:46:31 +02:00
Benno Schulenberg 36ec76a508 tabbing: don't refresh the edit window when nothing was printed on it
This is a remnant from 2001, when things were different.  Now, there
is no need to refresh the edit window when tabbing produced no list.
When it did produce a list, it is cleared off later.
2016-04-17 18:12:53 +02:00
Benno Schulenberg 34a20f8839 prompt: properly save and restore the x position in the statusbar
This fixes https://savannah.gnu.org/bugs/?47720.
2016-04-17 15:24:05 +02:00
Benno Schulenberg d92eb4fee3 all: eradicate SVN's $Id$ tags 2016-04-05 14:59:12 +02:00
Benno Schulenberg 532d73ccc7 Renaming a variable to better indicate booleanness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5779 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-03-30 12:27:06 +00:00
Benno Schulenberg 8a2dd978f8 Renaming a variable, for contrast and correctness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5670 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-23 08:31:57 +00:00
Benno Schulenberg 27e1e83e8c As the charmove() already copies the terminating null byte,
there is no need to put one in.  Just trim the allocation.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5666 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 16:51:39 +00:00
Benno Schulenberg 3ed08c568f Eliding a variable -- there is no need to optimize for calls of strlen(),
as this is typing speed, no need to hurry.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5663 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 14:26:05 +00:00
Benno Schulenberg 7c0e433305 Not moving too many bytes -- that is: not moving them beyond the
allocated buffer.  This fixes Savannah bug #47219.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5662 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-22 13:17:53 +00:00
Benno Schulenberg acf19bde22 Reducing an allocation to what is actually needed.
This undoes the papering-over of the just-fixed bug.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5655 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-20 16:35:09 +00:00
Benno Schulenberg e86dc0381c Avoiding a memory leak when tabbing on a string that doesn't occur in the
history.  This fixes Savannah bug #47124 reported by Mike Frysinger.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5653 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-20 12:16:43 +00:00
Benno Schulenberg e540053eb3 Renaming and condensing some stuff, and correcting the main comment,
because 'allow_cntrls == FALSE' meant that controls were being filtered.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5644 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 12:03:47 +00:00
Benno Schulenberg ef16a2a250 Doing the copying of typed stuff from input to output just once.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5643 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-14 11:16:54 +00:00
Benno Schulenberg 568d2a389c Switching the cursor on and off at the appropriate moments (that is: when
needed), so that it no longer shows in the help screen nor in the file list.
This fixes Savannah bug #47126.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5640 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-13 19:41:12 +00:00
Benno Schulenberg e853c1ee7c Renaming a variable for clarity.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5620 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:41:46 +00:00
Benno Schulenberg e5fee7e649 Normalizing a bit of indentation.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5619 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-07 13:37:16 +00:00
Benno Schulenberg 22a01cad9e Rewrapping some lines and removing some useless comments.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5614 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 12:12:08 +00:00
Benno Schulenberg 8585bf2dd4 Avoiding to update the statusbar twice for a Backspace.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5613 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 11:50:57 +00:00
Benno Schulenberg 2cfa96bde9 Renaming 'update_bar_if_needed()' for more contrast and aptness.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5612 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 11:44:33 +00:00
Benno Schulenberg d844f05a1e Chopping two parameters that are always the same, and that are
global variables anyway.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5611 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-02-06 11:40:15 +00:00
Benno Schulenberg 7ade5deabe Making Home go always fully home.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5604 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-31 13:26:15 +00:00
Benno Schulenberg a93a11eb42 Using a simpler algorithm for jumping to the next word.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5595 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-26 10:31:16 +00:00
Benno Schulenberg 5688c160a9 Jumping to the start of the current word, not to that of the preceding one.
This fixes Savannah bug #46970.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5594 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-26 10:10:20 +00:00
Benno Schulenberg 65c7c810bc Adjusting some indentation and some line wrapping.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5593 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-26 09:16:09 +00:00
Benno Schulenberg 87460b5998 Eliding another small function that is used only once.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5588 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-24 21:02:09 +00:00
Benno Schulenberg decee32067 Eliding an unneeded function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5587 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-24 20:44:39 +00:00
Benno Schulenberg f01dd29f48 Bundling four statements (that in total occur seven times)
into a separate function.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5586 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-24 20:36:02 +00:00
Benno Schulenberg 53c8ada24b Removing a superfluous free.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5585 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-24 16:04:25 +00:00
Benno Schulenberg eed1aab3f0 Chopping an always-FALSE parameter and deleting an unused return value.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5584 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-24 15:42:45 +00:00
Benno Schulenberg a443760d80 Eliding an unneeded variable.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5578 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-21 18:29:39 +00:00
Benno Schulenberg 7a1709f03b Removing a now unneeded function, as nothing can break out of do_prompt()
any more, not a SIGWINCH either.  And deleting an always-FALSE 'if'.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5577 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-21 18:23:17 +00:00
Benno Schulenberg aa7edb7fc2 Preserving the cursor position on the statusbar when just toggling
a setting or making an excursion to the file browser.
This fixes Savannah bug #46945.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5576 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-21 17:29:37 +00:00
Benno Schulenberg 34fbb1f4de Adjusting a few comments and rewrapping some lines.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5556 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-13 20:32:40 +00:00
Benno Schulenberg dd29c56993 Rewriting the loop, and constifying the input of sctofunc().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5530 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2016-01-04 09:52:43 +00:00
Benno Schulenberg bde996db67 Discarding a now useless function.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5403 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-11-11 19:56:35 +00:00
Benno Schulenberg c32a58a826 Not checking for non-NULL before freeing a variable, as it's unnecessary.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5249 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-06-14 19:14:41 +00:00
Benno Schulenberg 40bfc729ca Preventing a floating-point exception when the available length
for an answer becomes zero.  The answer will instead wrap to the
next line, which does not look nice but is better than crashing.
Patch by Mahyar Abbaspour.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5235 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-05-31 08:45:17 +00:00
Benno Schulenberg 2661d6d397 Using 'width' instead of hardcoded 16. And doing things in the same order
for all three cases: setting the string and then positioning the cursor.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5230 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-05-28 13:51:03 +00:00
Benno Schulenberg 59187b8051 Normalizing the whitespace after the recent changes in logic.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5229 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-05-28 13:28:37 +00:00
Benno Schulenberg 75d64e677e Handling a SIGWINCH (which signals a change in window size) not when it
happens but only when checking for keyboard input.  It now reports the
SIGWINCH via a special key value to the calling routine, to allow not
only the main editor but also the help viewer and the file browser to
adapt their display to the new size.
Patch by Mahyar Abbaspour, somewhat edited by Benno.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5228 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-05-28 13:02:29 +00:00
Benno Schulenberg ec0e0235fa Renaming a function to the simpler 'need_statusbar_update()'
as there is no vertical counterpart.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-20 08:35:41 +00:00
Benno Schulenberg d8b6dbfffe Letting bottombars() set the global variable 'currmenu'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2015-04-07 14:16:07 +00:00
Benno Schulenberg cf9f32b009 Reordering a few things, and adjusting some whitespace.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5086 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-31 20:49:32 +00:00
Benno Schulenberg 266e0496ab Using the more direct func_from_key() wrapper instead of get_shortcut().
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5082 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-27 19:32:03 +00:00
Benno Schulenberg 3933a30c9e Adding a typedef for a pointer to a function: functionptrtype.
And starting to use this to make the code a bit cleaner.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5050 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-02 08:47:09 +00:00
Benno Schulenberg ebcc68f51d Grouping the arguments better.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5046 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 11:50:35 +00:00
Benno Schulenberg 645841fd25 Not passing the menu but setting it earlier.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5045 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 11:42:28 +00:00
Benno Schulenberg 49816fed70 Now that 'currmenu' is really global, stop passing it around.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5043 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-07-01 10:41:10 +00:00
Benno Schulenberg 7e5324d164 Making 'meta_key' and 'func_key' into global variables, instead of
having them declared everywhere and passing them around endlessly.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5039 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-30 18:04:33 +00:00
Benno Schulenberg d4623f3ca3 Eradicating the execute flag -- it is almost always TRUE, and when it's FALSE
then it's for a function that is an empty placeholder, so executing it will
not do anything anyway.  Handling the one exception (do_gotolinecolumn_void)
specially, just like the other one (do_cancel) already is.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5029 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
2014-06-28 14:42:18 +00:00