-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeLog.2007-2015
4010 lines (3397 loc) · 201 KB
/
ChangeLog.2007-2015
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[Development moved to git on April 1. The Changelog was discontinued.]
2016-03-31 Benno Schulenberg <[email protected]>
* src/text.c (do_int_spell_fix): Replace a fake 'while', delete a
redundant 'if', rename a variable, and adjust whitespace.
2016-03-30 Benno Schulenberg <[email protected]>
* src/search.c (do_replace_loop, go_looking, findnextstr): Report
"Cancelled" instead of "Not found" when the user aborts a replace
that is taking too long. This fixes Savannah bug #47439.
* src/winio.c (do_replace_highlight): Rename this to 'spotlight',
for clarity, and for contrast with 'do_replace/do_replace_loop'.
* src/winio.c (spotlight): Rename a variable for clarity.
* src/files.c (input_tab), src/prompt.c (get_prompt_string):
Rename a variable to better indicate booleanness.
* src/text.c (do_int_speller): Unwrap a few lines.
2016-03-29 Benno Schulenberg <[email protected]>
* src/nano.c (main), src/text.c (do_justify, do_verbatim_input),
src/winio.c (parse_escape_sequence): Place the cursor in the edit
window also when --constantshow is in effect, after a ^J Justify or
an invalid escape sequence, and when entering a verbatim keystroke.
Leave the cursor off during Unicode input, for extra feedback.
* src/browser.c (do_browser): Improve the wording of a message.
* src/chars.c (is_valid_unicode): Speed up Unicode validation.
* src/text.c (do_int_spell_fix): Allow to stop replacing a word
without aborting the entire spell-fixing session.
* src/search.c (do_replace_loop): Chop a now-unused parameter.
2016-03-28 Benno Schulenberg <[email protected]>
* src/winio.c (statusbar): Don't bother putting back the cursor in
the edit window, as it is off anyway, and will be placed back in the
main loop. This prevents a segfault when trying to open a directory.
* src/search.c (findnextstr): Provide feedback when searching takes
longer than roughly half a second (on average).
* src/*.c: Remove the 'last_replace' variable that is never used.
* src/winio.c (parse_kbinput): Delete a no-op.
2016-03-23 Benno Schulenberg <[email protected]>
* src/search.c (findnextstr): Prevent the internal spell checker from
finding the first occurrence twice. And delete the piece of dead code
that was meant to do this. This fixes Savannah bug #47188.
* src/search.c (findnextstr): Clean up and rename a variable.
* src/search.c (findnextstr): Poll the keyboard once per second.
* src/winio.c (reset_cursor): Remove a pointless condition, and make
use of an existing intermediary variable.
* src/winio.c (reset_cursor): Tidy up and rename a variable.
* src/winio.c (onekey): Elide an unneeded 'if' and unneeded variable.
2016-03-22 Thomas Rosenau <[email protected]>
* configure.ac, src/*.c: Check for the existence of the REG_ENHANCED
regex flag, and use it when it's available (on OS X systems). This
completes the fix for Savannah bug #47325.
2016-03-21 Benno Schulenberg <[email protected]>
* src/browser.c (findnextfile): Trim a duplicate variable.
* src/browser.c (browser_refresh, findnextfile): Rename four vars.
2016-03-20 Benno Schulenberg <[email protected]>
* src/files.c (do_writeout), src/nano.c (do_exit): Normalize the
punctuation in some prompts: no space before a question mark, and
a semicolon instead of a comma between phrases.
* src/text.c (do_cutword): Don't put cut words into the cutbuffer --
that is: treat the deletion of words like pressing Backspace/Delete.
* src/search.c (get_history_completion, find_history): Cycle through
the items from newest to oldest. This fixes Savannah bug #47205.
* src/files.c (do_writeout): When the name of the file was changed,
always ask whether this is okay. This fixes Savannah bug #46894.
* src/search.c (do_research): Use 'return' instead of 'else'.
* src/search.c (do_search): Don't bother setting 'answer'; just use
'last_search', which has been set to 'answer' in search_init().
* src/search.c (go_looking): Factor out the common part of
do_search() and do_research() into this new function.
2016-03-19 Benno Schulenberg <[email protected]>
* src/search.c (search_init): Always remember the last typed string,
also when it's an invalid regex. This fixes Savannah bug #47440.
* src/search.c (search_init, do_replace): Don't bother setting the
current answer to the empty string, as do_prompt() can handle a NULL.
* src/browser.c (do_browser): Delete a snippet of dead code.
* src/browser.c (do_browser): Delete an unneeded variable.
* src/search.c (do_gotolinecolumn): Delete another unneeded variable.
* src/search.c (search_init): Snip an always-FALSE condition.
* src/search.c (search_init): Reshuffle stuff to reduce indentation.
* src/search.c (do_replace): Snip a useless setting of answer.
2016-03-17 Benno Schulenberg <[email protected]>
* src/search.c (do_research): Use the Search key bindings also during
a Re-search, to enable cancelling. This fixes Savannah bug #47159.
* src/search.c (do_replace): Remove two redundant returns.
* src/search.c (findnextstr): Prune two #ifdefs.
* src/search.c: Adjust some indentation.
2016-03-14 Benno Schulenberg <[email protected]>
* src/color.c (color_update): Don't dereference a possible NULL.
* src/rcfile.c (parse_colors): Make error message equal to others.
* src/rcfile.c (parse_rcfile): Rearrange some things to reduce the
indentation level by four steps, so we can unwrap a dozen lines.
2016-03-13 Benno Schulenberg <[email protected]>
* src/search.c (regexp_init): Allow using the word boundary markers
\< and \> in search strings on non-GNU systems. This is a partial
fix for Savannah bug #47325 reported by Thomas Rosenau.
* src/rcfile.c (parse_rcfile, parse_colors, nregcomp): Combine the
regular-expression flags at compile time instead of at run time.
* src/rcfile.c (parse_syntax, parse_colors): Rename a variable.
* src/winio.c (edit_draw): Give a central variable a ringing name.
2016-03-13 Thomas Rosenau <[email protected]> (tiny change)
* autogen.sh, README.SVN: Mention SVN instead of CVS.
2016-03-12 Benno Schulenberg <[email protected]>
* src/color.c (color_update): Set the syntax and regex pointers
just once, in a single place. And unnest two 'if's.
* src/rcfile.c (parse_one_include, parse_includes): New names for
these functions, to be more distinguishable.
* src/rcfile.c (parse_colors): Reduce the indentation.
* src/rcfile.c (parse_colors): Rename a variable.
* src/rcfile.c (parse_colors, parse_rcfile): Refind the tail of
the colors list only when extending, not for every added color.
2016-03-11 Benno Schulenberg <[email protected]>
* src/browser.c (do_browser): Fix compilation when configured with
--enable-tiny plus --enable-browser.
* src/rcfile.c: Tweak some comments and reshuffle some lines.
* src/rcfile.c (color_to_short): Elide a variable.
* src/rcfile.c (grab_and_store): First check that there is an
open syntax before checking that it is named "default".
* src/rcfile.c (parse_rcfile): Fix compilation when configured with
--enable-tiny plus --enable-nanorc.
2016-03-10 Benno Schulenberg <[email protected]>
* src/rcfile.c (grab_and_store): Do not accept 'header' and 'magic'
commands for the default syntax. This fixes Savannah bug #47323.
* src/rcfile.c (pick_up_name): Fold the parsing of a linter and
formatter command into a single routine.
* src/rcfile.c (parse_header_exp, parse_magic_exp, grab_and_store):
Elide the first two functions, and reshuffle parameters in the last.
* src/rcfile.c (parse_syntax, parse_rcfile), src/color.c
(color_update): Turn the linked list of syntaxes upside-down, so that
the last-defined one comes first, so that searching can stop at the
first match instead of always having to run through the entire list.
* src/rcfile.c: Rename a variable to better fit its new role.
2016-03-09 Benno Schulenberg <[email protected]>
* src/rcfile.c (parse_syntax): Produce an adequate error message
when the syntax name is unquoted. This fixes Savannah bug #47324.
* src/rcfile.c (parse_syntax): Use the grab_and_store() function
also for gathering up extension regexes.
2016-03-04 Benno Schulenberg <[email protected]>
* src/color.c (found_in_list): Don't bother keeping the compiled
regular expression when it matched -- drop this tiny optimization
for when opening multiple files. Instead stop calling malloc().
* src/nano.h: Delete a now-unused struct member.
* src/global.c (free_list_item): Elide this now too tiny function.
* scr/global.c (thanks_for_all_the_fish): Rename three variables.
* src/rcfile.c (parse_colors): Tweak a few things.
* src/color.c (color_update): Rename a variable.
2016-03-01 Benno Schulenberg <[email protected]>
* src/rcfile.c (parse_syntax), src/color.c (color_update): Don't
bother discarding a duplicate syntax (it's too rare, saves little
memory, and freeing it properly would cost even more code), just
select the last-defined one. This addresses Savannah bug #47303.
* src/color.c (color_update): Allow to select an empty syntax.
2016-02-29 Benno Schulenberg <[email protected]>
* src/nano.h, src/rcfile.c, src/color.c: Rename a struct member.
* src/rcfile.c (parse_rcfile): Don't allocate a struct for the
"none" syntax (and thus prevent it from being extended).
* src/nano.h, src/rcfile.c: Arrange some things more orderly.
* src/rcfile.c (parse_rcfile): Close an extended syntax again.
* src/rcfile.c (parse_rcfile): Rename a variable.
* src/rcfile.c (grab_and_store): Fix breakage of r5695.
* src/color.c (color_update): Do not dereference symlinks, so that
the syntax will be derived from the name given on the command line,
not from that of the target file. This fixes Savannah bug #47307.
2016-02-28 Benno Schulenberg <[email protected]>
* src/rcfile.c (parse_header_exp): Don't continue when something is
wrong -- skip the rest of the line. This fixes Savannah bug #47289.
* src/rcfile.c (parse_header_exp, parse_magic_exp, grab_and_store):
Use the now correct parsing of header regexes also for parsing magic
regexes. This fixes Savannah bug #47292 and saves 50 lines of code.
* src/rcfile.c (grab_and_store): Rename a variable and densify.
* src/rcfile.c (grab_and_store): Do not drop regexes that were
gathered earlier. This fixes Savannah bug #47285.
* src/rcfile.c (grab_and_store): Rearrange things in my style.
* src/rcfile.c (parse_syntax, parse_rcfile): Disallow adding any
further things to a syntax when an rcfile ends or when an invalid
syntax command is found. This fixes Savannah bug #47207.
2016-02-26 Benno Schulenberg <[email protected]>
* doc/man/nanorc.5, doc/texinfo/nano.texi, doc/syntax/nanorc.nanorc,
doc/nanorc.sample.in: Correct the description of 'justifytrim', add
it to the Info document, sort it, and tweak a wording.
* src/color.c (color_update): Look for a default syntax only when
all else failed -- forego the small, complicating optimization.
* src/color.c (color_update): Strip things bare to see the sameness.
* src/color.c (found_in_list): Factor out this triple repetition.
* src/color.c (color_update): Rename a variable for conciseness.
* src/color.c (nfreeregex): Elide this function, now used just once.
* src/nano.h: Rename a struct element for aptness and contrast.
* src/nano.h: Rename another element, because it refers not just
to file extensions, but also to header lines and magic strings.
GNU nano 2.5.3 - 2016.02.25
2016-02-25 Benno Schulenberg <[email protected]>
* src/browser.c (do_browser): Plug a memory leak by not copying
a string twice. This fixes Savannah bug #47206.
* src/browser.c (do_browser): Now put things in the proper order.
* src/files.c (make_new_buffer), src/nano.c (splice_opennode): Elide
the latter function, by handling the two cases (the creation of the
first element, and the insertion of a new element) directly.
2016-02-23 Benno Schulenberg <[email protected]>
* src/prompt.c (do_statusbar_output, do_statusbar_delete):
Rename a variable, for contrast and correctness.
* src/cut.c (do_copy_text): Don't move the cursor when copying a
backwardly marked region. This fixes Savannah bug #46980.
* src/text.c (do_undo, do_redo): Center the cursor when the
thing being undone or redone is currently off the screen.
* src/{files,nano,winio}.c: Rewrap and reshuffle some lines.
2016-02-22 Chris Allegretta <[email protected]>
* Add the ability to kill the trailing spaces when justifying text,
by adding a new nanorc option 'justifytrim' -- we'll see whether
this warrants a command-line flag or not. Now with slightly
better logic for multi-spaced lines.
2016-02-22 Benno Schulenberg <[email protected]>
* src/nano.c (free_openfilestruct): Elide this function.
* scr/global.c (thanks_for_all_the_fish, free_list_item): Condense.
* src/winio.c (edit_scroll): The amount to scroll is never zero.
* src/prompt.c (do_statusbar_prev_word, do_statusbar_next_word),
src/move.c (do_prev_word, do_next_word): Sort these in standard way.
* src/prompt.c (do_statusbar_output): Don't move too many bytes.
This fixes Savannah bug #47219 (uncovered by r5655).
* src/prompt.c (do_statusbar_output): Elide a variable.
* src/prompt.c (do_statusbar_delete): There is no need for nulling:
the charmove() already copies the terminating null byte.
* src/text.c (do_justify), src/winio.c (parse_escape_sequence):
Show the cursor after a justification and after an unrecognized
escape sequence, and in the edit window when linting.
* src/text.c (do_linter): Use the correct column number, also when
messages are skipped. And don't mind zero or negative numbers.
This is a partial fix for Savannah bug #47131.
2016-02-21 Benno Schulenberg <[email protected]>
* src/files.c (input_tab): If the first Tab added the part that all
matches have in common, don't require a third Tab to show the list.
* scr/global.c (thanks_for_all_the_fish): Remove unneeded checks.
2016-02-20 Benno Schulenberg <[email protected]>
* src/search.c (get_history_completion): Avoid leaking memory
when tabbing on a string that does not occur in the history.
This fixes Savannah bug #47124 reported by Mike Frysinger.
* src/files.c (input_tab): Parse a character in the correct
buffer. This fixes Savannah bug #47199.
* src/prompt.c (do_statusbar_output): Reduce an allocation to what
is actually needed. This undoes the papering-over of above bug.
2016-02-18 Benno Schulenberg <[email protected]>
* src/search.c (do_replace_loop), src/text.c (do_int_spell_fix),
src/winio.c (edit_refresh): Fix Savannah bug #47127 the proper way.
* src/nano.c (free_filestruct): Allow the parameter to be NULL.
* src/search.c (search_init): Delete a debugging leftover.
2016-02-16 Benno Schulenberg <[email protected]>
* src/files.c (initialize_buffer_text): Delete redundant assignment.
2016-02-15 Benno Schulenberg <[email protected]>
* src/files.c (read_file): Free not just the struct but also the
data it contains, and also when it is the first and only line.
This fixes Savannah bug #47153 reported by Mike Frysinger.
* src/files.c (get_full_path): Avoid losing a buffer when getcwd()
fails. This fixes Savannah bug #47129 reported by Mike Frysinger.
2016-02-14 Benno Schulenberg <[email protected]>
* src/search.c (do_replace_loop): Make iterating through replacement
matches behave again like iterating through search matches: showing
them centered when found offscreen. This fixes Savannah bug #47127.
* src/text.c (do_int_spell_fix): Restore the above behavior also for
the internal spell fixer.
* src/prompt.c (do_statusbar_input, do_statusbar_verbatim_input,
do_statusbar_output): Do the copying from input to output just once.
* src/prompt.c (do_statusbar_output): Rename and condense some stuff,
and correct the main comment: filtering means allow_cntrls==FALSE.
* README, TODO, doc/man/{nano.1,rnano.1,nanorc.5}: Say that 2.5.x
is a "rolling" release, lock files are done, and prepare for 2.5.3.
2016-02-13 Benno Schulenberg <[email protected]>
* src/browser.c (do_browser, browser_refresh): Rebuild the file list
only when necessary, not for each and every cursor movement. This
fixes Savannah bug #47133.
* src/files.c (save_poshistory): Allocate enough space for printing
out the line and column numbers. This fixes Savannah bug #47135.
* src/*.c: Switch the cursor on and off at the appropriate moments,
so that it no longer shows in the help screen nor in the file list.
This fixes Savannah bug #47126.
GNU nano 2.5.2 - 2016.02.12
2016-02-11 Benno Schulenberg <[email protected]>
* src/text.c (do_linter): Go to the next item in the list before
freeing the current one. This fixes Savannah bug #46796.
* src/text.c (do_formatter): Don't leave curses mode, as that would
hide any error messages upon reentry. And if there are any messages,
allow the user a little time to read them.
* src/text.c (do_linter, do_formatter): Condense some declarations,
rewrap some lines, and improve a few comments.
* doc/syntax/go.nanorc: Make the formatter command more visible.
2016-02-10 Benno Schulenberg <[email protected]>
* src/text.c (discard_until): Prevent a chain of editing actions from
continuing after a discard. This fixes Savannah bug #47104.
* src/files.c (get_full_path): Plug a sneaky memory leak. This fixes
Savannah bug #47003 reported and solved by Mike Frysinger.
* src/rcfile.c (parse_binding): Allow only control sequences in the
proper range to be rebound. This fixes Savannah bug #47025.
* THANKS: Add a Spanish, a Catalan, and a Croat translator.
* AUTHORS, THANKS: Remove SVN Id tags and a duplication.
* src/winio.c (get_kbinput), src/nano.c (main): Switch the cursor on
in the right place: in the central input routine.
* src/files.c (load_poshistory): Free any records that are dropped.
This fixes Savannah bug #47111 reported by Mike Frysinger.
2016-02-09 Benno Schulenberg <[email protected]>
* src/files.c (stat_with_alloc, open_buffer, write_file): Check the
result of a stat() to avoid referencing uninitialized data. Original
patch was by Kamil Dudka.
* doc/man/{nano.1,rnano.1,nanorc.5}: Adjust version for release.
2016-02-07 Benno Schulenberg <[email protected]>
* src/files.c (update_poshistory): Don't put files in the history list
when they have the default cursor position (line 1, column 1).
* src/files.c (write_file): Avoid a pointless lstat() when not writing
to a temp file, and in the bargain elide two variables.
* src/files.c (write_file): Elide an unneeded 'if'.
* doc/syntax/c.nanorc: Use a character class instead of a literal tab
and space. The change was inspired by David Niklas.
* src/prompt.c (do_yesno_prompt): Normalize the indentation.
* src/prompt.c (do_yesno_prompt): Rename a variable.
2016-02-06 Benno Schulenberg <[email protected]>
* src/files.c (write_file): Remove the --nofollow option that hasn't
been working for a dozen years.
* src/winio.c (statusbar): Update the screen immediately whenever a
message has been posted on the status bar.
* src/winio.c (statusbar), src/nano.c (do_input): Turn the cursor off
when writing in the status bar, and on when waiting for input.
* src/prompt.c (update_the_statusbar): Chop two parameters that are
always the same, and that are global variables anyway.
* src/prompt.c (update_bar_if_needed): Rename this for more contrast.
* src/prompt.c (do_statusbar_backspace): Avoid updating the bar twice.
* src/cut.c, src/files.c, src/prompt.c: Rewrap some lines and remove
some useless comments.
2016-02-05 Benno Schulenberg <[email protected]>
* doc/texinfo/nano.texi: Condense the descriptions of command-key
sequences and of the screen layout, mention how to enter Unicode,
and mention that regular expressions are line oriented.
* src/global.c (shortcut_init): Put four strings in standard order.
* src/text.c (do_undo), src/global.c (shortcut_init): Guide the
translators a little bit.
2016-01-31 Benno Schulenberg <[email protected]>
* src/files.c (has_valid_path): Be more specific in how a given path
is invalid. The change was improved by Rishabh Dave.
* doc/syntax/nanorc.nanorc: Show ^^ and M-^ as valid key names.
* src/prompt.c (do_statusbar_home): Make Home go always fully home.
2016-01-29 Benno Schulenberg <[email protected]>
* src/files.c (do_insertfile): Do display the buffer when configured
with only --disable-histories. This fixes Savannah bug #47011.
* src/nano.c (main): Check position history only when 'positionlog'
is set. This fixes a bug unconsciously reported by Mike Frysinger.
* src/files.c (do_lockfile): Plug a couple of memory leaks.
* src/files.c (update_poshistory): Plug another memory leak.
* src/files.c (close_buffer): Update position history only when
the option 'positionlog' is set.
2016-01-26 Benno Schulenberg <[email protected]>
* src/files.c (update_poshistory): Do not add directories to the
list of file positions. This fixes Savannah bug #46971.
* src/*.c: Adjust some indentation and some line wrapping.
* src/prompt.c (do_statusbar_prev_word): When in the middle of a
word, jump to the start of the current word, not to the start of
the preceding one. This fixes Savannah bug #46970.
* src/prompt.c (do_statusbar_next_word): Use simpler algorithm.
2016-01-25 Benno Schulenberg <[email protected]>
* src/files.c (update_poshistory): Handle an update of the first
element correctly.
* doc/texinfo/nano.texi: Document the --enable-altrcname option.
The lack of this was pointed out by Frank.
* doc/man/nano.1, doc/man/nanorc.5, doc/texinfo/nano.texi: Mention
that the position history is limited to the 200 most recent files.
2016-01-24 Benno Schulenberg <[email protected]>
* src/files.c (update_poshistory): Move an updated item to the end
of the list, so that it won't be dropped any time soon. The problem
was pointed out by David Niklas.
* src/winio.c (edit_redraw): Condense by removing a triplication.
* src/prompt.c (do_statusbar_prev_word, do_statusbar_next_word):
Chop an always-FALSE parameter and delete an unused return value.
* src/prompt.c (do_prompt): Remove a superfluous free.
* src/prompt.c (update_the_bar): Bundle some statements.
* src/prompt.c (need_statusbar_update): Elide this function.
* src/prompt.c (total_statusbar_refresh): Elide this function too.
2016-01-22 Benno Schulenberg <[email protected]>
* src/utils.c (get_homedir): Don't use $HOME when we're root, because
some sudos don't filter it out of the environment (which can lead to
a root-owned .nano/ directory in the invoking user's home directory).
It fixes https://bugs.launchpad.net/ubuntu/+source/nano/+bug/1471459.
* src/files.c (read_line): Rename a variable for clarity and contrast.
2016-01-21 Benno Schulenberg <[email protected]>
* src/prompt.c (get_prompt_string): Preserve the cursor position on
the statusbar when just toggling a setting or making an excursion to
the file browser. This fixes Savannah bug #46945.
* src/prompt.c (do_prompt_abort): Remove this unneeded function, as
nothing can break out of do_prompt(), not a SIGWINCH either.
* src/prompt.c (get_prompt_string): Delete code that is dead now.
* src/prompt.c (get_prompt_string): Elide an unneeded variable.
* src/browser.c (do_browser): Delete unneeded blanking of a variable.
2016-01-20 Benno Schulenberg <[email protected]>
* src/files.c (open_buffer): Readjust the indentation and a comment.
* src/files.c (has_valid_path): Get rid of a global variable.
2016-01-20 Rishabh Dave <[email protected]>
* src/files.c (verify_path, open_buffer): When opening a new buffer,
verify that the containing directory of the given filename exists.
This fixes Savannah bug #44950.
* src/files.c (do_lockfile): Remove the existence check on the
directory, as this is now covered by verify_path().
2016-01-17 Benno Schulenberg <[email protected]>
* src/global.c: Fix typo in #ifndef symbol. Reported by Frank.
* doc/syntax/nanorc.nanorc: Remove '+' as only one menu is allowed.
* src/files.c (load_poshistory): Limit the number of loaded items.
2016-01-17 Mike Frysinger <[email protected]>
* doc/syntax/nanorc.nanorc: Allow inline comments with key bindings.
2016-01-15 Benno Schulenberg <[email protected]>
* src/winio.c (set_modified): Plug another memory leak.
* src/files.c (set_modified): Move this function to its habitat.
* src/files.c (open_file): Return the fantastic file descriptor
when the opening of a non-existent file for reading succeeds.
* src/nano.c (delete_opennode), src/text.c (discard_until):
Free the items on the undo stack when a buffer is closed.
This fixes Savannah bug #46904 reported by Mike Frysinger.
2016-01-15 Mike Frysinger <[email protected]>
* src/files.c (open_file): Free the full filename in all cases.
2016-01-14 Benno Schulenberg <[email protected]>
* doc/nanorc.sample.in: Remove a reference to an obsolete file.
Reported by Mike Frysinger.
* src/winio.c (edit_redraw): Delete an 'if' that is always FALSE.
* src/winio.c (edit_redraw): Elide an unneeded variable and adjust
some wrappings and whitespace.
* src/proto.h: Delete two duplicate declarations.
* src/rcfile.c (check_bad_binding): Elide this unneeded function.
* src/rcfile.c (parse_binding): Show key only when it was rebound.
2016-01-13 Benno Schulenberg <[email protected]>
* src/files.c (save_poshistory): Reduce the indentation.
* src/*.c: Adjust a few comments and rewrap some lines.
2016-01-12 Benno Schulenberg <[email protected]>
* NEWS: Fix some typos and whitespace, and normalize the dates.
* src/files.c (load_poshistory): Rename a variable.
* src/files.c (load_poshistory): Remove some code duplication.
* src/files.c (save_poshistory, update_poshistory, check_poshistory,
load_poshistory): Differentiate variable name from function names.
* src/files.c (load_poshistory): Remove a senseless iteration.
* src/files.c (load_poshistory): Condense the reading of a line.
* src/files.c (load_poshistory): Reduce the indentation.
GNU nano 2.5.1 - 2016.01.11
2016-01-10 Benno Schulenberg <[email protected]>
* NEWS: Add item for upcoming 2.5.1.
* src/nano.c (version), src/winio.c (do_credits), doc/man/rnano.1,
doc/man/nano.1, doc/man/nanorc.5: Adjust dates and version number.
2016-01-09 Benno Schulenberg <[email protected]>
* src/color.c (precalc_multicolorinfo), src/winio.c (edit_draw):
Make sure to keep advancing also when matches are zero-length.
This fixes Savannah bug #26977 reported by Tigrmesh.
* src/winio.c (update_line): For softwrap, don't go beyond the number
of available rows in the edit window. This fixes Savannah bug #42188.
* ChangeLog: Snip inconsistent blank lines.
2016-01-07 Benno Schulenberg <[email protected]>
* src/global.c (assign_keyinfo): Delete two unneeded #ifdefs: if
they /could/ be false, the H and E keys would stop working.
* src/global.c (assign_keyinfo): Add a comment and use a symbol.
2016-01-04 Benno Schulenberg <[email protected]>
* src/global.c (shortcut_init): Nowadays the functions are defined
only once, so there is no longer any need to free existing ones.
* src/global.c (sctofunc): Rewrite the loop, and constify the input.
* src/text.c (do_linter): Condense the exit code.
* src/nano.c (allow_sigwinch): Improve its name and its comments.
* src/global.c (shortcut_init): Add "Tab" as key description.
* src/text.c (do_linter): Gettextize a forgotten string.
* src/global.c (assign_keyinfo): Make "Tab" produce the appropriate
keycode. This fixes Savannah bug #46812 reported by Cody A. Taylor.
2016-01-04 Mike Frysinger <[email protected]>
* src/global.c (strtosc, strtomenu): Constify the input parameter.
2016-01-03 Benno Schulenberg <[email protected]>
* src/text.c (do_deletion), src/nano.c (do_input): Let reset_multis()
figure out whether after a deletion a full refresh is needed, before
doing a redraw of the current line. This fixes Savannah bug #46794.
* src/nano.c (do_output): Let reset_multis() figure out whether after
an addition a full refresh is needed (for multiline-regexes' sake),
instead of doing it always.
* src/color.c (reset_multis): Abort when having no multiline regexes.
* src/nano.c (do_input): A functionless shortcut should be impossible.
* src/nano.c (do_input): Adjust indentation.
2016-01-02 Benno Schulenberg <[email protected]>
* src/text.c (do_spell, do_formatter): Plug three tiny memory leaks.
* src/text.c (do_alt_speller, do_formatter): There is no need here to
reinitialize the windows; it will be done when polling the keybuffer.
* src/winio.c (do_credits): Correctly restore the settings of NO_HELP
and MORE_SPACE.
2015-12-31 Benno Schulenberg <[email protected]>
* src/text.c (do_formatter): Restore the cursor position differently.
* src/search.c (do_gotopos): Delete this now unused function.
* src/search.c (do_gotolinecolumn): Chop an always-FALSE parameter.
* src/search.c (do_gotolinecolumn): Chop a duplicate parameter --
'allow_update' always has the same value as 'interactive'.
2015-12-30 Benno Schulenberg <[email protected]>
* src/nano.c (main), src/files.c (open_buffer): Don't try to position
the cursor when opening a buffer failed (because the user specified a
directory, for example). This fixes Savannah bug #46778.
* doc/syntax/ocaml.nanorc: Normalize the comments.
2015-12-29 Benno Schulenberg <[email protected]>
* doc/syntax/{c,objc,asm}.nanorc: Disable the regex for multiline
strings as it colours some things wrong and is a glutton on time.
2015-12-23 Benno Schulenberg <[email protected]>
* src/files.c (do_writeout, do_writeout_void), src/global.c
(shortcut_init, strtosc), src/nano.c (do_exit, close_and_go),
doc/man/nanorc.5, doc/texinfo/nano.texi: In the writeout menu,
offer ^Q to close and discard the buffer without saving it. By
default, the key is bound only when --tempfile is in effect.
* doc/man/nanorc.5: Improve ordering of bindable functions.
* src/files.c (read_file): Don't open an extra blank buffer when
an empty file is read. Bug was exposed by r5498, December 18.
* src/files.c (do_writeout): When the user decides to save the
buffer after all, go back to the filename prompt because the
buffer may not have a name yet. This fixes Savannah bug #46752.
2015-12-23 Mike Frysinger <[email protected]>
* doc/syntax/autoconf.nanorc: Handle .m4 files too, add the "elif"
keyword, handle dnl comments better, and mark trailing whitespace.
* src/files.c (save_history, save_poshistory): Don't make the user
hit Enter when there's an error saving history state at exit; it is
pointless and annoying. Just notify the user and move on.
* src/nano.c (main): On most 64-bit systems, casting a pointer to
an integer can cause valid pointers to be truncated and rejected.
Rework the code to test for the two invalid values directly.
2015-12-23 Christian Weisgerber <[email protected]>
* configure.ac: AC_CHECK_HEADERS_ONCE() is very special and cannot be
conditionalized. Use plain AC_CHECK_HEADERS() instead, to not check
for magic.h and zlib.h when configuring with --disable-libmagic.
2015-12-22 Benno Schulenberg <[email protected]>
* src/color.c (precalc_multicolorinfo, alloc_multidata_if_needed):
Move these two functions to the file where they belong. And make
the checking for an impatient user into a separate routine.
* src/proto.h, src/winio.c (parse_escape_sequence, convert_sequence,
arrow_from_abcd): Better names for these three functions.
* src/winio.c (convert_sequence): Use return instead of a variable.
2015-12-20 Benno Schulenberg <[email protected]>
* src/files.c (display_buffer), src/nano.c (main): Precalculate the
multiline-regex cache data for each buffer, not just for the first.
This fixes Savannah bug #46511.
2015-12-18 Benno Schulenberg <[email protected]>
* src/color.c (color_init): Use less #ifdefs, and adjust indentation.
* src/color.c (set_colorpairs): Improve comments and rename vars.
* src/files.c (read_line): Chop a superfluous bool -- 'prevnode' being
NULL is enough indication that the first line is being read.
* src/files.c (switch_to_prevnext_buffer): Tweak comment and var name.
2015-12-11 Benno Schulenberg <[email protected]>
* doc/syntax/Makefile.am: Add missing autoconf and nftables syntaxes.
* ChangeLog: Correct a bug number, plus a few other tweaks.
2015-12-08 Benno Schulenberg <[email protected]>
* src/nano.c (splice_node, unlink_node): Let these functions update
'filebot', instead of doing it in four different places each.
* src/search.c (goto_line_posx), src/move.c (do_down): It should not
be necessary to doubly check for being at the end of file.
* src/text.c (do_justify): Rewrap and reorder a few lines.
2015-12-07 Benno Schulenberg <[email protected]>
* src/winio.c (edit_draw): Quit the loop when there is no end match.
* src/files.c (do_writeout): When --tempfile is given, make ^O not
write out the file rightaway, as otherwise there is no way to discard
the edits. This undoes the core part of r5378 of September 29. See
https://lists.gnu.org/archive/html/help-nano/2015-11/msg00005.html.
GNU nano 2.5.0 - 2015.12.05
2015-12-05 Chris Allegretta <[email protected]>
* src/nano.c (main): key_defined() is an ncurses-ism. Add better
checks for this.
2015-12-05 Benno Schulenberg <[email protected]>
* src/text.c: Fix compilation with --enable-tiny --enable-justify.
* doc/man/{nano.1,rnano.1,nanorc.5}, doc/texinfo/nano.texi:
Update date and version number to match the upcoming release.
* src/files.c, src/winio.c: Avoid two compilation warnings.
2015-12-04 Benno Schulenberg <[email protected]>
* src/proto.h: Avoid a compilation warning.
* src/color.c (reset_multis_for_id, reset_multis_before/after):
Fuse these three functions into a single one.
* src/*.c: Rewrap some lines and tweak some comments.
2015-12-03 Benno Schulenberg <[email protected]>
* src/text.c (discard_until): Move the trimming of the undo stack
into a separate function, so it can be used elsewhere.
* src/text.c (do_justify): Discard the entire undo stack, to prevent
nano from dying (or making mistakes) when trying to undo edits after
a justification. This works around Savannah bug #45531.
* src/text.c (do_indent): Also here discard the entire undo stack, to
prevent nano from making mistakes when trying to undo edits after an
indentation change. This works around Savannah bug #46591.
* doc/man/nano.1, doc/texinfo/nano.texi: Add a note about undo not
working after a justification or reindentation.
2015-12-02 Benno Schulenberg <[email protected]>
* doc/syntax/python.nanorc: Don't colour triple quotes by themselves.
* doc/syntax/python.nanorc: Treat backslashed quotes properly, and
don't colour triple-quoted strings in two manners.
* src/text.c (do_justify): Accept not just the Uncut keystroke but
also the Undo keystroke for undoing a justification.
2015-12-02 Arturo Borrero González <[email protected]>
* doc/syntax/nftables.nanorc: New file; syntax colouring for nftables.
This addresses Debian bug #805288.
2015-12-01 Benno Schulenberg <[email protected]>
* src/files.c (do_insertfile): Mark the buffer as modified only when
actually something was inserted. This fixes Savannah bug #45409.
* src/files.c (do_insertfile): Rename two variables for clarity.
* src/text.c (redo_cut): Delete two redundant assignments.
* src/winio.c (edit_draw): Move a check to a better place.
* src/winio.c (edit_draw): Rename a label and elide an 'else'.
* src/winio.c (edit_draw): Unindent after previous change.
* src/color.c (reset_multis_before, reset_multis_after): Delete four
superfluous checks.
2015-11-30 Benno Schulenberg <[email protected]>
* src/text.c (redo_cut, update_undo): When cutting reaches the EOF,
and NONEWLINES is set, there is no next line at which to put the
cutting point for a redo. So put it at the very end of the cut.
This fixes Savannah bug #46541.
* src/text.c (add_undo, update_undo, do_undo, do_redo), src/nano.h:
Store and retrieve the correct file size before and after an action.
This fixes Savannah bug #45523.
* src/files.c (free_chararray): Allow the parameter to be NULL.
This fixes Savannah bug #46420.
2015-11-29 Benno Schulenberg <[email protected]>
* src/color.c (reset_multis): Evaluate correctly whether to reset
the multidata cache. This fixes Savannah bug #46543.
* src/color.c (reset_multis): Reset the multidata a bit less often.
* src/color.c (reset_multis): Adjust whitespace and comments.
* src/winio.c (edit_draw): When an end is found but nothing is painted
(because the coloured part is horizontally scrolled off), nevertheless
set the multidata to CBEGINBEFORE. This fixes Savannah bug #46545.
* src/winio.c (edit_draw): Use the main cache-allocation routine.
* src/winio.c (edit_draw): Delete two redundant conditions, and move
the least frequent case to the end.
* src/winio.c (edit_draw): Elide a variable, tweak some comments.
2015-11-28 Benno Schulenberg <[email protected]>
* src/nano.c (main): Allow the user full control over the values of
MALLOC_CHECK_ and MALLOC_PERTURB_; nano shouldn't override these.
This reverts r5344 from August 6.
* src/nano.c (alloc_multidata_if_needed): When allocating a new
multidata array, initialize the array. Problem was betrayed by
using MALLOC_PERTURB_, and was located with valgrind.
2015-11-26 Benno Schulenberg <[email protected]>
* src/text.c (do_redo): Not just the undoing, also the redoing of a
Backspace at EOF is a special case. This fixes Savannah bug #46532.
* src/text.c (do_redo): Warn about an impossible condition, instead
of blithely continuing. And elide an unneeded variable.
2015-11-25 Benno Schulenberg <[email protected]>
* src/nano.c (do_output): Refreshing the whole edit window (instead
of just the current line) is not needed for any kind of syntax, but
only when there are multiline regexes. And check for this not on
every keystroke in a burst, but just once.
* src/text.c (do_undo): Warn about a condition that should never
occur, instead of silently continuing.
* src/text.c (do_undo): Elide an unneeded variable, and don't skip
the end of this function when things went wrong.
* src/text.c (do_undo, do_redo, add_undo, update_undo): Handle more
possible internal errors, and do it correctly.
* AUTHORS: Add Mark and myself.
2015-11-24 Benno Schulenberg <[email protected]>
* doc/syntax/makefile.nanorc: Also recognize the extensions .make and
.mk as Makefiles. Suggested by Emmanuel Bourg in Debian bug #804845.
* src/color.c (color_update): Tell the user when a syntax name given
on the command line does not exist. This fixes Savannah bug #46503.
* src/nano.c (splice_node): Inserting a new node into a linked list
requires just two parameters: the insertion point and the new node.
* src/nano.c (splice_node): Rename a variable for clarity.
2015-11-23 Benno Schulenberg <[email protected]>
* src/nano.c (main), src/winio.c (parse_kbinput): Make Ctrl+Left and
Ctrl+Right work on more terminals by asking ncurses for the keycodes.
This addresses Debian bug #800681 reported by Arturo Borrero González.
2015-11-22 Benno Schulenberg <[email protected]>
* src/text.c (add_undo): Delete a condition that will never occur --
this function is only ever called with PASTE when cutbuffer != NULL.
* src/text.c: Rewrap, rewrite, rename, and reorder some things.
* src/text.c (do_undo, do_redo): Elide an unneeded variable.
* src/nano.c (unlink_node): After unlinking, also delete the node.
2015-11-21 Benno Schulenberg <[email protected]>
* src/nano.c (main): Let the value of a --fill option on the
command line override the value of a "set fill" in an rcfile.
This fixes Savannah bug #46492.
* ChangeLog, NEWS: Add the release marker and copy the news item.
2015-11-21 David Lawrence Ramsey <[email protected]>
* ChangeLog, NEWS: Fix a typo and adjust some spacing.
GNU nano 2.4.3 - 2015.11.18
2015-11-12 Benno Schulenberg <[email protected]>
* src/text.c (do_undo, update_undo): Store the correct end position of
an inserted file, and use it when undoing. Fixes Savannah bug #46414.
* src/text.c (add_undo, update_undo): Delete an unneeded alias -- it
wasn't being used consistently anyway.
2015-11-11 Benno Schulenberg <[email protected]>
* src/text.c (do_redo, update_undo): Redo an Enter from the stored
undo data, instead of running do_enter() again, because the latter
will behave differently depending on the setting of autoindent.
This addresses Debian bug #793053 reported by Clancy.
* src/text.c (do_enter): Chop the now unused parameter 'undoing'.
* src/text.c (do_enter_void): Discard this now useless function.
2015-11-10 Benno Schulenberg <[email protected]>
* src/winio.c (edit_draw): Skip a zero-length match only when there
/is/ a match. Found with valgrind. This fixes Savannah bug #41908.
* src/files.c (do_lockfile, update_poshistory): Plug memory leaks.
2015-11-08 Benno Schulenberg <[email protected]>
* src/global.c (shortcut_init): Allow exiting from the file browser
with the same key (^T) as it was entered (as ^G for the help viewer).
* doc/syntax/changelog.nanorc: Accept longer bug and patch numbers.
2015-11-07 Benno Schulenberg <[email protected]>
* src/search.c (do_replace_loop): Correct the logic for adjusting the
x position of the mark -- it happened to work because 'mark_begin' is
NULL when 'old_mark_set' is FALSE. Also improve the comments.
2015-11-06 Benno Schulenberg <[email protected]>
* src/files.c (write_lockfile): Don't bail out when the hostname is
overlong, but instead truncate it properly and continue. This fixes
Ubuntu bug #1509081 reported by Sam Reed.
* src/global.c (length_of_list), src/winio.c(get_mouseinput): Don't
check whether a function has a help line, since all of them have.
(And even if some didn't, they would still be valid functions.)
* src/cut.c (cut_line): There is no need to set 'openfile->mark_begin'
just like that; it will be set when 'openfile->mark_set' becomes TRUE.
* src/text.c (do_redo): Delete a redundant assignment.
2015-11-02 Benno Schulenberg <[email protected]>
* src/nano.h: Delete an unused type definition.
* src/nano.h: Improve several comments.
* src/text.c (do_wrap): Elide two variables.
* src/cut.c (do_cut_text): Chop the 'undoing' parameter, so that the
calls of this function become more symmetrical.
2015-10-31 Benno Schulenberg <[email protected]>
* src/nano.c (copy_from_filestruct): When pasting while the mark is
on, the mark's pointer needs to be refreshed only when it is on the
same line as the cursor, and the mark's x coordinate only when the
mark is located after the cursor. This fixes Savannah bug #46347.
* src/nano.c (copy_from_filestruct): Improve comments and combine
two conditions.
* ChangeLog: Correct the description of an old change.
2015-10-29 Benno Schulenberg <[email protected]>
* src/text.c (add_undo): Only skip adding an undo when the current
action equals the last action. This condition is needed for when
typing text is broken by an undo+redo. Fixes Savannah bug #46323.
* src/text.c (do_redo): Check for "nothing to redo" earlier, so we
can restore the possible warning about an internal error.
* src/text.c (add_undo): Remove an 'if' that will never be true,
and remove some assignments that have already been done.
2015-10-29 David Lawrence Ramsey <[email protected]>
* src/files.c (do_writeout), src/nano.c (no_current_file_name_warning,
do_exit): When option -t is given, make ^O work the same way as under
Pico, writing out the file without prompting. And make it work even
better than Pico when the current file doesn't have a name yet. This
fixes Savannah bug #45415. [Reverted in r5489 on December 7.]
2015-10-28 Benno Schulenberg <[email protected]>
* src/text.c (do_redo): For an INSERT, 'u->mark_begin_lineno' is not
an actual line number, so spoof it. It can be spoofed, because 'f'
is not used for the INSERT case. This fixes Savannah bug #45524.
* src/text.c (do_redo): Remove a condition that can never occur.
Also rewrite a loop to become somewhat clearer.
2015-10-27 Benno Schulenberg <[email protected]>
* src/move.c (do_next_word): Rewrite this function to use the same
logic as do_prev_word(), reducing its number of lines to half.
* src/move.c (do_down): Don't calculate the line length twice. And
in the bargain avoid a warning about comparison of signed/unsigned.
2015-09-05 Benno Schulenberg <[email protected]>
* src/winio.c (display_string, edit_draw): Force a redraw of a line
only when it contains a multicolumn character, to spare all regular
text this significant slowdown. This fixes Savannah bug #45684
reported by Wyatt Ward.
* src/move.c (do_prev_word): Drop a return value that is never used.
* src/move.c (do_prev_word): When in the middle of a word, jump to
its beginning instead of to the beginning of the preceding word.
Nano now matches the behaviour of Pico and of most other editors.
This fixes Savannah bug #45413.
2015-09-04 Benno Schulenberg <[email protected]>
* src/chars.c: Reverting r5354 from August 12. This fixes Savannah
bug #45874. Apparently there is /some/ state somewhere after all.
2015-08-29 Benno Schulenberg <[email protected]>
* doc/syntax/autoconf.nanorc: New file; syntax colouring for Autoconf.
* src/files.c: Rewrap some lines and tweak two comments.
2015-08-16 Benno Schulenberg <[email protected]>
* src/help.c (help_init, help_line_len): Avoid wide paragraphs of text
in the help screens: wrap them at 74 columns if the screen is wider.
* src/help.c (help_init): Reduce the scope of a variable.
* src/help.c: Adjust some comments and whitespace.
* src/help.c (do_help, do_help_void): Don't bother passing a function
when it's used only once.
* src/help.c (help_line_len): The wrap location can be beyond the EOL,
so for determining the length of the current line, don't start at that
location but at the beginning. This fixes Savannah bug #45770.
* src/help.c (help_line_len): Rename and reorder most of it.
* src/nano.c (make_new_opennode), src/files.c (initialize_buffer):
Remove some duplication in the initialization of a new openfile node.
* src/nano.c (make_new_opennode): Don't bother setting things to NULL
when they will be initialized right away.
* src/files.c (make_new_buffer): Don't bother with a separate function
when it's used only once, right there.
* src/help.c (help_init): Since the new SIGWINCH handling, a resizing
of the window will no longer break out of the help viewer, so there is
no need any more for an extra freeing of the help text.
2015-08-13 Benno Schulenberg <[email protected]>
* src/search.c (do_find_bracket): Remove mistaken comparison between
pointer and literal character. Found with cppcheck.
* src/browser.c (browser_init): Speed up the finding of the longest
filename: don't limit the value to that of COLS all the time, as this
is done later anyway, and don't bother skipping the dot entry.
* src/global.c (shortcut_init): In restricted mode, allow changing
the file format, but actually disable Appending, Prepending, making
Backups, and opening the File Browser.
2015-08-12 Benno Schulenberg <[email protected]>
* src/chars.c: UTF-8 is a stateless encoding, so there is no need to
reset any state. [Reverted in r5369 on September 4.]
2015-08-11 Benno Schulenberg <[email protected]>
* src/files.c (write_file): Avoid calling copy_file() with a null
pointer. Found with cppcheck.
* src/files.c (write_file): A failure to delete the temporary file
does not mean that it wasn't copied properly.
2015-08-09 Benno Schulenberg <[email protected]>
* src/global.c, src/help.c (help_init), src/nano.c (do_toggle, main),
src/winio.c (display_string, statusbar): Allow toggling the display
of whitespace also when support for nanorc files was not built in,
because the default values are quite usable.
* src/files.c (read_file), src/rcfile.c, src/nano.c (main, usage):
Fix compilation with --enable-tiny; file formats are not available
then, so option --unix has no place; also add its description.
* src/nano.c (finish): Remove an unneeded and mistaken condition.
* src/nano.c (say_there_is_no_help): Make it sound more definitive.
2015-08-08 Benno Schulenberg <[email protected]>
* src/winio.c (display_string): For some reason the reallocation done
by null_at() messes things up. So put in the null byte "manually".
This is a fix -- or workaround -- for Savannah bug #45718.
2015-08-06 Benno Schulenberg <[email protected]>
* src/nano.c (main): For --enable-debug builds, let malloc() help
to find initialization failures and uses-after-free. Suggested by
Mike Frysinger. [Reverted in r5446 on November 28.]
* doc/texinfo/nano.texi: Improve the formatting, using @t to mark
double-quoted literal strings, @: to mark periods that do not end
sentences, and @. to mark a finishing period after a capital.
2015-08-04 Benno Schulenberg <[email protected]>
* src/nano.c (main), src/files.c (read_file), src/rcfile.c,
doc/man/nano.1, doc/man/nanorc.5, doc/texinfo/nano.texi: Add
the option --unix, to save a file by default in Unix format.
* doc/nanorc.sample.in: Advertise the five new bindable functions.
* doc/man/nano.1, doc/man/nanorc.5, doc/texinfo/nano.texi: Tweaks.
2015-08-03 Benno Schulenberg <[email protected]>
* src/rcfile.c (parse_binding): Check the value of shortcut->toggle
only if it actually is a toggle. Found with valgrind.
* src/files.c (write_lockfile): Plug a leak. Found with valgrind.
* src/rcfile.c (parse_binding): Plug a tiny leak.
2015-08-02 Benno Schulenberg <[email protected]>
* src/files.c (initialize_buffer): Initialize also openfile->syntax.
This addresses Debian bug #787914 reported by Paul Wise.
2015-08-01 Benno Schulenberg <[email protected]>
* src/nano.c (precalc_multicolorinfo): Set each multiline-color
value instead of OR-ing it. This fixes Savannah bug #45640.
* src/help.c (help_init): Show also the dedicated keys in the
^G help text. This helps to clarify some keys, and helps to
see which ones could easily be rebound.
* src/nano.c (usage): Add "and exit" to the description of --help,
to match --version, and to distinguish it more from ^G.
2015-07-31 Benno Schulenberg <[email protected]>
* src/text.c (do_cutword, do_cut_prev_word, do_cut_next_word),
src/global.c (shortcut_init, strtosc), doc/texinfo/nano.texi,
doc/man/nanorc.5: Add two new bindable functions, 'cutwordleft'
and 'cutwordright', which delete all characters from the cursor
to the preceding or succeeding word start. Fixes bug #32803.
2015-07-30 Benno Schulenberg <[email protected]>
* src/global.c (shortcut_init): Don't show ^R and ^T in the help
lines in restricted mode (if possible), to give visual feedback.
* src/*.c: Normalize the whitespace after the preceding changes.
* src/nano.c (show_restricted_warning, say_there_is_no_help):
Differentiate between something being disabled/restricted (because
of the way of invocation) and help texts being unavailable (which
is a compile-time decision).
* src/global.c (shortcut_init): Change "Justify" to a tag and regroup.
* src/nano.c (do_suspend_void, do_suspend): Provide feedback when
suspension is not enabled; and it cannot be enabled in restricted
mode any longer, so there is no need to check for that any more.
2015-07-29 Benno Schulenberg <[email protected]>
* src/text.c (do_linter): When the linter is called in restricted mode
(possible when nano was built with --disable-speller), it is better to
say that this function is disabled than that no linter was defined.
* src/nano.c (usage): When asking for --help in restricted mode, don't
show options that don't have any effect.
* src/nano.c (do_toggle): Make the four toggles that don't have any
effect in restricted mode say that they're disabled.
2015-07-28 Benno Schulenberg <[email protected]>
* src/text.c (do_formatter), src/nano.c (allow_pending_sigwinch):
Reenable SIGWINCH-es also when invoking the formatter fails, and
correct some comments.
* src/text.c (do_linter, do_formatter): In restricted mode, no nanorc
files are read, so no linter or formatter will be defined, so these
routines will never be called. Also, the formatter will only ever
be called when a syntax applies to the current file and this syntax
defines a formatter, so there is no need to check this again.
2015-07-26 Benno Schulenberg <[email protected]>
* src/search.c (do_replace_loop): When doing regex replacements, find
each zero-length match only once. This fixes Savannah bug #45626.
* src/global.c (shortcut_init, strtosc), src/search.c (do_findnext,
do_findprevious), doc/man/nanorc.5, doc/texinfo/nano.texi: Add two
new bindable functions, 'findnext' and 'findprevious', which repeat
the last search command in a fixed direction without prompting.
* src/global.c (shortcut_init): Tweak a string.
* src/search.c, src/move.c: Improve a few of the comments.
* src/search.c (replace_regexp, replace_line): Rename two variables,