David Lawrence Ramsey
bc6787826a
speller: make replace_marked_buffer() use the cutting functions directly
2018-08-07 20:38:50 +02:00
David Lawrence Ramsey
b5f15cb574
speller: make replace_buffer() use the cutting functions directly
2018-08-07 20:38:21 +02:00
Benno Schulenberg
f82eefa303
tweaks: exclude the file-prepending code from the tiny version
...
The prepending and appending toggles are not available in tiny nano,
so there is no need to have the code either.
2018-07-24 19:31:03 +02:00
Benno Schulenberg
c46696d40c
tweaks: delete some old debugging code that no longer seems useful
2018-07-18 19:53:44 +02:00
Benno Schulenberg
75c7c35cfd
tweaks: use a shorter message, because when the screen is small...
2018-07-14 19:42:38 +02:00
Benno Schulenberg
d92142c66a
easter: show the crawl only when there is room enough for the lines
...
The crawl needs at least five rows to be perceived as a crawl, and
the widest line is 31 characters (ignoring translations, which might
be even longer). Formerly, when only two or three rows were available,
nothing was shown at all, which was puzzling. So, better do the credits
only when there is room enough for them, and print a message otherwise.
2018-07-13 19:45:15 +02:00
Benno Schulenberg
f598a4f12d
files: add the file format on the status bar when switching buffers
...
Suggested-by: Brand Huntsman <alpha@qzx.com >
2018-07-13 11:15:48 +02:00
Benno Schulenberg
063a8b0870
startup: show the correct number of lines when opening multiple files
...
When switching to a different buffer, don't just show its name but
also the number of lines it contains. This is useful extra info.
Then use this same message when at startup multiple files are opened
and (after reading them all) we switch back to the first buffer.
(This loses, when multiple files are opened, the information about
format conversion that nano still shows when a single file is opened,
but... this bug has shown that people don't really look at this line
anyway, so... let it be. The info can still be seen when writing out
the file with ^O.)
This addresses https://savannah.gnu.org/bugs/?54047 .
2018-07-13 09:37:04 +02:00
Devin Hussey
b2ff574678
files: speed up reading by using getc_unlocked() instead of getc()
...
Unlike glibc, which in getc() locks the file only when it is needed,
FreeBSD and Bionic libc will always lock the file, causing a massive
slowdown, as the system has to create and destroy a mutex each time
getc() is called.
Avoid that massive overhead by locking the file before starting to read
and unlocking it after reading is complete, and using getc_unlocked() to
read each byte. This makes reading on FreeBSD/macOS and Android anywhere
from 2 to 6 times faster, and on glibc roughly seventy percent faster.
This partially addresses https://savannah.gnu.org/bugs/?50406 .
Signed-off-by: Devin Hussey <husseydevin@gmail.com >
2018-07-12 12:44:35 +02:00
Benno Schulenberg
0c455155ad
prompt: concentrate manipulations of 'statusbar_x' into a single file
2018-07-11 10:45:58 +02:00
Benno Schulenberg
2e1e157967
copyright: update the years for significantly changed files
2018-06-01 10:18:32 +02:00
Benno Schulenberg
0f2b0ffbd3
tweaks: reshuffle a condition, and adjust a comment and some indentation
2018-05-31 16:27:13 +02:00
Benno Schulenberg
f2f901c895
files: give feedback during writeout also when prepending or appending
...
The only time that feedback about the number of lines written is *not*
wanted is when writing a temporary file.
This fixes https://savannah.gnu.org/bugs/?54025 .
2018-05-31 16:08:16 +02:00
Benno Schulenberg
408d9b8708
build: fix compilation failure when configured with --enable-tiny
2018-05-23 11:57:55 +02:00
Marco Diego Aurélio Mesquita
f304b9aee1
new feature: allow piping (selected) text to an external command
...
When executing a command, it is now possible to pipe the entire buffer
(or the marked region, if anything is marked) to the external command.
The output from the command replaces the buffer (or the marked region),
or goes to a new buffer.
This fulfills https://savannah.gnu.org/bugs/?28993 ,
and fulfills https://savannah.gnu.org/bugs/?53041 .
Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com >
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl >
2018-05-22 19:36:21 +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
b7f8d4819b
tweaks: frob some comments plus miscellaneous other stuff
2018-03-22 19:54:20 +01:00
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
b9de5525c4
tweaks: elide a parameter, as it's always the inverse of another
2018-03-22 12:52:28 +01:00
Benno Schulenberg
dd157f1494
tweaks: change a parameter of open_buffer() and invert its logic
2018-03-22 12:35:50 +01:00
Benno Schulenberg
624918800b
tweaks: bundle some settings for a new buffer
2018-03-22 12:27:04 +01:00
Benno Schulenberg
a1132c81a1
files: prevent the undo of reading a file into a new buffer
...
When the file has just been read, it is in the state that it has
on disk, so there is nothing to undo.
This fixes https://savannah.gnu.org/bugs/?53387 .
2018-03-20 11:14:55 +01:00
Benno Schulenberg
d3012be095
tweaks: don't call strcmp() to determine whether a string is empty
2018-03-06 11:59: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
3981217e5a
startup: allow a named pipe as file argument when --noread is used
...
This fixes https://savannah.gnu.org/bugs/?52896 .
Reported-by: Miki Strange <mik@mikistrange.com >
Tested-by: Miki Strange <mik@mikistrange.com >
2018-01-16 21:43:16 +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
eac90c3eff
prompt: blank the bar when a "continue?" is answered with No or ^C
...
This fixes https://savannah.gnu.org/bugs/?52755 .
Reported-by: Brand Huntsman <alpha@qzx.com >
2017-12-29 17:01:15 +01:00
Benno Schulenberg
dc3618a127
text: set and reset the Modified state correctly when undoing/redoing
...
Unset the "Modified" marker only at the point where the file was last
saved -- if there is such a point, because it can be missing when the
undo stack was discarded.
This fixes https://savannah.gnu.org/bugs/?52689 .
Reported-by: Liu Hao <lh_mouse@126.com >
Original-idea-by: Brand Huntsman <alpha@qzx.com >
2017-12-19 19:22:52 +01:00
Benno Schulenberg
31fe0753e3
tweaks: limit the resetting of "Modified" to writing a full buffer
...
When doing that, there is no need to save and restore the Modified
state when writing a marked region.
2017-12-19 17:57:49 +01:00
Benno Schulenberg
0c40f87b55
tweaks: invert the logic of a variable, and rename it
...
To get rid of two double negatives.
2017-12-03 20:49:01 +01:00
Benno Schulenberg
20aa167c14
files: always update the stat info when the entire file is written
...
This fixes https://savannah.gnu.org/bugs/?52519 .
2017-11-26 20:57:30 +01:00
Benno Schulenberg
0c9905dbd0
undo: clear the Modified state when the very first edit is undone
...
This also means that no question needs to be asked when exiting.
This fixes https://savannah.gnu.org/bugs/?52504 .
Reported-by: Peter Passchier <peter@passchier.net >
2017-11-26 19:55:44 +01:00
Benno Schulenberg
cf63a2910a
files: save the marked region only when we've prompted for a file name
...
Otherwise we would overwrite the current file with just the selection.
This fixes https://savannah.gnu.org/bugs/?52482 .
2017-11-22 20:56:37 +01:00
Benno Schulenberg
7c3c942097
tweaks: adjust indentation after previous change
2017-11-22 19:43:50 +01:00
Benno Schulenberg
77d24300f3
tweaks: reshuffle a couple of lines, and frob a comment or two
2017-11-22 19:36:33 +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
8165b20fc1
build: fix compilation with --disable-browser --disable-tabcomp
...
While doing that, move the affected function to the utils.c file
and tweak it a bit.
This fixes https://savannah.gnu.org/bugs/?52468 .
2017-11-20 19:37:08 +01:00
Benno Schulenberg
f6e83438da
tweaks: elide a comment, and improve a couple of others
2017-11-13 19:58:29 +01:00
David Lawrence Ramsey
169da09424
files: don't change file format when inserting into an existing buffer
...
This fixes https://savannah.gnu.org/bugs/?52392 .
2017-11-13 19:42:44 +01:00
Benno Schulenberg
5198c1f139
tweaks: frob a couple of comments
2017-11-12 20:08:28 +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
a7f5907b43
tweaks: move a general function to the utils.c file
2017-11-11 11:34:39 +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
2a4fc9591f
tweaks: transform the token DISABLE_SPELLER to ENABLE_SPELLER
2017-10-31 19:32:42 +01:00
Benno Schulenberg
028d12f4fb
tweaks: transform the token DISABLE_OPERATINGDIR to ENABLE_OPERATINGDIR
2017-10-29 21:08:07 +01:00