diff -pruN 3.1.1-1/CHANGES 3.1.2-1/CHANGES --- 3.1.1-1/CHANGES 2017-06-04 20:42:20.000000000 +0000 +++ 3.1.2-1/CHANGES 2018-10-06 09:51:05.000000000 +0000 @@ -1,5 +1,16 @@ (This file, CHANGES, lists fixes. See NEWS for new features and enhancements.) +3.1.2 2018-10-06 + + * Fixed visual glitch when characters spanning multiple columns are only + partially displayed on the left side. + + * Fixed PARAGRAPH command. + + * DeleteNextWord now deletes through the end of the next N words. + + * Undoing DeleteNextWord/DeletePrevWord also restores cursor position. + 3.1.1 2017-06-04 * Fixed visual glitch when deleting characters from long lines. diff -pruN 3.1.1-1/debian/changelog 3.1.2-1/debian/changelog --- 3.1.1-1/debian/changelog 2018-03-02 18:34:03.000000000 +0000 +++ 3.1.2-1/debian/changelog 2019-02-12 02:10:56.000000000 +0000 @@ -1,3 +1,13 @@ +ne (3.1.2-1) unstable; urgency=medium + + * New upstream release. + * debian/patches, Refresh patches offset. + * debian/control, Bump Standards-Version to 4.3.0 (no changes). + * debian/copyright, Extend copyright holders years. + * debian/rules, Disable NE_DEBUG. + + -- Julián Moreno Patiño Mon, 11 Feb 2019 21:10:56 -0500 + ne (3.1.1-1) unstable; urgency=medium * New upstream release. diff -pruN 3.1.1-1/debian/control 3.1.2-1/debian/control --- 3.1.1-1/debian/control 2018-03-02 18:34:03.000000000 +0000 +++ 3.1.2-1/debian/control 2019-02-12 02:10:56.000000000 +0000 @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 11), libncurses5-dev, texinfo, install-info -Standards-Version: 4.1.4 +Standards-Version: 4.3.0 Homepage: http://ne.di.unimi.it/ Package: ne diff -pruN 3.1.1-1/debian/copyright 3.1.2-1/debian/copyright --- 3.1.1-1/debian/copyright 2018-03-02 18:34:03.000000000 +0000 +++ 3.1.2-1/debian/copyright 2019-02-12 02:10:56.000000000 +0000 @@ -14,7 +14,7 @@ License: GPL-3.0+ Files: debian/* Copyright: 2001-2006 Carlo Contavalli 2009 Sven Joachim - 2010-2018 Julián Moreno Patiño + 2010-2019 Julián Moreno Patiño License: GPL-3.0+ Files: src/regcomp.c src/regex.c src/regexec.c src/regex.h src/regex_internal.c src/regex_internal.h diff -pruN 3.1.1-1/debian/patches/01_Fix_ftbfs_add_lm.diff 3.1.2-1/debian/patches/01_Fix_ftbfs_add_lm.diff --- 3.1.1-1/debian/patches/01_Fix_ftbfs_add_lm.diff 2015-06-22 22:25:41.000000000 +0000 +++ 3.1.2-1/debian/patches/01_Fix_ftbfs_add_lm.diff 2019-02-12 02:10:56.000000000 +0000 @@ -1,10 +1,9 @@ Description: Add -lm to fix ftbfs with binutils-gold Author: Angel Abad Bug-Ubuntu: https://launchpad.net/bugs/771117 - --- a/src/makefile +++ b/src/makefile -@@ -96,7 +96,7 @@ +@@ -99,7 +99,7 @@ CFLAGS=$(OPTS) $(GCCFLAGS) \ $(if $(NE_ANSI), -DTERMCAP -DANSI,) @@ -12,4 +11,4 @@ Bug-Ubuntu: https://launchpad.net/bugs/7 +LIBS=$(if $(NE_TERMCAP)$(NE_ANSI),,-lcurses -lm) ne: $(OBJS) $(if $(NE_TERMCAP)$(NE_ANSI),$(TERMCAPOBJS),) - $(CC) $(OPTS) $(LDFLAGS) $(if $(NE_TEST), -coverage -lefence,) $^ -lm $(LIBS) -o $(PROGRAM) + $(CC) $(OPTS) $(LDFLAGS) $(if $(NE_TEST), -coverage,) $(if $(NE_DEBUG), -fsanitize=address -fsanitize=undefined,) $^ -lm $(LIBS) -o $(PROGRAM) diff -pruN 3.1.1-1/debian/patches/03_allow_cflags_override.diff 3.1.2-1/debian/patches/03_allow_cflags_override.diff --- 3.1.1-1/debian/patches/03_allow_cflags_override.diff 2015-06-22 22:19:06.000000000 +0000 +++ 3.1.2-1/debian/patches/03_allow_cflags_override.diff 2019-02-12 02:10:56.000000000 +0000 @@ -2,10 +2,10 @@ Description: Use cflags and ldflags from the usage of -O3 optimization level. Forwarded: no Author: Julián Moreno Patiño -Last-Update: 2015-06-22 +Last-Update: 2019-02-11 --- a/src/makefile +++ b/src/makefile -@@ -87,11 +87,11 @@ +@@ -90,11 +90,11 @@ GCCFLAGS=-std=c99 -Wall -Wno-parentheses endif @@ -14,8 +14,8 @@ Last-Update: 2015-06-22 -D_REGEX_LARGE_OFFSETS -D_GNU_SOURCE -DSTDC_HEADERS -Dinline=__inline__ \ $(if $(NE_NOWCHAR), -DNOWCHAR,) \ $(if $(NE_TEST), -DNE_TEST -coverage,) \ -- $(if $(NE_DEBUG), -g,-O3 -DNDEBUG) \ -+ $(if $(NE_DEBUG), -DNDEBUG) \ +- $(if $(NE_DEBUG), -g -fsanitize=address -fsanitize=undefined,-O3 -DNDEBUG) \ ++ $(if $(NE_DEBUG), -g -fsanitize=address -fsanitize=undefined,-DNDEBUG) \ $(if $(NE_TERMCAP), -DTERMCAP,) \ $(if $(NE_ANSI), -DTERMCAP -DANSI,) diff -pruN 3.1.1-1/debian/rules 3.1.2-1/debian/rules --- 3.1.1-1/debian/rules 2018-03-02 18:20:38.000000000 +0000 +++ 3.1.2-1/debian/rules 2019-02-12 02:10:56.000000000 +0000 @@ -11,7 +11,7 @@ override_dh_auto_clean: rm -f src/version.texinfo override_dh_auto_build: - dh_auto_build -- -Wall -C src PREFIX=/usr NE_GLOBAL_DIR=/usr/share/ne NE_DEBUG=1 LIBS=-ltinfo + dh_auto_build -- -Wall -C src PREFIX=/usr NE_GLOBAL_DIR=/usr/share/ne LIBS=-ltinfo override_dh_auto_install: dh_auto_install -- DESTDIR=$(BUILDDIR) PREFIX=/usr diff -pruN 3.1.1-1/doc/html/About.html 3.1.2-1/doc/html/About.html --- 3.1.1-1/doc/html/About.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/About.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: About + +About (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Acknowledgments.html 3.1.2-1/doc/html/Acknowledgments.html --- 3.1.1-1/doc/html/Acknowledgments.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Acknowledgments.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Acknowledgments + +Acknowledgments (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/AdjustView.html 3.1.2-1/doc/html/AdjustView.html --- 3.1.1-1/doc/html/AdjustView.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/AdjustView.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: AdjustView + +AdjustView (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Alert.html 3.1.2-1/doc/html/Alert.html --- 3.1.1-1/doc/html/Alert.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Alert.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Alert + +Alert (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Arguments.html 3.1.2-1/doc/html/Arguments.html --- 3.1.1-1/doc/html/Arguments.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Arguments.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Arguments + +Arguments (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/AtomicUndo.html 3.1.2-1/doc/html/AtomicUndo.html --- 3.1.1-1/doc/html/AtomicUndo.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/AtomicUndo.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: AtomicUndo + +AtomicUndo (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/AutoComplete.html 3.1.2-1/doc/html/AutoComplete.html --- 3.1.1-1/doc/html/AutoComplete.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/AutoComplete.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: AutoComplete + +AutoComplete (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/AutoIndent.html 3.1.2-1/doc/html/AutoIndent.html --- 3.1.1-1/doc/html/AutoIndent.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/AutoIndent.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: AutoIndent + +AutoIndent (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/AutoMatchBracket.html 3.1.2-1/doc/html/AutoMatchBracket.html --- 3.1.1-1/doc/html/AutoMatchBracket.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/AutoMatchBracket.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: AutoMatchBracket + +AutoMatchBracket (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Automatic-Preferences.html 3.1.2-1/doc/html/Automatic-Preferences.html --- 3.1.1-1/doc/html/Automatic-Preferences.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Automatic-Preferences.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Automatic Preferences + +Automatic Preferences (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/AutoPrefs.html 3.1.2-1/doc/html/AutoPrefs.html --- 3.1.1-1/doc/html/AutoPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/AutoPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: AutoPrefs + +AutoPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Backspace.html 3.1.2-1/doc/html/Backspace.html --- 3.1.1-1/doc/html/Backspace.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Backspace.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Backspace + +Backspace (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Basic-Macros.html 3.1.2-1/doc/html/Basic-Macros.html --- 3.1.1-1/doc/html/Basic-Macros.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Basic-Macros.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Basic Macros + +Basic Macros (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Basic-Preferences.html 3.1.2-1/doc/html/Basic-Preferences.html --- 3.1.1-1/doc/html/Basic-Preferences.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Basic-Preferences.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Basic Preferences + +Basic Preferences (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Basics.html 3.1.2-1/doc/html/Basics.html --- 3.1.1-1/doc/html/Basics.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Basics.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Basics + +Basics (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Beep.html 3.1.2-1/doc/html/Beep.html --- 3.1.1-1/doc/html/Beep.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Beep.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Beep + +Beep (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Binary.html 3.1.2-1/doc/html/Binary.html --- 3.1.1-1/doc/html/Binary.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Binary.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Binary + +Binary (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Capitalize.html 3.1.2-1/doc/html/Capitalize.html --- 3.1.1-1/doc/html/Capitalize.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Capitalize.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Capitalize + +Capitalize (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/CaseSearch.html 3.1.2-1/doc/html/CaseSearch.html --- 3.1.1-1/doc/html/CaseSearch.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/CaseSearch.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: CaseSearch + +CaseSearch (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Center.html 3.1.2-1/doc/html/Center.html --- 3.1.1-1/doc/html/Center.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Center.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Center + +Center (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Changing-Menus.html 3.1.2-1/doc/html/Changing-Menus.html --- 3.1.1-1/doc/html/Changing-Menus.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Changing-Menus.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Changing Menus + +Changing Menus (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Clear.html 3.1.2-1/doc/html/Clear.html --- 3.1.1-1/doc/html/Clear.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Clear.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Clear + +Clear (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Clip-Commands.html 3.1.2-1/doc/html/Clip-Commands.html --- 3.1.1-1/doc/html/Clip-Commands.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Clip-Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Clip Commands + +Clip Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ClipNumber.html 3.1.2-1/doc/html/ClipNumber.html --- 3.1.1-1/doc/html/ClipNumber.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ClipNumber.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ClipNumber + +ClipNumber (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/CloseDoc.html 3.1.2-1/doc/html/CloseDoc.html --- 3.1.1-1/doc/html/CloseDoc.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/CloseDoc.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: CloseDoc + +CloseDoc (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Command-Index.html 3.1.2-1/doc/html/Command-Index.html --- 3.1.1-1/doc/html/Command-Index.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Command-Index.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Command Index + +Command Index (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Commands.html 3.1.2-1/doc/html/Commands.html --- 3.1.1-1/doc/html/Commands.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Commands + +Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Concept-Index.html 3.1.2-1/doc/html/Concept-Index.html --- 3.1.1-1/doc/html/Concept-Index.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Concept-Index.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Concept Index + +Concept Index (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Configuration.html 3.1.2-1/doc/html/Configuration.html --- 3.1.1-1/doc/html/Configuration.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Configuration.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Configuration + +Configuration (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Copy.html 3.1.2-1/doc/html/Copy.html --- 3.1.1-1/doc/html/Copy.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Copy.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Copy + +Copy (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/CRLF.html 3.1.2-1/doc/html/CRLF.html --- 3.1.1-1/doc/html/CRLF.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/CRLF.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: CRLF + +CRLF (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Cut.html 3.1.2-1/doc/html/Cut.html --- 3.1.1-1/doc/html/Cut.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Cut.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Cut + +Cut (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/DeleteChar.html 3.1.2-1/doc/html/DeleteChar.html --- 3.1.1-1/doc/html/DeleteChar.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/DeleteChar.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: DeleteChar + +DeleteChar (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/DeleteEOL.html 3.1.2-1/doc/html/DeleteEOL.html --- 3.1.1-1/doc/html/DeleteEOL.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/DeleteEOL.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: DeleteEOL + +DeleteEOL (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/DeleteLine.html 3.1.2-1/doc/html/DeleteLine.html --- 3.1.1-1/doc/html/DeleteLine.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/DeleteLine.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: DeleteLine + +DeleteLine (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/DeleteNextWord.html 3.1.2-1/doc/html/DeleteNextWord.html --- 3.1.1-1/doc/html/DeleteNextWord.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/DeleteNextWord.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: DeleteNextWord + +DeleteNextWord (ne’s manual) - - + + - @@ -61,9 +61,10 @@ Next: Syntax: DeleteNextWord [n]
Abbreviation: DNW

-

deletes text from the current position to the next word n -times. If the optional n argument is not specified, it is assumed to be -one. +

deletes text from the current position to the n’th next end-of-word +If the optional n argument is not specified, it is assumed to be +one (in which case, if the cursor is in the middle of a word the effect is +just to delete to the end of that word).

diff -pruN 3.1.1-1/doc/html/DeletePrevWord.html 3.1.2-1/doc/html/DeletePrevWord.html --- 3.1.1-1/doc/html/DeletePrevWord.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/DeletePrevWord.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: DeletePrevWord + +DeletePrevWord (ne’s manual) - - + + - @@ -61,8 +61,8 @@ Next:
- + -ne’s manual: DelTabs + +DelTabs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Document-Commands.html 3.1.2-1/doc/html/Document-Commands.html --- 3.1.1-1/doc/html/Document-Commands.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Document-Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Document Commands + +Document Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Documents.html 3.1.2-1/doc/html/Documents.html --- 3.1.1-1/doc/html/Documents.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Documents.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Documents + +Documents (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/DoUndo.html 3.1.2-1/doc/html/DoUndo.html --- 3.1.1-1/doc/html/DoUndo.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/DoUndo.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: DoUndo + +DoUndo (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Edit.html 3.1.2-1/doc/html/Edit.html --- 3.1.1-1/doc/html/Edit.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Edit.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Edit + +Edit (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Editing-Commands.html 3.1.2-1/doc/html/Editing-Commands.html --- 3.1.1-1/doc/html/Editing-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Editing-Commands.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Editing Commands + +Editing Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Editing.html 3.1.2-1/doc/html/Editing.html --- 3.1.1-1/doc/html/Editing.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Editing.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Editing + +Editing (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Emergency-Save.html 3.1.2-1/doc/html/Emergency-Save.html --- 3.1.1-1/doc/html/Emergency-Save.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Emergency-Save.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Emergency Save + +Emergency Save (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Erase.html 3.1.2-1/doc/html/Erase.html --- 3.1.1-1/doc/html/Erase.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Erase.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Erase + +Erase (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Escape.html 3.1.2-1/doc/html/Escape.html --- 3.1.1-1/doc/html/Escape.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Escape.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Escape + +Escape (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/EscapeTime.html 3.1.2-1/doc/html/EscapeTime.html --- 3.1.1-1/doc/html/EscapeTime.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/EscapeTime.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: EscapeTime + +EscapeTime (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Exec.html 3.1.2-1/doc/html/Exec.html --- 3.1.1-1/doc/html/Exec.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Exec.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Exec + +Exec (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Exit.html 3.1.2-1/doc/html/Exit.html --- 3.1.1-1/doc/html/Exit.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Exit.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Exit + +Exit (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Extras.html 3.1.2-1/doc/html/Extras.html --- 3.1.1-1/doc/html/Extras.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Extras.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Extras + +Extras (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/FastGUI.html 3.1.2-1/doc/html/FastGUI.html --- 3.1.1-1/doc/html/FastGUI.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/FastGUI.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: FastGUI + +FastGUI (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/File-Commands.html 3.1.2-1/doc/html/File-Commands.html --- 3.1.1-1/doc/html/File-Commands.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/File-Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: File Commands + +File Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/File.html 3.1.2-1/doc/html/File.html --- 3.1.1-1/doc/html/File.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/File.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: File + +File (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Find.html 3.1.2-1/doc/html/Find.html --- 3.1.1-1/doc/html/Find.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Find.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Find + +Find (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/FindRegExp.html 3.1.2-1/doc/html/FindRegExp.html --- 3.1.1-1/doc/html/FindRegExp.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/FindRegExp.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: FindRegExp + +FindRegExp (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Flags.html 3.1.2-1/doc/html/Flags.html --- 3.1.1-1/doc/html/Flags.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Flags.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Flags + +Flags (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Flash.html 3.1.2-1/doc/html/Flash.html --- 3.1.1-1/doc/html/Flash.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Flash.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Flash + +Flash (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Formatting-Commands.html 3.1.2-1/doc/html/Formatting-Commands.html --- 3.1.1-1/doc/html/Formatting-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Formatting-Commands.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Formatting Commands + +Formatting Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/FreeForm.html 3.1.2-1/doc/html/FreeForm.html --- 3.1.1-1/doc/html/FreeForm.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/FreeForm.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: FreeForm + +FreeForm (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/General-Guidelines.html 3.1.2-1/doc/html/General-Guidelines.html --- 3.1.1-1/doc/html/General-Guidelines.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/General-Guidelines.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: General Guidelines + +General Guidelines (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/GotoBookmark.html 3.1.2-1/doc/html/GotoBookmark.html --- 3.1.1-1/doc/html/GotoBookmark.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/GotoBookmark.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: GotoBookmark + +GotoBookmark (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/GotoColumn.html 3.1.2-1/doc/html/GotoColumn.html --- 3.1.1-1/doc/html/GotoColumn.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/GotoColumn.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: GotoColumn + +GotoColumn (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/GotoLine.html 3.1.2-1/doc/html/GotoLine.html --- 3.1.1-1/doc/html/GotoLine.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/GotoLine.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: GotoLine + +GotoLine (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/GotoMark.html 3.1.2-1/doc/html/GotoMark.html --- 3.1.1-1/doc/html/GotoMark.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/GotoMark.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: GotoMark + +GotoMark (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Help.html 3.1.2-1/doc/html/Help.html --- 3.1.1-1/doc/html/Help.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Help.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Help + +Help (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/HexCode.html 3.1.2-1/doc/html/HexCode.html --- 3.1.1-1/doc/html/HexCode.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/HexCode.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: HexCode + +HexCode (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Hints-and-Tricks.html 3.1.2-1/doc/html/Hints-and-Tricks.html --- 3.1.1-1/doc/html/Hints-and-Tricks.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Hints-and-Tricks.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Hints and Tricks + +Hints and Tricks (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/History.html 3.1.2-1/doc/html/History.html --- 3.1.1-1/doc/html/History.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/History.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: History + +History (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/index.html 3.1.2-1/doc/html/index.html --- 3.1.1-1/doc/html/index.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/index.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Top + +Top (ne’s manual) - - + + - @@ -64,13 +64,13 @@ Next: -

This file describes ne version 3.1.1, a free text editor that runs +

This file describes ne version 3.1.2, a free text editor that runs (we hope) on almost any UN*X machine. ne is easy to use for the beginner, but powerful and fully configurable for the wizard, and most sparing in its resource use.

Copyright (C) 1993-1998 Sebastiano Vigna
-Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna +Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna

diff -pruN 3.1.1-1/doc/html/InsertChar.html 3.1.2-1/doc/html/InsertChar.html --- 3.1.1-1/doc/html/InsertChar.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/InsertChar.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: InsertChar + +InsertChar (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Insert.html 3.1.2-1/doc/html/Insert.html --- 3.1.1-1/doc/html/Insert.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Insert.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Insert + +Insert (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/InsertLine.html 3.1.2-1/doc/html/InsertLine.html --- 3.1.1-1/doc/html/InsertLine.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/InsertLine.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: InsertLine + +InsertLine (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/InsertString.html 3.1.2-1/doc/html/InsertString.html --- 3.1.1-1/doc/html/InsertString.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/InsertString.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: InsertString + +InsertString (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/InsertTab.html 3.1.2-1/doc/html/InsertTab.html --- 3.1.1-1/doc/html/InsertTab.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/InsertTab.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: InsertTab + +InsertTab (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Introduction.html 3.1.2-1/doc/html/Introduction.html --- 3.1.1-1/doc/html/Introduction.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Introduction.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Introduction + +Introduction (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Key-Bindings.html 3.1.2-1/doc/html/Key-Bindings.html --- 3.1.1-1/doc/html/Key-Bindings.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Key-Bindings.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Key Bindings + +Key Bindings (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/KeyCode.html 3.1.2-1/doc/html/KeyCode.html --- 3.1.1-1/doc/html/KeyCode.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/KeyCode.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: KeyCode + +KeyCode (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/LineDown.html 3.1.2-1/doc/html/LineDown.html --- 3.1.1-1/doc/html/LineDown.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/LineDown.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: LineDown + +LineDown (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/LineUp.html 3.1.2-1/doc/html/LineUp.html --- 3.1.1-1/doc/html/LineUp.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/LineUp.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: LineUp + +LineUp (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/LoadAutoPrefs.html 3.1.2-1/doc/html/LoadAutoPrefs.html --- 3.1.1-1/doc/html/LoadAutoPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/LoadAutoPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: LoadAutoPrefs + +LoadAutoPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Loading-and-Saving.html 3.1.2-1/doc/html/Loading-and-Saving.html --- 3.1.1-1/doc/html/Loading-and-Saving.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Loading-and-Saving.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Loading and Saving + +Loading and Saving (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/LoadPrefs.html 3.1.2-1/doc/html/LoadPrefs.html --- 3.1.1-1/doc/html/LoadPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/LoadPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: LoadPrefs + +LoadPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Macro.html 3.1.2-1/doc/html/Macro.html --- 3.1.1-1/doc/html/Macro.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Macro.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Macro + +Macro (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Macros-Commands.html 3.1.2-1/doc/html/Macros-Commands.html --- 3.1.1-1/doc/html/Macros-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Macros-Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Macros Commands + +Macros Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Macros.html 3.1.2-1/doc/html/Macros.html --- 3.1.1-1/doc/html/Macros.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Macros.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Macros + +Macros (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Mark.html 3.1.2-1/doc/html/Mark.html --- 3.1.1-1/doc/html/Mark.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Mark.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Mark + +Mark (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MarkVert.html 3.1.2-1/doc/html/MarkVert.html --- 3.1.1-1/doc/html/MarkVert.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/MarkVert.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MarkVert + +MarkVert (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MatchBracket.html 3.1.2-1/doc/html/MatchBracket.html --- 3.1.1-1/doc/html/MatchBracket.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MatchBracket.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MatchBracket + +MatchBracket (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Menus.html 3.1.2-1/doc/html/Menus.html --- 3.1.1-1/doc/html/Menus.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Menus.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Menus + +Menus (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Modified.html 3.1.2-1/doc/html/Modified.html --- 3.1.1-1/doc/html/Modified.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Modified.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Modified + +Modified (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/More-Advanced-Features.html 3.1.2-1/doc/html/More-Advanced-Features.html --- 3.1.1-1/doc/html/More-Advanced-Features.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/More-Advanced-Features.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: More Advanced Features + +More Advanced Features (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Motivations-and-Design.html 3.1.2-1/doc/html/Motivations-and-Design.html --- 3.1.1-1/doc/html/Motivations-and-Design.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Motivations-and-Design.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Motivations and Design + +Motivations and Design (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveBOS.html 3.1.2-1/doc/html/MoveBOS.html --- 3.1.1-1/doc/html/MoveBOS.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveBOS.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveBOS + +MoveBOS (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveEOF.html 3.1.2-1/doc/html/MoveEOF.html --- 3.1.1-1/doc/html/MoveEOF.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveEOF.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveEOF + +MoveEOF (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveEOL.html 3.1.2-1/doc/html/MoveEOL.html --- 3.1.1-1/doc/html/MoveEOL.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveEOL.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveEOL + +MoveEOL (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveEOW.html 3.1.2-1/doc/html/MoveEOW.html --- 3.1.1-1/doc/html/MoveEOW.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveEOW.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveEOW + +MoveEOW (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveIncDown.html 3.1.2-1/doc/html/MoveIncDown.html --- 3.1.1-1/doc/html/MoveIncDown.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveIncDown.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveIncDown + +MoveIncDown (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveIncUp.html 3.1.2-1/doc/html/MoveIncUp.html --- 3.1.1-1/doc/html/MoveIncUp.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveIncUp.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveIncUp + +MoveIncUp (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveLeft.html 3.1.2-1/doc/html/MoveLeft.html --- 3.1.1-1/doc/html/MoveLeft.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveLeft.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveLeft + +MoveLeft (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveRight.html 3.1.2-1/doc/html/MoveRight.html --- 3.1.1-1/doc/html/MoveRight.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveRight.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveRight + +MoveRight (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveSOF.html 3.1.2-1/doc/html/MoveSOF.html --- 3.1.1-1/doc/html/MoveSOF.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveSOF.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveSOF + +MoveSOF (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveSOL.html 3.1.2-1/doc/html/MoveSOL.html --- 3.1.1-1/doc/html/MoveSOL.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveSOL.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveSOL + +MoveSOL (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/MoveTOS.html 3.1.2-1/doc/html/MoveTOS.html --- 3.1.1-1/doc/html/MoveTOS.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/MoveTOS.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: MoveTOS + +MoveTOS (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NameConvert.html 3.1.2-1/doc/html/NameConvert.html --- 3.1.1-1/doc/html/NameConvert.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/NameConvert.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NameConvert + +NameConvert (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Navigation-Commands.html 3.1.2-1/doc/html/Navigation-Commands.html --- 3.1.1-1/doc/html/Navigation-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Navigation-Commands.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Navigation Commands + +Navigation Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Navigation.html 3.1.2-1/doc/html/Navigation.html --- 3.1.1-1/doc/html/Navigation.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Navigation.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Navigation + +Navigation (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NewDoc.html 3.1.2-1/doc/html/NewDoc.html --- 3.1.1-1/doc/html/NewDoc.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/NewDoc.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NewDoc + +NewDoc (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NextDoc.html 3.1.2-1/doc/html/NextDoc.html --- 3.1.1-1/doc/html/NextDoc.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/NextDoc.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NextDoc + +NextDoc (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NextPage.html 3.1.2-1/doc/html/NextPage.html --- 3.1.1-1/doc/html/NextPage.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/NextPage.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NextPage + +NextPage (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NextWord.html 3.1.2-1/doc/html/NextWord.html --- 3.1.1-1/doc/html/NextWord.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/NextWord.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NextWord + +NextWord (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NoFileReq.html 3.1.2-1/doc/html/NoFileReq.html --- 3.1.1-1/doc/html/NoFileReq.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/NoFileReq.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NoFileReq + +NoFileReq (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/NOP.html 3.1.2-1/doc/html/NOP.html --- 3.1.1-1/doc/html/NOP.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/NOP.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: NOP + +NOP (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/OpenClip.html 3.1.2-1/doc/html/OpenClip.html --- 3.1.1-1/doc/html/OpenClip.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/OpenClip.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: OpenClip + +OpenClip (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Open.html 3.1.2-1/doc/html/Open.html --- 3.1.1-1/doc/html/Open.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Open.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Open + +Open (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/OpenMacro.html 3.1.2-1/doc/html/OpenMacro.html --- 3.1.1-1/doc/html/OpenMacro.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/OpenMacro.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: OpenMacro + +OpenMacro (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/OpenNew.html 3.1.2-1/doc/html/OpenNew.html --- 3.1.1-1/doc/html/OpenNew.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/OpenNew.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: OpenNew + +OpenNew (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PageDown.html 3.1.2-1/doc/html/PageDown.html --- 3.1.1-1/doc/html/PageDown.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PageDown.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PageDown + +PageDown (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PageUp.html 3.1.2-1/doc/html/PageUp.html --- 3.1.1-1/doc/html/PageUp.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PageUp.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PageUp + +PageUp (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Paragraph.html 3.1.2-1/doc/html/Paragraph.html --- 3.1.1-1/doc/html/Paragraph.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Paragraph.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Paragraph + +Paragraph (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Paste.html 3.1.2-1/doc/html/Paste.html --- 3.1.1-1/doc/html/Paste.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Paste.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Paste + +Paste (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PasteVert.html 3.1.2-1/doc/html/PasteVert.html --- 3.1.1-1/doc/html/PasteVert.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/PasteVert.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PasteVert + +PasteVert (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Play.html 3.1.2-1/doc/html/Play.html --- 3.1.1-1/doc/html/Play.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Play.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Play + +Play (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PopPrefs.html 3.1.2-1/doc/html/PopPrefs.html --- 3.1.1-1/doc/html/PopPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PopPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PopPrefs + +PopPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Portability-Problems.html 3.1.2-1/doc/html/Portability-Problems.html --- 3.1.1-1/doc/html/Portability-Problems.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Portability-Problems.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Portability Problems + +Portability Problems (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Preferences-Commands.html 3.1.2-1/doc/html/Preferences-Commands.html --- 3.1.1-1/doc/html/Preferences-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Preferences-Commands.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Preferences Commands + +Preferences Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Prefs.html 3.1.2-1/doc/html/Prefs.html --- 3.1.1-1/doc/html/Prefs.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Prefs.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Prefs + +Prefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PreserveCR.html 3.1.2-1/doc/html/PreserveCR.html --- 3.1.1-1/doc/html/PreserveCR.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PreserveCR.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PreserveCR + +PreserveCR (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PrevDoc.html 3.1.2-1/doc/html/PrevDoc.html --- 3.1.1-1/doc/html/PrevDoc.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/PrevDoc.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PrevDoc + +PrevDoc (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PrevPage.html 3.1.2-1/doc/html/PrevPage.html --- 3.1.1-1/doc/html/PrevPage.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PrevPage.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PrevPage + +PrevPage (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PrevWord.html 3.1.2-1/doc/html/PrevWord.html --- 3.1.1-1/doc/html/PrevWord.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PrevWord.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PrevWord + +PrevWord (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/PushPrefs.html 3.1.2-1/doc/html/PushPrefs.html --- 3.1.1-1/doc/html/PushPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/PushPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: PushPrefs + +PushPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Quit.html 3.1.2-1/doc/html/Quit.html --- 3.1.1-1/doc/html/Quit.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Quit.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Quit + +Quit (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ReadOnly.html 3.1.2-1/doc/html/ReadOnly.html --- 3.1.1-1/doc/html/ReadOnly.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ReadOnly.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ReadOnly + +ReadOnly (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Record.html 3.1.2-1/doc/html/Record.html --- 3.1.1-1/doc/html/Record.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Record.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Record + +Record (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Redo.html 3.1.2-1/doc/html/Redo.html --- 3.1.1-1/doc/html/Redo.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Redo.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Redo + +Redo (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Reference.html 3.1.2-1/doc/html/Reference.html --- 3.1.1-1/doc/html/Reference.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Reference.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Reference + +Reference (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Refresh.html 3.1.2-1/doc/html/Refresh.html --- 3.1.1-1/doc/html/Refresh.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Refresh.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Refresh + +Refresh (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Regular-Expressions.html 3.1.2-1/doc/html/Regular-Expressions.html --- 3.1.1-1/doc/html/Regular-Expressions.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Regular-Expressions.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Regular Expressions + +Regular Expressions (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/RepeatLast.html 3.1.2-1/doc/html/RepeatLast.html --- 3.1.1-1/doc/html/RepeatLast.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/RepeatLast.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: RepeatLast + +RepeatLast (ne’s manual) - - + + - @@ -58,12 +58,13 @@ Next: 4.5.6 RepeatLast -

Syntax: RepeatLast [times]
+

Syntax: RepeatLast [times] [F|Find|R|Replace]
Abbreviation: RL

repeats for the given number of times the last find or replace operation (with replace we mean here a single replace, even if the last Replace -operation ended with a global substitution). +operation ended with a global substitution). If you don’t specify either +Find or Replace, it will repeat whichever one was last performed.

If any find or replace operation runs into the end of the document (in the direction indicated by the SearchBack flag) and stops, then and only then will a diff -pruN 3.1.1-1/doc/html/ReplaceAll.html 3.1.2-1/doc/html/ReplaceAll.html --- 3.1.1-1/doc/html/ReplaceAll.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ReplaceAll.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ReplaceAll + +ReplaceAll (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Replace.html 3.1.2-1/doc/html/Replace.html --- 3.1.1-1/doc/html/Replace.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Replace.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Replace + +Replace (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ReplaceOnce.html 3.1.2-1/doc/html/ReplaceOnce.html --- 3.1.1-1/doc/html/ReplaceOnce.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ReplaceOnce.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ReplaceOnce + +ReplaceOnce (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/RequestOrder.html 3.1.2-1/doc/html/RequestOrder.html --- 3.1.1-1/doc/html/RequestOrder.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/RequestOrder.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: RequestOrder + +RequestOrder (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/RightMargin.html 3.1.2-1/doc/html/RightMargin.html --- 3.1.1-1/doc/html/RightMargin.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/RightMargin.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: RightMargin + +RightMargin (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SaveAll.html 3.1.2-1/doc/html/SaveAll.html --- 3.1.1-1/doc/html/SaveAll.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/SaveAll.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SaveAll + +SaveAll (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SaveAs.html 3.1.2-1/doc/html/SaveAs.html --- 3.1.1-1/doc/html/SaveAs.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/SaveAs.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SaveAs + +SaveAs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SaveAutoPrefs.html 3.1.2-1/doc/html/SaveAutoPrefs.html --- 3.1.1-1/doc/html/SaveAutoPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SaveAutoPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SaveAutoPrefs + +SaveAutoPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SaveClip.html 3.1.2-1/doc/html/SaveClip.html --- 3.1.1-1/doc/html/SaveClip.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SaveClip.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SaveClip + +SaveClip (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SaveDefPrefs.html 3.1.2-1/doc/html/SaveDefPrefs.html --- 3.1.1-1/doc/html/SaveDefPrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SaveDefPrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SaveDefPrefs + +SaveDefPrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Save.html 3.1.2-1/doc/html/Save.html --- 3.1.1-1/doc/html/Save.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Save.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Save + +Save (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SaveMacro.html 3.1.2-1/doc/html/SaveMacro.html --- 3.1.1-1/doc/html/SaveMacro.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SaveMacro.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SaveMacro + +SaveMacro (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SavePrefs.html 3.1.2-1/doc/html/SavePrefs.html --- 3.1.1-1/doc/html/SavePrefs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SavePrefs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SavePrefs + +SavePrefs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SearchBack.html 3.1.2-1/doc/html/SearchBack.html --- 3.1.1-1/doc/html/SearchBack.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SearchBack.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SearchBack + +SearchBack (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Search-Commands.html 3.1.2-1/doc/html/Search-Commands.html --- 3.1.1-1/doc/html/Search-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Search-Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Search Commands + +Search Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Search.html 3.1.2-1/doc/html/Search.html --- 3.1.1-1/doc/html/Search.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Search.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Search + +Search (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SelectDoc.html 3.1.2-1/doc/html/SelectDoc.html --- 3.1.1-1/doc/html/SelectDoc.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/SelectDoc.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SelectDoc + +SelectDoc (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/SetBookmark.html 3.1.2-1/doc/html/SetBookmark.html --- 3.1.1-1/doc/html/SetBookmark.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/SetBookmark.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: SetBookmark + +SetBookmark (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Shift.html 3.1.2-1/doc/html/Shift.html --- 3.1.1-1/doc/html/Shift.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Shift.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Shift + +Shift (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ShiftTabs.html 3.1.2-1/doc/html/ShiftTabs.html --- 3.1.1-1/doc/html/ShiftTabs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ShiftTabs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ShiftTabs + +ShiftTabs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Starting.html 3.1.2-1/doc/html/Starting.html --- 3.1.1-1/doc/html/Starting.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Starting.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Starting + +Starting (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/StatusBar.html 3.1.2-1/doc/html/StatusBar.html --- 3.1.1-1/doc/html/StatusBar.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/StatusBar.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: StatusBar + +StatusBar (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Support-Commands.html 3.1.2-1/doc/html/Support-Commands.html --- 3.1.1-1/doc/html/Support-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Support-Commands.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Support Commands + +Support Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Suspend.html 3.1.2-1/doc/html/Suspend.html --- 3.1.1-1/doc/html/Suspend.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Suspend.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Suspend + +Suspend (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Syntax-Highlighting.html 3.1.2-1/doc/html/Syntax-Highlighting.html --- 3.1.1-1/doc/html/Syntax-Highlighting.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Syntax-Highlighting.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Syntax Highlighting + +Syntax Highlighting (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Syntax.html 3.1.2-1/doc/html/Syntax.html --- 3.1.1-1/doc/html/Syntax.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Syntax.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Syntax + +Syntax (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/System.html 3.1.2-1/doc/html/System.html --- 3.1.1-1/doc/html/System.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/System.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: System + +System (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Tabs.html 3.1.2-1/doc/html/Tabs.html --- 3.1.1-1/doc/html/Tabs.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Tabs.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Tabs + +Tabs (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/TabSize.html 3.1.2-1/doc/html/TabSize.html --- 3.1.1-1/doc/html/TabSize.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/TabSize.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: TabSize + +TabSize (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Terminology.html 3.1.2-1/doc/html/Terminology.html --- 3.1.1-1/doc/html/Terminology.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/Terminology.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Terminology + +Terminology (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/The-Command-Line.html 3.1.2-1/doc/html/The-Command-Line.html --- 3.1.1-1/doc/html/The-Command-Line.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/The-Command-Line.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: The Command Line + +The Command Line (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/The-Encoding-Mess.html 3.1.2-1/doc/html/The-Encoding-Mess.html --- 3.1.1-1/doc/html/The-Encoding-Mess.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/The-Encoding-Mess.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: The Encoding Mess + +The Encoding Mess (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/The-Input-Line.html 3.1.2-1/doc/html/The-Input-Line.html --- 3.1.1-1/doc/html/The-Input-Line.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/The-Input-Line.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: The Input Line + +The Input Line (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/The-Requester.html 3.1.2-1/doc/html/The-Requester.html --- 3.1.1-1/doc/html/The-Requester.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/The-Requester.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: The Requester + +The Requester (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/The-Status-Bar.html 3.1.2-1/doc/html/The-Status-Bar.html --- 3.1.1-1/doc/html/The-Status-Bar.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/The-Status-Bar.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: The Status Bar + +The Status Bar (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Through.html 3.1.2-1/doc/html/Through.html --- 3.1.1-1/doc/html/Through.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Through.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Through + +Through (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ToggleSEOF.html 3.1.2-1/doc/html/ToggleSEOF.html --- 3.1.1-1/doc/html/ToggleSEOF.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ToggleSEOF.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ToggleSEOF + +ToggleSEOF (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ToggleSEOL.html 3.1.2-1/doc/html/ToggleSEOL.html --- 3.1.1-1/doc/html/ToggleSEOL.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ToggleSEOL.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ToggleSEOL + +ToggleSEOL (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ToLower.html 3.1.2-1/doc/html/ToLower.html --- 3.1.1-1/doc/html/ToLower.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ToLower.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ToLower + +ToLower (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/ToUpper.html 3.1.2-1/doc/html/ToUpper.html --- 3.1.1-1/doc/html/ToUpper.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/ToUpper.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: ToUpper + +ToUpper (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Turbo.html 3.1.2-1/doc/html/Turbo.html --- 3.1.1-1/doc/html/Turbo.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Turbo.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Turbo + +Turbo (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UndelLine.html 3.1.2-1/doc/html/UndelLine.html --- 3.1.1-1/doc/html/UndelLine.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/UndelLine.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UndelLine + +UndelLine (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Undo-Commands.html 3.1.2-1/doc/html/Undo-Commands.html --- 3.1.1-1/doc/html/Undo-Commands.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Undo-Commands.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Undo Commands + +Undo Commands (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Undo.html 3.1.2-1/doc/html/Undo.html --- 3.1.1-1/doc/html/Undo.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Undo.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Undo + +Undo (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UnloadMacros.html 3.1.2-1/doc/html/UnloadMacros.html --- 3.1.1-1/doc/html/UnloadMacros.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/UnloadMacros.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UnloadMacros + +UnloadMacros (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UnsetBookmark.html 3.1.2-1/doc/html/UnsetBookmark.html --- 3.1.1-1/doc/html/UnsetBookmark.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/UnsetBookmark.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UnsetBookmark + +UnsetBookmark (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UTF_002d8-Support.html 3.1.2-1/doc/html/UTF_002d8-Support.html --- 3.1.1-1/doc/html/UTF_002d8-Support.html 2017-06-04 20:43:41.000000000 +0000 +++ 3.1.2-1/doc/html/UTF_002d8-Support.html 2018-10-06 09:56:03.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UTF-8 Support + +UTF-8 Support (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UTF8Auto.html 3.1.2-1/doc/html/UTF8Auto.html --- 3.1.1-1/doc/html/UTF8Auto.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/UTF8Auto.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UTF8Auto + +UTF8Auto (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UTF8.html 3.1.2-1/doc/html/UTF8.html --- 3.1.1-1/doc/html/UTF8.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/UTF8.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UTF8 + +UTF8 (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/UTF8IO.html 3.1.2-1/doc/html/UTF8IO.html --- 3.1.1-1/doc/html/UTF8IO.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/UTF8IO.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: UTF8IO + +UTF8IO (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/VerboseMacros.html 3.1.2-1/doc/html/VerboseMacros.html --- 3.1.1-1/doc/html/VerboseMacros.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/VerboseMacros.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: VerboseMacros + +VerboseMacros (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/Virtual-Extensions.html 3.1.2-1/doc/html/Virtual-Extensions.html --- 3.1.1-1/doc/html/Virtual-Extensions.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/Virtual-Extensions.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: Virtual Extensions + +Virtual Extensions (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/VisualBell.html 3.1.2-1/doc/html/VisualBell.html --- 3.1.1-1/doc/html/VisualBell.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/VisualBell.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: VisualBell + +VisualBell (ne’s manual) - - + + - diff -pruN 3.1.1-1/doc/html/WordWrap.html 3.1.2-1/doc/html/WordWrap.html --- 3.1.1-1/doc/html/WordWrap.html 2017-06-04 20:43:42.000000000 +0000 +++ 3.1.2-1/doc/html/WordWrap.html 2018-10-06 09:56:04.000000000 +0000 @@ -1,15 +1,15 @@ - + -ne’s manual: WordWrap + +WordWrap (ne’s manual) - - + + - Binary files 3.1.1-1/doc/ne.info-e.gz and 3.1.2-1/doc/ne.info-e.gz differ Binary files 3.1.1-1/doc/ne.info.gz and 3.1.2-1/doc/ne.info.gz differ Binary files 3.1.1-1/doc/ne.pdf and 3.1.2-1/doc/ne.pdf differ diff -pruN 3.1.1-1/doc/ne.texinfo 3.1.2-1/doc/ne.texinfo --- 3.1.1-1/doc/ne.texinfo 2017-06-01 06:03:44.000000000 +0000 +++ 3.1.2-1/doc/ne.texinfo 2018-10-04 15:00:02.000000000 +0000 @@ -3067,12 +3067,13 @@ pattern replaced by @code{ReplaceAll}. S @subsection RepeatLast @cmindex RepeatLast -@noindent Syntax: @code{RepeatLast [@var{times}]}@* +@noindent Syntax: @code{RepeatLast [@var{times}] [F|Find|R|Replace]}@* @noindent Abbreviation: @code{RL} @noindent repeats for the given number of times the last find or replace operation (with replace we mean here a single replace, even if the last @code{Replace} -operation ended with a global substitution). +operation ended with a global substitution). If you don't specify either +@var{Find} or @var{Replace}, it will repeat whichever one was last performed. If any find or replace operation runs into the end of the document (in the direction indicated by the @code{SearchBack} flag) and stops, then and only then will a @@ -5088,8 +5089,8 @@ no action will be performed. @noindent Syntax: @code{DeletePrevWord [@var{n}]}@* @noindent Abbreviation: @code{DPW} -@noindent deletes text from the current position to the first character of the -previous word @var{n} times. If the optional @var{n} argument is not specified, +@noindent deletes text from the current position through the first character of the +@var{n}'th previous start-of-word. If the optional @var{n} argument is not specified, it is assumed to be one (in which case, if the cursor is in the middle of a word the effect is just to delete to the start of that word). @@ -5103,9 +5104,10 @@ word the effect is just to delete to the @noindent Syntax: @code{DeleteNextWord [@var{n}]}@* @noindent Abbreviation: @code{DNW} -@noindent deletes text from the current position to the next word @var{n} -times. If the optional @var{n} argument is not specified, it is assumed to be -one. +@noindent deletes text from the current position to the @var{n}'th next end-of-word +If the optional @var{n} argument is not specified, it is assumed to be +one (in which case, if the cursor is in the middle of a word the effect is +just to delete to the end of that word). diff -pruN 3.1.1-1/doc/ne.txt 3.1.2-1/doc/ne.txt --- 3.1.1-1/doc/ne.txt 2017-06-04 20:43:40.000000000 +0000 +++ 3.1.2-1/doc/ne.txt 2018-10-06 09:56:02.000000000 +0000 @@ -1,6 +1,6 @@ -This file documents ne 3.1.1, a free text editor for UN*X. +This file documents ne 3.1.2, a free text editor for UN*X. - Copyright (C) 1993-1998 Sebastiano Vigna. Copyright (C) 1999-2017 + Copyright (C) 1993-1998 Sebastiano Vigna. Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna. Permission is granted to make and distribute verbatim copies of this @@ -20,13 +20,13 @@ translation approved by the Free Softwar ne's manual ************* -This file describes ne version 3.1.1, a free text editor that runs (we +This file describes ne version 3.1.2, a free text editor that runs (we hope) on almost any UN*X machine. ne is easy to use for the beginner, but powerful and fully configurable for the wizard, and most sparing in its resource use. Copyright (C) 1993-1998 Sebastiano Vigna -Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna +Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna 1 Introduction ************** @@ -2541,12 +2541,13 @@ search pattern replaced by 'ReplaceAll'. 4.5.6 RepeatLast ---------------- -Syntax: 'RepeatLast [TIMES]' +Syntax: 'RepeatLast [TIMES] [F|Find|R|Replace]' Abbreviation: 'RL' repeats for the given number of times the last find or replace operation (with replace we mean here a single replace, even if the last 'Replace' -operation ended with a global substitution). +operation ended with a global substitution). If you don't specify +either FIND or REPLACE, it will repeat whichever one was last performed. If any find or replace operation runs into the end of the document (in the direction indicated by the 'SearchBack' flag) and stops, then @@ -4116,10 +4117,11 @@ line, no action will be performed. Syntax: 'DeletePrevWord [N]' Abbreviation: 'DPW' -deletes text from the current position to the first character of the -previous word N times. If the optional N argument is not specified, it -is assumed to be one (in which case, if the cursor is in the middle of a -word the effect is just to delete to the start of that word). +deletes text from the current position through the first character of +the N'th previous start-of-word. If the optional N argument is not +specified, it is assumed to be one (in which case, if the cursor is in +the middle of a word the effect is just to delete to the start of that +word). 4.11.6 DeleteNextWord --------------------- @@ -4127,8 +4129,10 @@ word the effect is just to delete to the Syntax: 'DeleteNextWord [N]' Abbreviation: 'DNW' -deletes text from the current position to the next word N times. If the -optional N argument is not specified, it is assumed to be one. +deletes text from the current position to the N'th next end-of-word If +the optional N argument is not specified, it is assumed to be one (in +which case, if the cursor is in the middle of a word the effect is just +to delete to the end of that word). 4.11.7 Backspace ---------------- @@ -5017,7 +5021,7 @@ Concept Index * Menu: -* Amiga: History. (line 4903) +* Amiga: History. (line 4907) * Arguments: Arguments. (line 708) * Automatic Bracket Matching: More Advanced Features. (line 569) @@ -5028,13 +5032,13 @@ Concept Index (line 1857) * Binary files: More Advanced Features. (line 569) -* Binary files <1>: Binary. (line 3123) +* Binary files <1>: Binary. (line 3124) * Block operations: Editing. (line 296) * Bookmarks: More Advanced Features. (line 569) * Buffer: Terminology. (line 110) * Caching a macro: Basic Macros. (line 433) -* Changing colors: Hints and Tricks. (line 4573) +* Changing colors: Hints and Tricks. (line 4577) * Clip usage: Editing. (line 296) * Closing a document: Loading and Saving. (line 237) * Command arguments: General Guidelines. (line 1956) @@ -5042,23 +5046,23 @@ Concept Index * Command line <1>: The Command Line. (line 1047) * Commands: Commands. (line 1947) * Comments in a macro: Basic Macros. (line 433) -* Configuring the keyboard: Key Bindings. (line 4350) -* Configuring the menus: Changing Menus. (line 4473) +* Configuring the keyboard: Key Bindings. (line 4354) +* Configuring the menus: Changing Menus. (line 4477) * Control key: Starting. (line 145) * curses: Motivations and Design. - (line 4711) + (line 4715) * Deleting characters: Editing. (line 296) * Deleting lines: Editing. (line 296) * Document: Terminology. (line 110) * Emergency Save: Emergency Save. (line 1885) * Escape conventions: General Guidelines. (line 1956) -* Escape usage: Hints and Tricks. (line 4573) +* Escape usage: Hints and Tricks. (line 4577) * Escaping an input: The Input Line. (line 969) * Executing a macro: Basic Macros. (line 433) * Executing UNI*X commands: More Advanced Features. (line 568) * Exiting: Loading and Saving. (line 237) -* Extension by Content: Virtual Extensions. (line 4515) +* Extension by Content: Virtual Extensions. (line 4519) * Fast GUI: The Status Bar. (line 840) * Features: Introduction. (line 33) * File: Terminology. (line 110) @@ -5076,14 +5080,14 @@ Concept Index * Insert mode: Basic Preferences. (line 361) * Interrupt character: Basic Macros. (line 433) * Interrupt character <1>: Motivations and Design. - (line 4711) + (line 4715) * Interrupting a macro: Basic Macros. (line 433) * Interrupting directory scanning: The Requester. (line 1074) -* ISO-8859 family: The Encoding Mess. (line 4853) -* ISO-8859-1: The Encoding Mess. (line 4853) -* Key bindings: Key Bindings. (line 4350) +* ISO-8859 family: The Encoding Mess. (line 4857) +* ISO-8859-1: The Encoding Mess. (line 4857) +* Key bindings: Key Bindings. (line 4354) * Keyboard usage: Starting. (line 145) -* Large files: Hints and Tricks. (line 4573) +* Large files: Hints and Tricks. (line 4577) * Line and column numbers: The Status Bar. (line 840) * LITHP: Introduction. (line 33) * Loading a file: Loading and Saving. (line 237) @@ -5091,29 +5095,29 @@ Concept Index * Long names: General Guidelines. (line 1956) * Macro definition: Basic Macros. (line 433) * Magic cookie terminals: Motivations and Design. - (line 4711) + (line 4715) * Menu bar: Starting. (line 145) * Menu usage: Starting. (line 145) * Menus: Menus. (line 1242) * Meta key: Starting. (line 145) -* Meta key <1>: Configuration. (line 4338) -* Meta key <2>: Hints and Tricks. (line 4573) +* Meta key <1>: Configuration. (line 4342) +* Meta key <2>: Hints and Tricks. (line 4577) * Mode: Motivations and Design. - (line 4711) + (line 4715) * MS-DOS files: More Advanced Features. (line 569) * Multiple documents: Editing. (line 296) * Opening a file: Loading and Saving. (line 237) * Portability: Portability Problems. - (line 4937) + (line 4941) * POSIX: Introduction. (line 33) * POSIX <1>: Motivations and Design. - (line 4711) + (line 4715) * POSIX <2>: Portability Problems. - (line 4937) + (line 4941) * Preferences: Basic Preferences. (line 361) * Printable characters: Portability Problems. - (line 4937) + (line 4941) * Quitting: Loading and Saving. (line 237) * Quoting conventions: General Guidelines. (line 1956) * Recording a macro: Basic Macros. (line 433) @@ -5122,13 +5126,13 @@ Concept Index * Repeating actions: General Guidelines. (line 1956) * Requester: The Requester. (line 1074) * Resource usage: Motivations and Design. - (line 4711) + (line 4715) * Saving a file: Loading and Saving. (line 237) * Saving a macro: Basic Macros. (line 433) * Setting configuration file names: Arguments. (line 708) * Short names: General Guidelines. (line 1956) * Shortcuts: Starting. (line 145) -* Shortcuts not working: Hints and Tricks. (line 4573) +* Shortcuts not working: Hints and Tricks. (line 4577) * Skipping configuration files: Arguments. (line 708) * Startup macro: Arguments. (line 708) * Status bar: Starting. (line 145) @@ -5137,25 +5141,25 @@ Concept Index (line 1162) * termcap: Introduction. (line 33) * termcap <1>: Motivations and Design. - (line 4711) + (line 4715) * termcap <2>: Portability Problems. - (line 4937) + (line 4941) * terminfo: Introduction. (line 33) * terminfo <1>: Motivations and Design. - (line 4711) + (line 4715) * terminfo <2>: Portability Problems. - (line 4937) -* Turbo adjustment: Hints and Tricks. (line 4573) -* TurboText: History. (line 4903) + (line 4941) +* Turbo adjustment: Hints and Tricks. (line 4577) +* TurboText: History. (line 4907) * Undeleting lines: Editing. (line 296) * Unloading macros: Basic Macros. (line 433) -* UTF-8: The Encoding Mess. (line 4853) +* UTF-8: The Encoding Mess. (line 4857) * UTF-8 support: More Advanced Features. (line 569) * UTF-8 Support: UTF-8 Support. (line 1894) * vi: Introduction. (line 33) * Virtual Extensions: Basic Preferences. (line 361) -* Virtual Extensions <1>: Virtual Extensions. (line 4515) +* Virtual Extensions <1>: Virtual Extensions. (line 4519) * Writing a file: Loading and Saving. (line 237) Command Index @@ -5163,145 +5167,145 @@ Command Index * Menu: -* About: About. (line 4186) -* AdjustView: AdjustView. (line 3936) -* Alert: Alert. (line 4196) -* AtomicUndo: AtomicUndo. (line 2875) -* AutoComplete: AutoComplete. (line 2634) -* AutoIndent: AutoIndent. (line 3016) -* AutoMatchBracket: AutoMatchBracket. (line 2588) -* AutoPrefs: AutoPrefs. (line 3105) -* Backspace: Backspace. (line 4135) -* Beep: Beep. (line 4204) -* Binary: Binary. (line 3123) -* Capitalize: Capitalize. (line 2974) -* CaseSearch: CaseSearch. (line 2619) -* Center: Center. (line 2907) +* About: About. (line 4190) +* AdjustView: AdjustView. (line 3937) +* Alert: Alert. (line 4200) +* AtomicUndo: AtomicUndo. (line 2876) +* AutoComplete: AutoComplete. (line 2635) +* AutoIndent: AutoIndent. (line 3017) +* AutoMatchBracket: AutoMatchBracket. (line 2589) +* AutoPrefs: AutoPrefs. (line 3106) +* Backspace: Backspace. (line 4139) +* Beep: Beep. (line 4208) +* Binary: Binary. (line 3124) +* Capitalize: Capitalize. (line 2975) +* CaseSearch: CaseSearch. (line 2620) +* Center: Center. (line 2908) * Clear: Clear. (line 2167) * ClipNumber: ClipNumber. (line 2393) * CloseDoc: CloseDoc. (line 2177) * Copy: Copy. (line 2286) -* CRLF: CRLF. (line 3439) +* CRLF: CRLF. (line 3440) * Cut: Cut. (line 2299) -* DeleteChar: DeleteChar. (line 4102) -* DeleteEOL: DeleteEOL. (line 4166) -* DeleteLine: DeleteLine. (line 4154) -* DeleteNextWord: DeleteNextWord. (line 4126) -* DeletePrevWord: DeletePrevWord. (line 4115) -* DelTabs: DelTabs. (line 3341) -* DoUndo: DoUndo. (line 2851) +* DeleteChar: DeleteChar. (line 4103) +* DeleteEOL: DeleteEOL. (line 4170) +* DeleteLine: DeleteLine. (line 4158) +* DeleteNextWord: DeleteNextWord. (line 4128) +* DeletePrevWord: DeletePrevWord. (line 4116) +* DelTabs: DelTabs. (line 3342) +* DoUndo: DoUndo. (line 2852) * Erase: Erase. (line 2327) -* Escape: Escape. (line 4300) -* EscapeTime: EscapeTime. (line 3290) -* Exec: Exec. (line 4213) +* Escape: Escape. (line 4304) +* EscapeTime: EscapeTime. (line 3291) +* Exec: Exec. (line 4217) * Exit: Exit. (line 2141) -* FastGUI: FastGUI. (line 3166) +* FastGUI: FastGUI. (line 3167) * Find: Find. (line 2434) * FindRegExp: FindRegExp. (line 2449) -* Flags: Flags. (line 3067) -* Flash: Flash. (line 4230) -* FreeForm: FreeForm. (line 3188) -* GotoBookmark: GotoBookmark. (line 4011) -* GotoColumn: GotoColumn. (line 3768) -* GotoLine: GotoLine. (line 3755) -* GotoMark: GotoMark. (line 3779) -* Help: Help. (line 4239) -* HexCode: HexCode. (line 3265) -* Insert: Insert. (line 3151) -* InsertChar: InsertChar. (line 4053) -* InsertLine: InsertLine. (line 4144) -* InsertString: InsertString. (line 4077) -* InsertTab: InsertTab. (line 4092) -* KeyCode: KeyCode. (line 4310) -* LineDown: LineDown. (line 3746) -* LineUp: LineUp. (line 3737) -* LoadAutoPrefs: LoadAutoPrefs. (line 3559) -* LoadPrefs: LoadPrefs. (line 3525) -* Macro: Macro. (line 2714) +* Flags: Flags. (line 3068) +* Flash: Flash. (line 4234) +* FreeForm: FreeForm. (line 3189) +* GotoBookmark: GotoBookmark. (line 4012) +* GotoColumn: GotoColumn. (line 3769) +* GotoLine: GotoLine. (line 3756) +* GotoMark: GotoMark. (line 3780) +* Help: Help. (line 4243) +* HexCode: HexCode. (line 3266) +* Insert: Insert. (line 3152) +* InsertChar: InsertChar. (line 4054) +* InsertLine: InsertLine. (line 4148) +* InsertString: InsertString. (line 4078) +* InsertTab: InsertTab. (line 4093) +* KeyCode: KeyCode. (line 4314) +* LineDown: LineDown. (line 3747) +* LineUp: LineUp. (line 3738) +* LoadAutoPrefs: LoadAutoPrefs. (line 3560) +* LoadPrefs: LoadPrefs. (line 3526) +* Macro: Macro. (line 2715) * Mark: Mark. (line 2247) * MarkVert: MarkVert. (line 2262) -* MatchBracket: MatchBracket. (line 2576) -* Modified: Modified. (line 3588) -* MoveBOS: MoveBOS. (line 3876) -* MoveEOF: MoveEOF. (line 3885) -* MoveEOL: MoveEOL. (line 3851) -* MoveEOW: MoveEOW. (line 3901) -* MoveIncDown: MoveIncDown. (line 3924) -* MoveIncUp: MoveIncUp. (line 3912) -* MoveLeft: MoveLeft. (line 3719) -* MoveRight: MoveRight. (line 3728) -* MoveSOF: MoveSOF. (line 3893) -* MoveSOL: MoveSOL. (line 3859) -* MoveTOS: MoveTOS. (line 3868) -* NameConvert: NameConvert. (line 4325) +* MatchBracket: MatchBracket. (line 2577) +* Modified: Modified. (line 3589) +* MoveBOS: MoveBOS. (line 3877) +* MoveEOF: MoveEOF. (line 3886) +* MoveEOL: MoveEOL. (line 3852) +* MoveEOW: MoveEOW. (line 3902) +* MoveIncDown: MoveIncDown. (line 3925) +* MoveIncUp: MoveIncUp. (line 3913) +* MoveLeft: MoveLeft. (line 3720) +* MoveRight: MoveRight. (line 3729) +* MoveSOF: MoveSOF. (line 3894) +* MoveSOL: MoveSOL. (line 3860) +* MoveTOS: MoveTOS. (line 3869) +* NameConvert: NameConvert. (line 4329) * NewDoc: NewDoc. (line 2156) * NextDoc: NextDoc. (line 2187) -* NextPage: NextPage. (line 3802) -* NextWord: NextWord. (line 3842) -* NoFileReq: NoFileReq. (line 3209) -* NOP: NOP. (line 4256) +* NextPage: NextPage. (line 3803) +* NextWord: NextWord. (line 3843) +* NoFileReq: NoFileReq. (line 3210) +* NOP: NOP. (line 4260) * Open: Open. (line 2042) * OpenClip: OpenClip. (line 2360) -* OpenMacro: OpenMacro. (line 2750) +* OpenMacro: OpenMacro. (line 2751) * OpenNew: OpenNew. (line 2063) -* PageDown: PageDown. (line 3822) -* PageUp: PageUp. (line 3813) -* Paragraph: Paragraph. (line 2918) +* PageDown: PageDown. (line 3823) +* PageUp: PageUp. (line 3814) +* Paragraph: Paragraph. (line 2919) * Paste: Paste. (line 2307) * PasteVert: PasteVert. (line 2317) -* Play: Play. (line 2696) -* PopPrefs: PopPrefs. (line 3497) -* PreserveCR: PreserveCR. (line 3421) +* Play: Play. (line 2697) +* PopPrefs: PopPrefs. (line 3498) +* PreserveCR: PreserveCR. (line 3422) * PrevDoc: PrevDoc. (line 2195) -* PrevPage: PrevPage. (line 3791) -* PrevWord: PrevWord. (line 3831) -* PushPrefs: PushPrefs. (line 3470) +* PrevPage: PrevPage. (line 3792) +* PrevWord: PrevWord. (line 3832) +* PushPrefs: PushPrefs. (line 3471) * Quit: Quit. (line 2132) -* ReadOnly: ReadOnly. (line 3274) -* Record: Record. (line 2672) -* Redo: Redo. (line 2822) -* Refresh: Refresh. (line 4264) +* ReadOnly: ReadOnly. (line 3275) +* Record: Record. (line 2673) +* Redo: Redo. (line 2823) +* Refresh: Refresh. (line 4268) * RepeatLast: RepeatLast. (line 2543) * Replace: Replace. (line 2464) * ReplaceAll: ReplaceAll. (line 2526) * ReplaceOnce: ReplaceOnce. (line 2513) -* RequestOrder: RequestOrder. (line 3222) -* RightMargin: RightMargin. (line 2983) +* RequestOrder: RequestOrder. (line 3223) +* RightMargin: RightMargin. (line 2984) * Save: Save. (line 2072) * SaveAll: SaveAll. (line 2113) * SaveAs: SaveAs. (line 2092) -* SaveAutoPrefs: SaveAutoPrefs. (line 3569) +* SaveAutoPrefs: SaveAutoPrefs. (line 3570) * SaveClip: SaveClip. (line 2377) -* SaveDefPrefs: SaveDefPrefs. (line 3579) -* SaveMacro: SaveMacro. (line 2767) -* SavePrefs: SavePrefs. (line 3545) -* SearchBack: SearchBack. (line 2602) +* SaveDefPrefs: SaveDefPrefs. (line 3580) +* SaveMacro: SaveMacro. (line 2768) +* SavePrefs: SavePrefs. (line 3546) +* SearchBack: SearchBack. (line 2603) * SelectDoc: SelectDoc. (line 2203) -* SetBookmark: SetBookmark. (line 3991) +* SetBookmark: SetBookmark. (line 3992) * Shift: Shift. (line 2336) -* ShiftTabs: ShiftTabs. (line 3353) -* StatusBar: StatusBar. (line 3240) -* Suspend: Suspend. (line 4278) -* Syntax: Syntax. (line 3606) -* System: System. (line 4287) -* Tabs: Tabs. (line 3321) -* TabSize: TabSize. (line 3309) +* ShiftTabs: ShiftTabs. (line 3354) +* StatusBar: StatusBar. (line 3241) +* Suspend: Suspend. (line 4282) +* Syntax: Syntax. (line 3607) +* System: System. (line 4291) +* Tabs: Tabs. (line 3322) +* TabSize: TabSize. (line 3310) * Through: Through. (line 2407) -* ToggleSEOF: ToggleSEOF. (line 3965) -* ToggleSEOL: ToggleSEOL. (line 3978) -* ToLower: ToLower. (line 2966) -* ToUpper: ToUpper. (line 2948) -* Turbo: Turbo. (line 3365) -* UndelLine: UndelLine. (line 2833) -* Undo: Undo. (line 2810) -* UnloadMacros: UnloadMacros. (line 2790) -* UnsetBookmark: UnsetBookmark. (line 4034) -* UTF8: UTF8. (line 3655) -* UTF8Auto: UTF8Auto. (line 3678) -* UTF8IO: UTF8IO. (line 3695) -* VerboseMacros: VerboseMacros. (line 3397) -* VisualBell: VisualBell. (line 3457) -* WordWrap: WordWrap. (line 2998) +* ToggleSEOF: ToggleSEOF. (line 3966) +* ToggleSEOL: ToggleSEOL. (line 3979) +* ToLower: ToLower. (line 2967) +* ToUpper: ToUpper. (line 2949) +* Turbo: Turbo. (line 3366) +* UndelLine: UndelLine. (line 2834) +* Undo: Undo. (line 2811) +* UnloadMacros: UnloadMacros. (line 2791) +* UnsetBookmark: UnsetBookmark. (line 4035) +* UTF8: UTF8. (line 3656) +* UTF8Auto: UTF8Auto. (line 3679) +* UTF8IO: UTF8IO. (line 3696) +* VerboseMacros: VerboseMacros. (line 3398) +* VisualBell: VisualBell. (line 3458) +* WordWrap: WordWrap. (line 2999) 1 Introduction diff -pruN 3.1.1-1/doc/version.texinfo 3.1.2-1/doc/version.texinfo --- 3.1.1-1/doc/version.texinfo 2017-06-04 20:43:38.000000000 +0000 +++ 3.1.2-1/doc/version.texinfo 2018-10-06 09:55:59.000000000 +0000 @@ -4,10 +4,10 @@ @end ignore -@set VERSION 3.1.1 -@set RELEASE_YEAR 2017 -@set RELEASE_MONTH 06 -@set RELEASE_DATE 04 +@set VERSION 3.1.2 +@set RELEASE_YEAR 2018 +@set RELEASE_MONTH 10 +@set RELEASE_DATE 06 @set DATE (@value{RELEASE_YEAR}-@value{RELEASE_MONTH}-@value{RELEASE_DATE}) @set PROGRAM_NAME ne, the nice editor @set ABOUT_MSG @value{PROGRAM_NAME} @value{VERSION}. @value{DATE} diff -pruN 3.1.1-1/makefile 3.1.2-1/makefile --- 3.1.1-1/makefile 2017-06-04 20:43:12.000000000 +0000 +++ 3.1.2-1/makefile 2018-10-06 09:51:17.000000000 +0000 @@ -2,16 +2,18 @@ .PHONY: install -VERSION=3.1.1 +VERSION=3.1.2 # If you change this prefix, you can invoke "make build install" and ne will be compiled # and installed under the $(PREFIX) hierarchy. You can even use "make install PREFIX=$HOME/

" # to install ne locally into the directory . -PREFIX=/usr/local +PREFIX?=/usr/local PROGRAM = ne +STRIP?=strip + ifeq ($(OS), Windows_NT) OS := Windows else @@ -20,7 +22,7 @@ endif build: docs - ( cd src; make clean; make NE_GLOBAL_DIR=$(PREFIX)/share/ne; strip ne ) + ( cd src; make clean; make NE_GLOBAL_DIR=$(PREFIX)/share/ne; $(STRIP) ne ) docs: ( cd doc; make ) diff -pruN 3.1.1-1/NEWS 3.1.2-1/NEWS --- 3.1.1-1/NEWS 2017-06-04 20:43:00.000000000 +0000 +++ 3.1.2-1/NEWS 2018-10-06 09:50:48.000000000 +0000 @@ -1,5 +1,14 @@ (This file, NEWS, lists new features and enhancements. See CHANGES for fixes.) +3.1.2 2018-10-06 + + * RepeatLast now accepts "Find" or "Replace" after its optional number so + you can explicitly repeat either operation even if the other was most + recently performed. + + * We now use the xenl property to detect whether we can write on the last + column of the last line, thus making the status bar complete. + 3.1.1 2017-06-04 * You can now CloseDoc (^Q) unmodified documents from within the diff -pruN 3.1.1-1/src/actions.c 3.1.2-1/src/actions.c --- 3.1.1-1/src/actions.c 2017-06-01 17:35:37.000000000 +0000 +++ 3.1.2-1/src/actions.c 2018-10-04 15:00:02.000000000 +0000 @@ -1,7 +1,7 @@ /* Main command processing loop. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -66,6 +66,90 @@ is what most commands require. */ static int perform_wrap; +#ifdef LOGACTIONS +/* Wrap do_action() and various request* functions to facilitate action logging. */ + +int do_action_wrapped(buffer *b, action a, int64_t c, char *p); +static int da_depth = 0; +static FILE *da_log; +static buffer *da_prev_b; + +bool request_response_wrapper(const buffer *b, const char *prompt, bool default_value) { + bool resp = request_response(b, prompt, default_value); + if (da_log) { + fprintf(da_log," %p request_response: %s\n", b, resp ? "true" : "false"); + } + return resp; +} +#define request_response request_response_wrapper + +char request_char_wrapper(const buffer *b, const char *prompt, const char default_value) { + char resp = request_char(b, prompt, default_value); + if (da_log) { + fprintf(da_log," %p request_char: '%c'\n", b, resp); + } + return resp; +} +#define request_char request_char_wrapper + +int64_t request_number_wrapper(const buffer *b, const char *prompt, int64_t default_value) { + int64_t resp = request_number(b, prompt, default_value); + if (da_log) { + fprintf(da_log," %p request_number: %ld\n", b, resp); + } + return resp; +} +#define request_number request_number_wrapper + +char *request_string_wrapper(const buffer *b, const char *prompt, const char *default_string, bool accept_null_string, int completion_type, bool prefer_utf8) { + char *resp = request_string(b, prompt, default_string, accept_null_string, completion_type, prefer_utf8); + if (da_log) { + fprintf(da_log," %p request_string: '%s'\n", b, resp ? resp : ""); + } + return resp; +} +#define request_string request_string_wrapper + +char *request_wrapper(const buffer *b, const char *prompt, const char *default_string, bool alpha_allowed, int completion_type, bool prefer_utf8) { + char * resp = request(b, prompt, default_string, alpha_allowed, completion_type, prefer_utf8); + if (da_log) { + fprintf(da_log," %p request: '%s'\n", b, resp ? resp : ""); + } + return resp; +} +#define request request_wrapper + +char *request_file_wrapper(const buffer *b, const char *prompt, const char *default_name) { + char * resp = request_file(b, prompt, default_name); + if (da_log) { + fprintf(da_log," %p request: '%s'\n", b, resp ? resp : ""); + } + return resp; +} +#define request_file request_file_wrapper +int do_action(buffer *b, action a, int64_t c, char *p) { + if (!da_log) da_log = fopen("/tmp/ne-actions.log","a"); + if (da_log) { + if (b != da_prev_b && b->filename) { + fprintf(da_log, "%p: %s\n", b, b->filename); + da_prev_b = b; + } + fprintf(da_log,"%p%2d %ld,%ld(%ld) %s %ld '%s'\n", + b, + da_depth++, + b->cur_line, + b->cur_pos, + b->cur_char, + command_names[a], + c, p ? p : ""); + fflush(da_log); + } + int rc = do_action_wrapped(b, a, c, p); + da_depth--; + return rc; +} +/* End of the insertions to achieve logging of do_action(). */ +#endif /* This is the dispatcher of all actions that have some effect on the text. @@ -80,8 +164,11 @@ static int perform_wrap; somewhere. Though efficient, this has lead to some memory leaks (can you find them?). */ - +#ifdef LOGACTIONS +int do_action_wrapped(buffer *b, action a, int64_t c, char *p) { +#else int do_action(buffer *b, action a, int64_t c, char *p) { +#endif static char msg[MAX_MESSAGE_SIZE]; line_desc *next_ld; HIGHLIGHT_STATE next_line_state; @@ -99,7 +186,7 @@ int do_action(buffer *b, action a, int64 if (b->syn && b->attr_len != -1) { HIGHLIGHT_STATE next_state = parse(b->syn, b->cur_line_desc, b->cur_line_desc->highlight_state, b->encoding == ENC_UTF8); assert(attr_len == b->attr_len); - assert(memcmp(attr_buf, b->attr_buf, attr_len) == 0); + assert(attr_len == 0 || memcmp(attr_buf, b->attr_buf, attr_len) == 0); assert(memcmp(&next_state, &b->next_state, sizeof next_state) == 0); } #endif @@ -240,33 +327,59 @@ int do_action(buffer *b, action a, int64 case DELETENEXTWORD_A: case DELETEPREVWORD_A: + if (b->opt.read_only) return DOCUMENT_IS_READ_ONLY; recording = b->recording; b->recording = 0; NORMALIZE(c); - delay_update(); + int marking_t = b->marking; + int mark_is_vertical_t = b->mark_is_vertical; + b->bookmark[WORDWRAP_BOOKMARK].pos = b->block_start_pos; + b->bookmark[WORDWRAP_BOOKMARK].line = b->block_start_line; + b->bookmark_mask |= (1 << WORDWRAP_BOOKMARK); + start_undo_chain(b); - for(int64_t i = 0; i < c && !error && !stop; i++) { - int marking_t = b->marking; - int mark_is_vertical_t = b->mark_is_vertical; - b->bookmark[WORDWRAP_BOOKMARK].pos = b->block_start_pos; - b->bookmark[WORDWRAP_BOOKMARK].line = b->block_start_line; - b->bookmark_mask |= (1 << WORDWRAP_BOOKMARK); - - b->marking = 1; - b->mark_is_vertical = 0; - b->block_start_line = b->cur_line; - b->block_start_pos = b->cur_pos; - - if(!(error = do_action(b, a == DELETENEXTWORD_A ? NEXTWORD_A : PREVWORD_A, 1, NULL))) { - if (!(error = erase_block(b))) update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); - } - b->bookmark_mask &= ~(1 << WORDWRAP_BOOKMARK); - b->block_start_pos = b->bookmark[WORDWRAP_BOOKMARK].pos; - b->block_start_line = b->bookmark[WORDWRAP_BOOKMARK].line; - b->marking = marking_t; - b->mark_is_vertical = mark_is_vertical_t; + + b->marking = 1; + b->mark_is_vertical = 0; + b->block_start_line = b->cur_line; + b->block_start_pos = b->cur_pos; + + if (a == DELETEPREVWORD_A) { + /* This ugly insertion and deletion of a single character ensures + that the cursor ends up here after an undo. */ + insert_one_char(b, b->cur_line_desc, b->cur_line, b->cur_pos, ' '); + delete_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, 1); + for(int64_t i = 0; i < c && !(error = search_word(b, -1)) && !stop; i++); + } else if (c > 0) { + move_to_eow(b); + if (b->block_start_line != b->cur_line || b->block_start_pos != b->cur_pos) c--; + for(int64_t i = 0; i < c && !(error = search_word(b, 1)) && !stop; i++); + if (c) move_to_eow(b); } - end_undo_chain(b); + const bool line_changed = b->block_start_line != b->cur_line; + if (line_changed || b->block_start_pos != b->cur_pos) { /* we moved */ + b->attr_len = -1; + error |= erase_block(b, false); + end_undo_chain(b); + + if (line_changed) { + if (b->syn) update_syntax_states_delay(b, b->cur_line_desc, NULL); + update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); + } + else { + update_line(b, b->cur_line_desc, b->cur_y, 0, false); + if (b->syn) need_attr_update = true; + } + } else { + end_undo_chain(b); + if (a == DELETEPREVWORD_A) error |= undo(b); + } + + b->bookmark_mask &= ~(1 << WORDWRAP_BOOKMARK); + b->block_start_pos = b->bookmark[WORDWRAP_BOOKMARK].pos; + b->block_start_line = b->bookmark[WORDWRAP_BOOKMARK].line; + b->marking = marking_t; + b->mark_is_vertical = mark_is_vertical_t; b->recording = recording; return stop ? STOPPED : error; @@ -349,14 +462,14 @@ int do_action(buffer *b, action a, int64 b->bookmark[c].cur_y = b->cur_y; b->bookmark_mask |= (1 << c); b->cur_bookmark = c; - snprintf(msg, MAX_MESSAGE_SIZE, "Bookmark %c set", c<=MAX_USER_BOOKMARK?'0'+(int)c : '-'); + snprintf(msg, MAX_MESSAGE_SIZE, "Bookmark %c set", c <= MAX_USER_BOOKMARK?'0' + (int)c : '-'); print_message(msg); break; case UNSETBOOKMARK_A: if (! (b->bookmark_mask & (1 << c))) return BOOKMARK_NOT_SET; b->bookmark_mask &= ~(1 << c); - snprintf(msg, MAX_MESSAGE_SIZE, "Bookmark %c unset", c<=MAX_USER_BOOKMARK?'0'+(int)c : '-'); + snprintf(msg, MAX_MESSAGE_SIZE, "Bookmark %c unset", c <= MAX_USER_BOOKMARK?'0' + (int)c : '-'); print_message(msg); break; case GOTOBOOKMARK_A: @@ -378,7 +491,7 @@ int do_action(buffer *b, action a, int64 b->bookmark[AUTO_BOOKMARK].cur_y = cur_y; b->bookmark_mask |= 1<cur_line + 1))<0) return NUMERIC_ERROR(c); + if (c < 0 && (c = request_number(b, "Line", b->cur_line + 1)) < 0) return NUMERIC_ERROR(c); if (c == 0 || c > b->num_lines) c = b->num_lines; goto_line(b, --c); return OK; case GOTOCOLUMN_A: - if (c < 0 && (c = request_number(b, "Column", b->cur_x + b->win_x + 1))<0) return NUMERIC_ERROR(c); + if (c < 0 && (c = request_number(b, "Column", b->cur_x + b->win_x + 1)) < 0) return NUMERIC_ERROR(c); goto_column(b, c ? --c : 0); return OK; @@ -433,7 +546,7 @@ int do_action(buffer *b, action a, int64 return OK; case AUTOMATCHBRACKET_A: - if (c < 0 && (c = request_number(b, "Match mode (sum of 0:none, 1:brightness, 2:inverse, 4:bold, 8:underline)", b->opt.automatch))<0||c>15) return ((c) == ABORT ? OK : INVALID_MATCH_MODE); + if (c < 0 && (c = request_number(b, "Match mode (sum of 0:none, 1:brightness, 2:inverse, 4:bold, 8:underline)", b->opt.automatch)) < 0 || c > 15) return ((c) == ABORT ? OK : INVALID_MATCH_MODE); b->opt.automatch = c; return OK; @@ -464,7 +577,7 @@ int do_action(buffer *b, action a, int64 if (b->opt.read_only) return DOCUMENT_IS_READ_ONLY; - if (c < 0 && (c = request_number(b, "Char Code", last_inserted_char))<0) return NUMERIC_ERROR(c); + if ((c < 0 || c > MAX_UTF_8) && ((c = request_number(b, "Char Code", last_inserted_char)) < 0 || c > MAX_UTF_8)) return NUMERIC_ERROR(c); if (c == 0) return CANT_INSERT_0; if (b->encoding == ENC_ASCII) { @@ -617,7 +730,7 @@ int do_action(buffer *b, action a, int64 if (b->cur_pos < b->cur_line_desc->line_len) { /* Deletion inside a line. */ const int old_char = b->encoding == ENC_UTF8 ? utf8char(&b->cur_line_desc->line[b->cur_pos]) : b->cur_line_desc->line[b->cur_pos]; - const uint32_t old_attr = b->syn ? b->attr_buf[b->cur_pos] : 0; + const uint32_t old_attr = b->syn ? b->attr_buf[b->cur_char] : 0; if (b->syn) { /* Invalidate attrs beyond the right window edge. */ const int64_t right_char = calc_char_len(b->cur_line_desc, calc_pos(b->cur_line_desc, b->win_x + ne_columns, b->opt.tab_size, b->encoding), b->encoding); @@ -701,10 +814,8 @@ int do_action(buffer *b, action a, int64 move_to_sol(b); line_down(b); if (a != -1) goto_pos(b, a); - if (b->cur_line == b->num_lines - 1) update_line(b, b->cur_line_desc, b->cur_y, 0, false); else scroll_window(b, b->cur_line_desc, b->cur_y, 1); - } need_attr_update = true; } else end_undo_chain(b); @@ -815,7 +926,7 @@ int do_action(buffer *b, action a, int64 case KEYCODE_A: if (c >= NUM_KEYS) c = -1; - if (c < 0 ) { + if (c < 0) { print_message(info_msg[PRESS_A_KEY]); do c = get_key_code(); while(c == INVALID_CHAR || c > 0xFF || CHAR_CLASS(c) == IGNORE); } @@ -832,17 +943,18 @@ int do_action(buffer *b, action a, int64 return OK; case OPENNEW_A: - b = new_buffer(); - reset_window(); + if (b = new_buffer()) { + reset_window(); + } else { + if (p) free(p); + return OUT_OF_MEMORY; + } case OPEN_A: - if ((b->is_modified) && !request_response(b, info_msg[THIS_DOCUMENT_NOT_SAVED], false)) { - if (a == OPENNEW_A) do_action(b, CLOSEDOC_A, 1, NULL); - return ERROR; - } + if ((b->is_modified) && !request_response(b, info_msg[THIS_DOCUMENT_NOT_SAVED], false)) return ERROR; if (p || (p = request_file(b, "Filename", b->filename))) { - static bool dprompt = 0; /* Set to true if we ever respond 'yes' to the prompt. */ + static bool dprompt = false; /* Set to true if we ever respond 'yes' to the prompt. */ buffer *dup = get_buffer_named(p); @@ -872,7 +984,10 @@ int do_action(buffer *b, action a, int64 } free(p); } - if (a == OPENNEW_A) do_action(b, CLOSEDOC_A, 1, NULL); + if (a == OPENNEW_A) { + do_action(b, CLOSEDOC_A, 1, NULL); + do_action(cur_buffer, PREVDOC_A, 1, NULL); + } return ERROR; case ABOUT_A: @@ -1022,6 +1137,21 @@ int do_action(buffer *b, action a, int64 return ERROR; case REPEATLAST_A: + if (p) { + char *q; + c = strtoll(p, &q, 0); + if (p == q) c = -1; + while (*q == ' ') q++; + if (*q) { + if ( !strcasecmp("f",q) || !strcasecmp("find",q)) b->last_was_replace = false; + else if (!strcasecmp("r",q) || !strcasecmp("replace",q)) b->last_was_replace = true; + else { + free(p); + return SYNTAX_ERROR; + } + } + free(p); + } if (b->opt.read_only && b->last_was_replace) return DOCUMENT_IS_READ_ONLY; if (!b->find_string) return NO_SEARCH_STRING; if ((b->last_was_replace) && !b->replace_string) return NO_REPLACE_STRING; @@ -1112,17 +1242,17 @@ int do_action(buffer *b, action a, int64 return TAB_SIZE_OUT_OF_RANGE; case TURBO_A: - if (c < 0 && (c = request_number(b, "Turbo Threshold", turbo))<0) return NUMERIC_ERROR(c); + if ((int)c < 0 && (int)(c = request_number(b, "Turbo Threshold", turbo)) < 0) return NUMERIC_ERROR(c); turbo = c; return OK; case CLIPNUMBER_A: - if (c < 0 && (c = request_number(b, "Clip Number", b->opt.cur_clip))<0) return NUMERIC_ERROR(c); + if ((int)c < 0 && (int)(c = request_number(b, "Clip Number", b->opt.cur_clip)) < 0) return NUMERIC_ERROR(c); b->opt.cur_clip = c; return OK; case RIGHTMARGIN_A: - if (c < 0 && (c = request_number(b, "Right Margin", b->opt.right_margin))<0) return NUMERIC_ERROR(c); + if ((int)c < 0 && (int)(c = request_number(b, "Right Margin", b->opt.right_margin)) < 0) return NUMERIC_ERROR(c); b->opt.right_margin = c; return OK; @@ -1386,7 +1516,7 @@ int do_action(buffer *b, action a, int64 if (b->opt.read_only) return DOCUMENT_IS_READ_ONLY; case COPY_A: - if (!(error = print_error((b->mark_is_vertical ? copy_vert_to_clip : copy_to_clip)(b, c < 0 ? b->opt.cur_clip : c, a == CUT_A)))) { + if (!(error = print_error((b->mark_is_vertical ? copy_vert_to_clip : copy_to_clip)(b, (int)c < 0 ? b->opt.cur_clip : c, a == CUT_A)))) { b->marking = 0; update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); } @@ -1394,7 +1524,7 @@ int do_action(buffer *b, action a, int64 case ERASE_A: if (b->opt.read_only) return DOCUMENT_IS_READ_ONLY; - if (!(error = print_error((b->mark_is_vertical ? erase_vert_block : erase_block)(b)))) { + if (!(error = print_error((b->mark_is_vertical ? erase_vert_block : erase_block)(b, true)))) { b->marking = 0; update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); } @@ -1403,7 +1533,7 @@ int do_action(buffer *b, action a, int64 case PASTE_A: case PASTEVERT_A: if (b->opt.read_only) return DOCUMENT_IS_READ_ONLY; - if (!(error = print_error((a == PASTE_A ? paste_to_buffer : paste_vert_to_buffer)(b, c < 0 ? b->opt.cur_clip : c)))) update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); + if (!(error = print_error((a == PASTE_A ? paste_to_buffer : paste_vert_to_buffer)(b, (int)c < 0 ? b->opt.cur_clip : c)))) update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); assert_buffer_content(b); return error ? ERROR : 0; @@ -1507,7 +1637,7 @@ int do_action(buffer *b, action a, int64 start_undo_chain(b); - if (b->marking) (b->mark_is_vertical ? erase_vert_block : erase_block)(b); + if (b->marking) (b->mark_is_vertical ? erase_vert_block : erase_block)(b, true); error = (b->mark_is_vertical ? paste_vert_to_buffer : paste_to_buffer)(b, INT_MAX); end_undo_chain(b); @@ -1585,6 +1715,7 @@ int do_action(buffer *b, action a, int64 for(int64_t i = 0; i < c && !(error = paragraph(b)) && !stop; i++); if (stop) error = STOPPED; if (error == STOPPED) reset_window(); + assert(b->cur_pos >= 0); return print_error(error) ? ERROR : 0; case SHIFT_A: diff -pruN 3.1.1-1/src/ansi.c 3.1.2-1/src/ansi.c --- 3.1.1-1/src/ansi.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/ansi.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,6 +1,6 @@ /* Hardwired ANSI terminal control sequences. - Copyright (C) 2001-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2001-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/ansi.h 3.1.2-1/src/ansi.h --- 3.1.1-1/src/ansi.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/ansi.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,6 +1,6 @@ /* Hardwired ANSI terminal control sequences (prototypes). - Copyright (C) 2001-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2001-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/autocomp.c 3.1.2-1/src/autocomp.c --- 3.1.1-1/src/autocomp.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/autocomp.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,6 +1,6 @@ /* AutoComplete - Copyright (C) 2010-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2010-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/#buffer.c 3.1.2-1/src/#buffer.c --- 3.1.1-1/src/#buffer.c 1970-01-01 00:00:00.000000000 +0000 +++ 3.1.2-1/src/#buffer.c 2018-10-02 14:18:17.000000000 +0000 @@ -0,0 +1,1981 @@ + }U char terminators[] = { 0x0d, 0x0a +if +(is_directory(name)) +return +FILE_IS_DIRECTORY; + ld_node + +ZL + b->num_lines++; + return + b->free_chars + - + n; + + + ld_node + b->attr_buf + = + realloc(b->attr_buf, + b->attr_size + * + sizeof + *b->attr_buf); +sizeof(line_desc) : sizeof(no_syntax_line_desc); +else { + + COP(O + NUL +the +line +terminators +if +necessary, +following +the +same +rationale +t) + +] + = + 0; + Copyright + (C) + 1999-2018 + Todd + M. + Lewis + and + Sebastiano + Vigna +T + char + buffer[CIRC_BUFFER_SIZE + * + 2]; + This + file + is + part + of + ne, + the + nice + editor. + 3 + + This + library + is + free + software; + you + can + redistribute + it + and/or + modify + it + under + the + terms + of + the + GNU + General + Public + License + as + published + by + the + Free + Software + Foundation; + either + version + 3 + of + the + License, + or + (at + your + option) + any + later + version. + + This + library + is + distributed + in + the + hope + that + it + will + be + useful, + but + WITHOUT + ANY + WARRANTY; + without + even + the + implied + warranty + of + MERCHANTABILITY + or + FITNESS + FOR + A + PARTICULAR + PURPOSE. + See + the + GNU + General + Public + License + for + more + details. + + You + should + have + received + a + copy + of + the + GNU + General + Public + License + along + with + this + program; + if + not, + see + . + */ + + +#include +"ne.h" +#include +"support.h" +#include + + +/* +The +standard +pool +allocation +dimension. +*/ + +#define +STD_POOL_SIZE +(16 +* +1024) + +/* +The +standard +line +descriptor +pool +allocation +dimension +(in +lines). +*/ + +#define +STD_LINE_DESC_POOL_SIZE +(512) + +/* +The +starting +size +when +reading +a +non-seekable +file. +*/ + +#define +START_SIZE +(8 +* +1024) + +/* +The +number +of +lines +by +which +we +increment +the +first +line +descriptor +pool +dimension, +with +respect +to +the +number +of +lines +of +the +given +file. +*/ + +#define +STANDARD_LINE_INCREMENT +(256) + +/* + The + size + of + the + space + array. + Batch + printing + of + spaces + happens + in + blocks + of + this + size. + */ + +#define +MAX_STACK_SPACES +(256) + +/* +The +length +of +the +block +used +in +order +to +optimize +saves. +*/ + +#define +SAVE_BLOCK_LEN +(16 +* +1024 +- +1) + +/* +The +length +of +a +half +of +the +circular +buffer +used +for +memory +mapping. +*/ + +define CIRC_BUFFER_SIZE (8 * 1024) + +/* The number of line descriptors in the buffer used for memory mapping. */ + +#define LD_BUFFER_COUNT (256) + + +/* Detects (heuristically) the encoding of a buffer. */ + +encoding_type detect_buffer_encoding(const buffer * const b) { + line_desc *ld = (line_desc *)b->line_desc_list.head, *next; + encoding_type encoding = ENC_ASCII, e; + + while(next = (line_desc *)ld->ld_node.next) { + e = detect_encoding(ld->line, ld->line_len); + if (e != ENC_ASCII) { + if (encoding == ENC_ASCII) encoding = e; + if (e == ENC_8_BIT) encoding = ENC_8_BIT; + } + ld = next; + } + + return encoding; +} + +/* These functions allocate and deallocate character pools. The size of the +pool is the number of characters, and it is forced to be at least +STD_POOL_SIZE. force is passed to alloc_or_mmap(). */ + + +char_pool *alloc_char_pool(int64_t size, const int fd_or_zero, int force) { + if (size < STD_POOL_SIZE && ! fd_or_zero) size = STD_POOL_SIZE; + + char_pool * const cp = calloc(1, sizeof(char_pool)); + if (cp) { + if (cp->pool = alloc_or_mmap(size, fd_or_zero, &force)) { + cp->mapped = force; + cp->size = size; + return cp; + } + free(cp); + } + return NULL; +} + +char_pool *alloc_char_pool_from_memory(char * const pool, const int64_t size) { + char_pool * const cp = calloc(1, sizeof(char_pool)); + if (cp) { + cp->pool = pool; + cp->size = size; + return cp; + } + return NULL; +} + + +void free_char_pool(char_pool * const cp) { + if (cp == NULL) return; + if (cp->mapped) munmap(cp->pool, cp->size); + else free(cp->pool); + free(cp); +} + + + +/* Given a pointer in a character pool and a buffer, this function returns the + respective pool. It can return NULL if the pointer wasn't in any pool, but + this condition denotes a severe malfunctioning. */ + +char_pool *get_char_pool(buffer * const b, char * const p) { + for(char_pool *cp = (char_pool *)b->char_pool_list.head; cp->cp_node.next;) { + assert_char_pool(cp); + if (p >= cp->pool && p < cp->pool + cp->size) return cp; + cp = (char_pool *)cp->cp_node.next; + } + assert(false); + return NULL; +} + + + + +/* These functions allocate and deallocate line-descriptor pools. The size of + the pool is the number of lines, and is forced to be at least + STD_LINE_DESC_POOL_SIZE. force is passed to alloc_or_mmap(). */ + + +line_desc_pool *alloc_line_desc_pool(int64_t pool_size, int force) { + if (pool_size < STD_LINE_DESC_POOL_SIZE) pool_size = STD_LINE_DESC_POOL_SIZE; + + line_desc_pool * const ldp = calloc(1, sizeof(line_desc_pool)); + if (ldp) { + if (ldp->pool = alloc_or_mmap(pool_size * (do_syntax ? sizeof(line_desc) : sizeof(no_syntax_line_desc)), 0, &force)) { + ldp->mapped = force; + ldp->size = pool_size; + new_list(&ldp->free_list); + for(int64_t i = 0; i < pool_size; i++) + if (do_syntax) add_tail(&ldp->free_list, &((line_desc *)ldp->pool)[i].ld_node); + else add_tail(&ldp->free_list, &((no_syntax_line_desc *)ldp->pool)[i].ld_node); + return ldp; + } + free(ldp); + } + + return NULL; +} + +/* This function creates a line-descriptor pool using a given region of memory. + which must be able to hold pool_size element of the right type (depending on + do_syntax). All items in the pool are considered to be allocated. */ + +line_desc_pool *alloc_line_desc_pool_from_memory(void *pool, int64_t pool_size) { + line_desc_pool * const ldp = calloc(1, sizeof(line_desc_pool)); + if (ldp) { + new_list(&ldp->free_list); + ldp->pool = pool; + ldp->size = ldp->allocated_items = pool_size; + return ldp; + } + return NULL; +} + +void free_line_desc_pool(line_desc_pool * const ldp) { + if (ldp == NULL) return; + assert_line_desc_pool(ldp); + if (ldp->mapped) munmap(ldp->pool, ldp->size * (do_syntax ? sizeof(line_desc) : sizeof(no_syntax_line_desc))); + else free(ldp->pool); + free(ldp); +} + + + +/* These functions allocate and deallocate a buffer. Note that on allocation +we have to initialize the list pointers, and on dellocation we have to free +all the lists. Moreover, on allocation a buffer pointer can be passed so +that the new buffer can inherit various user flags. */ + +buffer *alloc_buffer(const buffer * const cur_b) { + + buffer *b; + + if (b = calloc(1, sizeof(buffer))) { + + new_list(&b->line_desc_pool_list); + new_list(&b->line_desc_list); + new_list(&b->char_pool_list); + + b->cur_macro = alloc_char_stream(0); + b->opt.tab_size = 8; + + b->opt.insert = + b->opt.tabs = + b->opt.shift_tabs = + b->opt.automatch = + b->opt.do_undo = + b->opt.auto_prefs = 1; + + b->opt.utf8auto = io_utf8; + + b->attr_len = -1; + + if (cur_b) { + + b->opt.cur_clip = cur_b->opt.cur_clip; + b->opt.tab_size = cur_b->opt.tab_size; + b->opt.tabs = cur_b->opt.tabs; + b->opt.del_tabs = cur_b->opt.del_tabs; + b->opt.shift_tabs = cur_b->opt.shift_tabs; + b->opt.automatch = cur_b->opt.automatch; + b->opt.right_margin = cur_b->opt.right_margin; + + b->opt.free_form = cur_b->opt.free_form; + b->opt.hex_code = cur_b->opt.hex_code; + b->opt.word_wrap = cur_b->opt.word_wrap; + b->opt.auto_indent = cur_b->opt.auto_indent; + b->opt.preserve_cr = cur_b->opt.preserve_cr; + + b->opt.do_undo = cur_b->opt.do_undo; + b->opt.auto_prefs = cur_b->opt.auto_prefs; + b->opt.no_file_req = cur_b->opt.no_file_req; + + b->opt.case_search = cur_b->opt.case_search; + b->opt.binary = cur_b->opt.binary; + b->opt.utf8auto = cur_b->opt.utf8auto; + b->opt.visual_bell = cur_b->opt.visual_bell; + + } + /* This leaves out only opt.read_only and opt.search_back, which are + implicitly set to 0 by the calloc(). */ + return b; + } + + return NULL; +} + + +/* This function is useful when resetting a buffer, but not really +destroying it. Since it modifies some lists, it cannot be interrupted +from a signal. Note that the search, replace and command_line strings are +not cleared. */ + +void free_buffer_contents(buffer * const b) { + + if (!b) return; + + block_signals(); + + free_list(&b->line_desc_pool_list, free_line_desc_pool); + free_list(&b->char_pool_list, free_char_pool); + new_list(&b->line_desc_list); + b->cur_line_desc = b->top_line_desc = NULL; + + b->allocated_chars = b->free_chars = 0; + b->num_lines = 0; + b->is_CRLF = false; + b->encoding = ENC_ASCII; + b->bookmark_mask = 0; + b->mtime = 0; + + free_char_stream(b->last_deleted); + b->last_deleted = NULL; + + free(b->filename); + b->filename = NULL; + + reset_undo_buffer(&b->undo); + b->is_modified = b->marking = b->recording = b->x_wanted = 0; + + release_signals(); +} + + +/* Removes all data in a buffer, but leaves in the current macro, the search, + replace and command_line strings, and an empty line. */ + +void clear_buffer(buffer * const b) { + if (!b) return; + + block_signals(); + + free_buffer_contents(b); + + line_desc * const ld = alloc_line_desc(b); + add_head(&b->line_desc_list, &ld->ld_node); + if (do_syntax) { + ld->highlight_state.state = 0; + ld->highlight_state.stack = NULL; + ld->highlight_state.saved_s[0] = 0; + } + + b->num_lines = 1; + reset_position_to_sof(b); + + assert_buffer(b); + + release_signals(); +} + + +/* Frees all the data associated to a buffer. */ + +void free_buffer(buffer * const b) { + if (b == NULL) return; + assert_buffer(b); + free_buffer_contents(b); + free_char_stream(b->cur_macro); + free(b->find_string); + free(b->replace_string); + free(b->command_line); + if (b->attr_buf) free(b->attr_buf); + free(b); +} + + +/* Computes how many characters have been "lost" in a buffer, that is, how many + free characters lie inside the first and last used characters of the + character pools. This characters can only be allocated by + alloc_chars_around(). */ + +int64_t calc_lost_chars(const buffer * const b) { + int64_t n = 0; + + for(char_pool *cp = (char_pool *)b->char_pool_list.head; cp->cp_node.next; cp = (char_pool *)cp->cp_node.next) + n += cp->size - (cp->last_used - cp->first_used + 1); + + return b->free_chars - n; +} + + +/* Returns the nth buffer in the global buffer list, or NULL if less than n + buffers are available. */ + +buffer *get_nth_buffer(int n) { + for(buffer *b = (buffer *)buffers.head; b->b_node.next; b = (buffer *)b->b_node.next) + if (!n--) return b; + return NULL; +} + + + +/* Returns a buffer, given its name (i.e., the name of the file it + contains). Note that file_part() is applied *both* to the string passed + *and* to the buffer names, so that the path is immaterial. */ + +buffer *get_buffer_named(const char *p) { + if (!p) return NULL; + p = file_part(p); + + for(buffer *b = (buffer *)buffers.head; b->b_node.next; b = (buffer *)b->b_node.next) + if (b->filename && !strcmp(file_part(b->filename), p)) return b; + + return NULL; +} + + +/* Returns true if any of the buffers has been modified since the last save. */ + +int modified_buffers(void) { + for(buffer *b = (buffer *)buffers.head; b->b_node.next; b = (buffer *)b->b_node.next) + if (b->is_modified) return true; + + return false; +} + + +/* Saves all buffers which have been modified since the last save. Returns an + error if a save is unsuccessful, a file on-disk was modified since last + loaded or saved, or if a buffer has no name. */ + +int save_all_modified_buffers(void) { + int rc = 0; + + for(buffer *b = (buffer *)buffers.head; b->b_node.next; b = (buffer *)b->b_node.next) + if (b->is_modified) { + if (buffer_file_modified(b, NULL)) rc = ERROR; + else if (save_buffer_to_file(b, NULL)) rc = ERROR; + } + return rc; +} + + + +/* Now we have the much more sophisticated allocation functions which create + small elements such as lines and line descriptors. All the operations + are in the context of a given buffer. Most of these functions are + protected internally against being interrupted by signals, since + auto_save could die miserably because of the inconsistent state of a + list. */ + + +/* Allocates a line descriptor from the pools available in the given buffer. A + new pool is allocated and linked if necessary. New line descriptors are + created with an invalid syntax state, so they will always force an update. */ + +line_desc *alloc_line_desc(buffer * const b) { + block_signals(); + + line_desc_pool *ldp; + for(ldp = (line_desc_pool *)b->line_desc_pool_list.head; ldp->ldp_node.next; ldp = (line_desc_pool *)ldp->ldp_node.next) { + + assert_line_desc_pool(ldp); + + if (ldp->free_list.head->next) { + + line_desc * const ld = (line_desc *)ldp->free_list.head; + + rem(&ld->ld_node); + + if (!ldp->free_list.head->next) { + rem(&ldp->ldp_node); + add_tail(&b->line_desc_pool_list, &ldp->ldp_node); + } + + ldp->allocated_items++; + + ld->line = NULL; + ld->line_len = 0; + if (do_syntax) ld->highlight_state.state = -1; + release_signals(); + return ld; + } + } + + /* No chances, all pools are full. Let's allocate a new one, + using the standard pool size, and let's put it at the start + of the list, so that it is always scanned first. */ + + if (ldp = alloc_line_desc_pool(0, -1)) { + add_head(&b->line_desc_pool_list, &ldp->ldp_node); + line_desc * const ld = (line_desc *)ldp->free_list.head; + rem(&ld->ld_node); + ldp->allocated_items = 1; + if (do_syntax) ld->highlight_state.state = -1; + release_signals(); + return ld; + } + + release_signals(); + return NULL; +} + + + +/* Frees a line descriptor, (and the line descriptor pool containing it, should + it become empty). */ + +void free_line_desc(buffer * const b, line_desc * const ld) { + /* We scan the pool list in order to find where the given + line descriptor lives. */ + + line_desc_pool *ldp; + for(ldp = (line_desc_pool *)b->line_desc_pool_list.head; ldp->ldp_node.next; ldp = (line_desc_pool *)ldp->ldp_node.next) { + assert_line_desc_pool(ldp); + if (do_syntax && ld >= (line_desc *)ldp->pool && ld < (line_desc *)ldp->pool + ldp->size + || !do_syntax && (no_syntax_line_desc *)ld >= (no_syntax_line_desc *)ldp->pool + && (no_syntax_line_desc *)ld < (no_syntax_line_desc *)ldp->pool + ldp->size) break; + } + + assert(ldp->ldp_node.next != NULL); + + block_signals(); + + add_head(&ldp->free_list, &ld->ld_node); + + if (--ldp->allocated_items == 0) { + rem(&ldp->ldp_node); + free_line_desc_pool(ldp); + } + + release_signals(); +} + + +/* Allocates len characters from the character pools of the +given buffer. If necessary, a new pool is allocated. */ + +char *alloc_chars(buffer * const b, const int64_t len) { + if (!len || !b) return NULL; + + assert_buffer(b); + + block_signals(); + + char_pool *cp; + for(cp = (char_pool *)b->char_pool_list.head; cp->cp_node.next; cp = (char_pool *)cp->cp_node.next) { + assert_char_pool(cp); + + /* We try to allocate before the first used character, + or after the last used character. If we succeed with a + pool which is not the head of the list, we move it to + the head in order to optimize the next try. */ + + if (cp->first_used >= len) { + + cp->first_used -= len; + b->free_chars -= len; + + if (cp != (char_pool *)b->char_pool_list.head) { + rem(&cp->cp_node); + add_head(&b->char_pool_list, &cp->cp_node); + } + + release_signals(); + return cp->pool + cp->first_used; + } + else if (cp->size - cp->last_used > len) { + + cp->last_used += len; + b->free_chars -= len; + + if (cp != (char_pool *)b->char_pool_list.head) { + rem(&cp->cp_node); + add_head(&b->char_pool_list, &cp->cp_node); + } + + release_signals(); + return cp->pool + cp->last_used - len + 1; + } + } + + /* If no free space has been found, we allocate a new pool which is guaranteed + to contain at least len characters. The pool is added to the head of the list. */ + + if (cp = alloc_char_pool(len, 0, -1)) { + add_head(&b->char_pool_list, &cp->cp_node); + cp->last_used = len - 1; + + b->allocated_chars += cp->size; + b->free_chars += cp->size - len; + + release_signals(); + return cp->pool; + } + + release_signals(); + return NULL; +} + + + +/* This function is very important, since it embeds all the philosophy behind + ne's character pool management. It performs an allocation *locally*, that + is, it tries to see if there are enough free characters around the line + pointed to by a line descriptor by looking at non-nullness of surrounding + characters (if a character is set to 0, it is free). First the characters + after the line are checked, then the characters before (this can be reversed + via the check_first_before flag). The number of characters available *after* + the line is returned, or ERROR if the allocation failed. The caller can + recover the characters available before the line since he knows the length + of the allocation. Note that it is *only* through this function that the + "lost" characters can be allocated, but being editing a local activity, this + is what happens usually. */ + + +int64_t alloc_chars_around(buffer * const b, line_desc * const ld, const int64_t n, const bool check_first_before) { + + assert(ld->line != NULL); + + char_pool *cp = get_char_pool(b, ld->line); + + assert_char_pool(cp); + + block_signals(); + + char *before = ld->line - 1; + char *after = ld->line + ld->line_len; + + if (check_first_before) { + while(before >= cp->pool && !*before && (ld->line - 1) - before < n) + before--; + while(after < cp->pool + cp->size && !*after && (after - (ld->line + ld->line_len)) + ((ld->line - 1) - before)pool + cp->size && !*after && after - (ld->line + ld->line_len)= cp->pool && !*before && (after - (ld->line + ld->line_len)) + ((ld->line - 1) - before)line - 1) - before) + (after - (ld->line + ld->line_len)) <= n); + assert(((ld->line - 1) - before) + (after - (ld->line + ld->line_len)) >= 0); + + if (((ld->line - 1) - before) + (after - (ld->line + ld->line_len)) == n) { + if (cp->pool + cp->first_used == ld->line) cp->first_used = (before + 1) - cp->pool; + if (cp->pool + cp->last_used == ld->line + ld->line_len - 1) cp->last_used = (after - 1) - cp->pool; + b->free_chars -= n; + + release_signals(); + return after - (ld->line + ld->line_len); + } + + release_signals(); + return ERROR; +} + + + +/* Frees a block of len characters pointed to by p. If the char pool containing + the block becomes completely free, it is removed from the list. */ + +void free_chars(buffer *const b, char *const p, const int64_t len) { + if (!b || !p || !len) return; + + char_pool *cp = get_char_pool(b, p); + + assert_char_pool(cp); + + assert(*p); + assert(p[len - 1]); + + block_signals(); + + memset(p, 0, len); + b->free_chars += len; + + if (p == &cp->pool[cp->first_used]) while(cp->first_used <= cp->last_used && !cp->pool[cp->first_used]) cp->first_used++; + if (p + len - 1 == &cp->pool[cp->last_used]) while(!cp->pool[cp->last_used] && cp->first_used <= cp->last_used) cp->last_used--; + + if (cp->last_used < cp->first_used) { + rem(&cp->cp_node); + b->allocated_chars -= cp->size; + b->free_chars -= cp->size; + free_char_pool(cp); + release_signals(); + return; + } + + assert_char_pool(cp); + release_signals(); +} + + +/* The following functions represent the only legal way of modifying a + buffer. They are all based on insert_stream and delete_stream (except for + the I/O functions). A stream is a sequence of NULL-terminated strings. The + semantics associated is that each string is a separate line terminated by a + line feed, *except for the last one*. Thus, a NULL-terminated string is a + line with no linefeed. All the functions accept a position specified via a + line descriptor and a position (which is the offset to be applied to the + line pointer of the line descriptor). Also the line number is usually + supplied, since it is necessary for recording the operation in the undo + buffer. */ + + +/* Inserts a line at the current position. The effect is obtained by inserting + a stream containing one NULL. */ + + +int insert_one_line(buffer * const b, line_desc * const ld, const int64_t line, const int64_t pos) { + return insert_stream(b, ld, line, pos, "", 1); +} + + +/* Deletes a whole line, putting it in the temporary line buffer used by the + UndelLine command. */ + +int delete_one_line(buffer * const b, line_desc * const ld, const int64_t line) { + assert_line_desc(ld, b->encoding); + assert_buffer(b); + + block_signals(); + + if (ld->line_len && (b->last_deleted = reset_stream(b->last_deleted))) add_to_stream(b->last_deleted, ld->line, ld->line_len); + + /* We delete a line by delete_stream()ing its length plus one. However, if + we are on the last line of text, there is no terminating line feed. */ + + const int error = delete_stream(b, ld, line, 0, ld->line_len + (ld->ld_node.next->next ? 1 : 0)); + release_signals(); + + return error; +} + + + + +/* Undeletes the last deleted line, using the last_deleted stream. */ + +int undelete_line(buffer * const b) { + line_desc * const ld = b->cur_line_desc; + if (!b->last_deleted) return ERROR; + start_undo_chain(b); + if (b->cur_pos > ld->line_len) + insert_spaces(b, ld, b->cur_line, ld->line_len, b->win_x + b->cur_x - calc_width(ld, ld->line_len, b->opt.tab_size, b->encoding)); + + insert_one_line(b, ld, b->cur_line, b->cur_pos); + insert_stream(b, ld, b->cur_line, b->cur_pos, b->last_deleted->stream, b->last_deleted->len); + end_undo_chain(b); + return OK; +} + + + +/* Deletes a line up to its end. */ + +void delete_to_eol(buffer * const b, line_desc * const ld, const int64_t line, const int64_t pos) { + + if (!ld || pos >= ld->line_len) return; + delete_stream(b, ld, line, pos, ld->line_len - pos); +} + + + +/* Inserts a stream in a line at a given position. The position has to be + smaller or equal to the line length. Since the stream can contain many + lines, this function can be used for manipulating all insertions. It also + record the inverse operation in the undo buffer if b->opt.do_undo is + true. */ + +int insert_stream(buffer * const b, line_desc * ld, int64_t line, int64_t pos, const char * const stream, const int64_t stream_len) { + assert(pos >= 0); + assert(stream_len >= 0); + if (!b || !ld || !stream || stream_len < 1 || pos > ld->line_len) return ERROR; + + assert_line_desc(ld, b->encoding); + assert_buffer(b); + + block_signals(); + + if (b->opt.do_undo && !(b->undoing || b->redoing)) { + const int error = add_undo_step(b, line, pos, -stream_len); + if (error) { + release_signals(); + return error; + } + } + + const char *s = stream; + while(s - stream < stream_len) { + int64_t const len = strnlen_ne(s, stream_len - (s - stream)); + if (len) { + + /* First case; there is no character allocated on this line. We + have to freshly allocate the line. */ + + if (!ld->line) { + if (ld->line = alloc_chars(b, len)) { + memcpy(ld->line, s, len); + ld->line_len = len; + } + else { + release_signals(); + return OUT_OF_MEMORY_DISK_FULL; + } + } + + + /* Second case. There are not enough characters around ld->line. Note + that the value of the check_first_before parameter depends on + the position at which the insertion will be done, and it is chosen + in such a way to minimize the number of characters to move. */ + + else { + const int64_t result = alloc_chars_around(b, ld, len, pos < ld->line_len / 2); + if (result < 0) { + char * const p = alloc_chars(b, ld->line_len + len); + if (p) { + memcpy(p, ld->line, pos); + memcpy(&p[pos], s, len); + memcpy(&p[pos + len], ld->line + pos, ld->line_len - pos); + free_chars(b, ld->line, ld->line_len); + ld->line = p; + ld->line_len += len; + } + else { + release_signals(); + return OUT_OF_MEMORY_DISK_FULL; + } + } + else { /* Third case. There are enough free characters around ld->line. */ + if (len - result) memmove(ld->line - (len - result), ld->line, pos); + if (result) memmove(ld->line + pos + result, ld->line + pos, ld->line_len - pos); + memcpy(ld->line - (len - result) + pos, s, len); + + ld->line -= (len - result); + ld->line_len += len; + } + } + b->is_modified = 1; + + /* We just inserted len chars at (line,pos); adjust bookmarks and mark accordingly. */ + if (b->marking && b->block_start_line == line && b->block_start_pos > pos) b->block_start_pos += len; + + for (int i = 0, mask = b->bookmark_mask; mask; i++, mask >>= 1) + if ((mask & 1) && b->bookmark[i].line == line && b->bookmark[i].pos > pos) b->bookmark[i].pos += len; + } + + /* If the string we have inserted has a NULL at the end, we create a new + line under the current one and set ld to point to it. */ + + if (len + (s - stream) < stream_len) { + line_desc *new_ld; + + if (new_ld = alloc_line_desc(b)) { + + add(&new_ld->ld_node, &ld->ld_node); + b->num_lines++; + + if (pos + len < ld->line_len) { + new_ld->line_len = ld->line_len - pos - len; + new_ld->line = &ld->line[pos + len]; + ld->line_len = pos + len; + if (pos + len == 0) ld->line = NULL; + } + + b->is_modified = 1; + ld = new_ld; + + /* We just inserted a line break at (line,pos); + adjust the buffer bookmarks and mark accordingly. */ + if (b->marking) { + if (b->block_start_line == line && b->block_start_pos > pos) { + b->block_start_pos -= pos; + b->block_start_line++; + } + else if (b->block_start_line > line) b->block_start_line++; + } + for (int i = 0, mask=b->bookmark_mask; mask; i++, mask >>= 1) { + if (mask & 1) { + if (b->bookmark[i].line == line && b->bookmark[i].pos > pos) { + b->bookmark[i].pos -= pos; + b->bookmark[i].line++; + } + else if (b->bookmark[i].line > line) b->bookmark[i].line++; + } + } + pos = 0; + line++; + } + else { + release_signals(); + return OUT_OF_MEMORY_DISK_FULL; + } + } + + s += len + 1; + } + + release_signals(); + return OK; +} + + + +/* Inserts a single ISO 10646 character (it creates, if necessary, a suitable + temporary stream). The character must be compatible with the current buffer + encoding. */ + + +int insert_one_char(buffer * const b, line_desc * const ld, const int64_t line, const int64_t pos, const int c) { + static char t[8]; + + assert(b->encoding == ENC_8_BIT || b->encoding == ENC_UTF8 || c <= 127); + assert(b->encoding == ENC_UTF8 || c <= 255); + assert(c != 0); + + if (b->encoding == ENC_UTF8) t[utf8str(c, t)] = 0; + else t[0] = c, t[1] = 0; + + return insert_stream(b, ld, line, pos, t, strlen(t)); +} + + + +/* Inserts a number of spaces. */ + +int insert_spaces(buffer * const b, line_desc * const ld, const int64_t line, const int64_t pos, int64_t n) { + + static char spaces[MAX_STACK_SPACES]; + int result = OK, i; + + if (!spaces[0]) memset(spaces, ' ', sizeof spaces); + + while(result == OK && n > 0) { + i = min(n, MAX_STACK_SPACES); + result = insert_stream(b, ld, line, pos, spaces, i); + n -= i; + } + + assert(result != OK || n == 0); + + return result; +} + + + +/* Deletes a stream of len bytes, that is, deletes len bytes from the given + position, counting line feeds as a byte. The operation is recorded in the + undo buffer. */ + +int delete_stream(buffer * const b, line_desc * const ld, const int64_t line, const int64_t pos, int64_t len) { + assert_buffer(b); + assert_line_desc(ld, b->encoding); + + /* If we are in no man's land, we return. */ + if (!b || !ld || !len || pos > ld->line_len || pos == ld->line_len && !ld->ld_node.next->next) return ERROR; + + block_signals(); + + if (b->opt.do_undo && !(b->undoing || b->redoing)) { + const int error = add_undo_step(b, line, pos, len); + if (error) { + release_signals(); + return error; + } + } + + while(len) { + /* First case: we are just on the end of a line. We join the current + line with the following one (if it's there of course). If, however, + the current line is empty, we rather remove it. The only difference + is in the resulting syntax state. */ + + if (pos == ld->line_len) { + line_desc *next_ld = (line_desc *)ld->ld_node.next; + /* There's nothing more to do--we are at the end of the file. */ + if (next_ld->ld_node.next == NULL) break; + + /* We're about to join line+1 to line; adjust mark and bookmarks accordingly. */ + if (b->marking) { + if (b->block_start_line == line+1) { + b->block_start_line--; + b->block_start_pos += ld->line_len; + } + else if (b->block_start_line > line) b->block_start_line--; + } + for (int i = 0, mask = b->bookmark_mask; mask; i++, mask >>= 1) { + if (mask & 1) { + if (b->bookmark[i].line == line+1) { + b->bookmark[i].line--; + b->bookmark[i].pos += ld->line_len; + } + else if (b->bookmark[i].line > line) b->bookmark[i].line--; + } + } + + /* If one of the lines is empty, or their contents are adjacent, + we either do nothing or simply set a pointer. */ + + if (!ld->line || !next_ld->line || ld->line + ld->line_len == next_ld->line) { + if (!ld->line) ld->line = next_ld->line; + } + else { + int64_t n, m; + if ((n = alloc_chars_around(b, ld, next_ld->line_len, false))<0 && (m = alloc_chars_around(b, next_ld, ld->line_len, true))<0) { + /* We try to allocate characters around one line or the other + one; if we fail, we allocate enough space for both lines elsewhere. */ + char * const p = alloc_chars(b, ld->line_len + next_ld->line_len); + if (p) { + + memcpy(p, ld->line, ld->line_len); + memcpy(p + ld->line_len, next_ld->line, next_ld->line_len); + + free_chars(b, ld->line, ld->line_len); + free_chars(b, next_ld->line, next_ld->line_len); + + ld->line = p; + } + else { + release_signals(); + if (b->opt.do_undo && !(b->undoing || b->redoing)) fix_last_undo_step(b, -len); + return OUT_OF_MEMORY_DISK_FULL; + } + } + + /* In case one of the alloc_chars_around succeeds, we have just to + move the lines in the right place. */ + + else if (n >= 0) { + if (n < next_ld->line_len) memmove(ld->line + (n - next_ld->line_len), ld->line, ld->line_len); + ld->line += (n - next_ld->line_len); + memcpy(ld->line + ld->line_len, next_ld->line, next_ld->line_len); + + free_chars(b, next_ld->line, next_ld->line_len); + } + else { + if (m) memmove(next_ld->line + m, next_ld->line, next_ld->line_len); + next_ld->line += m; + memcpy(next_ld->line - ld->line_len, ld->line, ld->line_len); + + free_chars(b, ld->line, ld->line_len); + + ld->line = next_ld->line - ld->line_len; + } + } + + ld->line_len += next_ld->line_len; + b->num_lines--; + + rem(&next_ld->ld_node); + free_line_desc(b, next_ld); + + len--; + if (!b->redoing) { + if (b->undoing) add_to_stream(&b->undo.redo, "", 1); + else if (b->opt.do_undo) add_to_undo_stream(&b->undo, "", 1); + } + } + + /* Second case: we are inside a line. We delete len bytes or, if + there are less then len bytes to delete, we delete up to the end + of the line. In the latter case, we simply set the line length and + free the corresponding bytes. Otherwise, the number of bytes to + move is minimized. */ + + else { + int64_t n = len > ld->line_len - pos ? ld->line_len - pos : len; + + /* We're about to erase n chars at (line,pos); adjust mark and bookmarks accordingly. */ + if (b->marking) + if (b->block_start_line == line) + if (b->block_start_pos >= pos) + if (b->block_start_pos < pos + n) + b->block_start_pos = pos; + else + b->block_start_pos -= n; + for (int i = 0, mask = b->bookmark_mask; mask; i++, mask>>=1) { + if (mask & 1) { + if (b->bookmark[i].line == line) + if (b->bookmark[i].pos >= pos) + if (b->bookmark[i].pos < pos + n) b->bookmark[i].pos = pos; + else b->bookmark[i].pos -= n; + } + } + + if (!b->redoing) { + if (b->undoing) add_to_stream(&b->undo.redo, &ld->line[pos], n); + else if (b->opt.do_undo) add_to_undo_stream(&b->undo, &ld->line[pos], n); + } + + if (n == ld->line_len - pos) free_chars(b, &ld->line[pos], n); + else { + if (pos < ld->line_len / 2) { + memmove(ld->line + n, ld->line, pos); + free_chars(b, ld->line, n); + ld->line += n; + } + else { + memmove(ld->line + pos, ld->line + pos + n, ld->line_len - pos - n); + free_chars(b, &ld->line[ld->line_len - n], n); + } + } + + if (!(ld->line_len -= n)) ld->line = NULL; + len -= n; + + assert_line_desc(ld, b->encoding); + } + b->is_modified = 1; + } + + if (b->opt.do_undo && !(b->undoing || b->redoing)) fix_last_undo_step(b, -len); + + release_signals(); + return OK; +} + + +/* Deletes a single character. */ + +int delete_one_char(buffer * const b, line_desc * const ld, const int64_t line, const int64_t pos) { + return delete_stream(b, ld, line, pos, b->encoding == ENC_UTF8 && pos < ld->line_len ? utf8len(ld->line[pos]) : 1); +} + +/* Returns the line descriptor for line n of buffer b, or NULL if n is out of range. + We assume that cur_line and cur_line_desc are coherent, and try to use the + faster way (i.e., relative or absolute). */ + +line_desc *nth_line_desc(const buffer *b, const int64_t n) { + if (n < 0 || n >= b->num_lines) return NULL; + + line_desc *ld; + const int64_t best_absolute_cost = min(n, b->num_lines - 1 - n); + const int64_t relative_cost = b->cur_line < n ? n - b->cur_line : b->cur_line - n; + + if (best_absolute_cost < relative_cost) { + if (n < b->num_lines / 2) { + ld = (line_desc *)b->line_desc_list.head; + for(int64_t i = 0; i < n; i++) ld = (line_desc *)ld->ld_node.next; + } + else { + ld = (line_desc *)b->line_desc_list.tail_pred; + for(int64_t i = 0; i < b->num_lines - 1 - n; i++) { + if ( i == -1 ) fputc('.', stderr); /* This is a nop that's here just to avoid a gcc bug. */ + ld = (line_desc *)ld->ld_node.prev; + } + } + } + else { + ld = (line_desc *)b->cur_line_desc; + if (n < b->cur_line) for(int64_t i = 0; i < b->cur_line - n; i++) ld = (line_desc *)ld->ld_node.prev; + else for(int64_t i = 0; i < n - b->cur_line; i++) ld = (line_desc *)ld->ld_node.next; + } + + return ld; +} + +/* Changes the buffer file name to the given string, which must have been + obtained through malloc(). */ + +void change_filename(buffer * const b, char * const name) { + assert(name != NULL); + + if (b->filename) free(b->filename); + b->filename = name; +} + + +/* Here we load a file into a given buffer. The buffer lists are deallocated + first. If there is not write access to the file, the read-only flag is set. + Note that we consider line feeds 0x0A's, 0x0D's and 0x00's (the last being + made necessary by the way the pools are handled), unless the binary flag is + set, in which case we consider only the 0x00's. */ + +int load_file_in_buffer(buffer * const b, const char *name) { + if (!b) return ERROR; + assert_buffer(b); + + name = tilde_expand(name); + + if (is_directory(name)) return FILE_IS_DIRECTORY; + if (is_migrated(name)) return FILE_IS_MIGRATED; + + const int fd = open(name, READ_FLAGS); + if (fd >= 0) { + const int result = load_fd_in_buffer(b, fd); + close(fd); + b->mtime = file_mod_time(name); + if (!result) b->opt.read_only = (access(name, W_OK) != 0); + return result; + } + + return CANT_OPEN_FILE; +} + +/* Support function for load_fd_in_buffer(). */ + +static int create_mmap_files(buffer * const b, const int fd, const int char_fd, const int ld_fd, const size_t len, const int line_desc_size, char * const terminators) { + /* A circular buffer whose first and second half are alternately written and reloaded. */ + char buffer[CIRC_BUFFER_SIZE * 2]; + /* A buffer for line descriptors. */ + char ld_buffer[LD_BUFFER_COUNT * line_desc_size]; + line_desc *ld_buffer_syn = (line_desc *)ld_buffer; + no_syntax_line_desc *ld_buffer_no_syn = (no_syntax_line_desc *)ld_buffer; + int ld_count = 0; + size_t remaining = len; + + size_t to_do = min(remaining, sizeof buffer); + ssize_t result = read(fd, buffer, to_do); + if (result < to_do) return IO_ERROR; + remaining -= to_do; + int i = 0; + int64_t curr_pos = 0, start_of_line = 0, end_of_line = 0; + + while(curr_pos < len) { + /* Here we replicate the logic of load_fd_in_buffer(). The circularity of the buffer + makes it possible to check the current character and the following one. */ + if (!b->opt.binary && (buffer[i] == terminators[0] || buffer[i] == terminators[1]) || !buffer[i]) { + end_of_line = curr_pos; + + if (curr_pos < len - 1 && buffer[i] == '\r' && buffer[i + 1 & sizeof buffer - 1] == '\n') { + b->is_CRLF = true; + buffer[i] = 0; + curr_pos++; + b->free_chars++; + + i = i + 1 & sizeof buffer - 1; + if ((i & sizeof buffer / 2 - 1) == 0) { // Buffer flip-flop + char * const p = buffer + (i ^ sizeof buffer / 2); + if (write(char_fd, p, sizeof buffer / 2) < sizeof buffer / 2) return OUT_OF_MEMORY_DISK_FULL; + to_do = min(remaining, sizeof buffer / 2); + ssize_t result = read(fd, p, to_do); + if (result < to_do) return IO_ERROR; + remaining -= to_do; + } + } + + b->num_lines++; + /* Line descriptors are created with an offset from the start + of fd, rather than an absolute pointer in memory. They will be + fixed afterwards. */ + if (do_syntax) { + ld_buffer_syn[ld_count].line = (char *)start_of_line; + ld_buffer_syn[ld_count].line_len = end_of_line - start_of_line; + } + else { + ld_buffer_no_syn[ld_count].line = (char *)start_of_line; + ld_buffer_no_syn[ld_count].line_len = end_of_line - start_of_line; + } + if (++ld_count == LD_BUFFER_COUNT) { + if (write(ld_fd, ld_buffer, LD_BUFFER_COUNT * line_desc_size) < LD_BUFFER_COUNT * line_desc_size) return OUT_OF_MEMORY_DISK_FULL; + ld_count = 0; + } + b->free_chars++; + buffer[i] = 0; + start_of_line = curr_pos + 1; + } + + curr_pos++; + + i = i + 1 & sizeof buffer - 1; + if ((i & sizeof buffer / 2 - 1) == 0) { // Buffer flip-flop + char * const p = buffer + (i ^ sizeof buffer / 2); + if (write(char_fd, p, sizeof buffer / 2) < sizeof buffer / 2) return OUT_OF_MEMORY_DISK_FULL; + to_do = min(remaining, sizeof buffer / 2); + ssize_t result = read(fd, p, to_do); + if (result < to_do) return IO_ERROR; + remaining -= to_do; + } + } + + if ((i & sizeof buffer / 2 - 1) != 0 + && write(char_fd, buffer + (i & sizeof buffer / 2), i & sizeof buffer / 2 - 1) < (i & sizeof buffer / 2 - 1)) return OUT_OF_MEMORY_DISK_FULL; + + b->num_lines++; + if (do_syntax) { + ld_buffer_syn[ld_count].line = (char *)start_of_line; + ld_buffer_syn[ld_count].line_len = curr_pos - start_of_line; + } + else { + ld_buffer_no_syn[ld_count].line = (char *)start_of_line; + ld_buffer_no_syn[ld_count].line_len = curr_pos - start_of_line; + } + ld_count++; + if (write(ld_fd, ld_buffer, ld_count * line_desc_size) < ld_count * line_desc_size) return OUT_OF_MEMORY_DISK_FULL; + + return OK; +} + + +int load_fd_mmap(buffer * const b, const int fd, const size_t len, char * const terminators, char_pool **cp, line_desc_pool **ldp) { + char template[16]; + const int char_fd = mkstemp(strcpy(template, ".ne-mmap-XXXXXX")); + unlink(template); + const int ld_fd = mkstemp(strcpy(template, ".ne-mmap-XXXXXX")); + unlink(template); + const int line_desc_size = do_syntax ? sizeof(line_desc) : sizeof(no_syntax_line_desc); + char * char_p = MAP_FAILED, * ld_p = MAP_FAILED; + + if (char_fd != -1 && ld_fd != -1) { + const int error = create_mmap_files(b, fd, char_fd, ld_fd, len, line_desc_size, terminators); + if (error) { + close(char_fd); + close(ld_fd); + return error; + } + + char_p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, char_fd, 0); + ld_p = mmap(NULL, b->num_lines * line_desc_size, PROT_READ | PROT_WRITE, MAP_SHARED, ld_fd, 0); + + if (char_p != MAP_FAILED && ld_p != MAP_FAILED + && (*cp = alloc_char_pool_from_memory(char_p, len)) && (*ldp = alloc_line_desc_pool_from_memory(ld_p, b->num_lines))) { + (*cp)->mapped = true; + (*ldp)->mapped = true; + b->allocated_chars = len; + + /* We replace the offsets from the start of the file with actual memory + pointers, while adding the line descriptors to the buffer list. */ + if (do_syntax) { + for(line_desc *ld = (line_desc *)ld_p, *ld_end = ld + b->num_lines; ld < ld_end; ld++) { + ld->line = ld->line_len ? char_p + (int64_t)ld->line : NULL; + add_tail(&b->line_desc_list, &ld->ld_node); + } + } + else { + for(no_syntax_line_desc *ld = (no_syntax_line_desc *)ld_p, *ld_end = ld + b->num_lines; ld < ld_end; ld++) { + ld->line = ld->line_len ? char_p + (int64_t)ld->line : NULL; + add_tail(&b->line_desc_list, &ld->ld_node); + } + } + + return OK; + } + else { + close(char_fd); + close(ld_fd); + int error = IO_ERROR; + if (char_p != MAP_FAILED) munmap(char_p, len); + if (ld_p != MAP_FAILED) munmap(ld_p, b->num_lines * line_desc_size); + if (char_p != MAP_FAILED && ld_p != MAP_FAILED) error = OUT_OF_MEMORY; + if (*cp) free(*cp); + if (*ldp) free(*ldp); + return error; + } + } + else { + if (char_fd != -1) close(char_fd); + if (ld_fd != -1) close(ld_fd); + return IO_ERROR; + } +} + + +/* This function, together with insert_stream and delete_stream, is the only + way of modifying the contents of a buffer. While loading a file could have + passed through insert_stream, it would have been intolerably slow for large + files. The flexible pool structure of ne makes it possible loading the + file with a single read in a big pool. */ + +int load_fd_in_buffer(buffer *b, int fd) { + char terminators[] = { 0x0d, 0x0a }; + if (b->opt.preserve_cr) terminators[0] = 0; + + off_t len = lseek(fd, 0, SEEK_END); + + if (len == 0) { + clear_buffer(b); + b->encoding = ENC_ASCII; + if (b->opt.do_undo) b->undo.last_save_step = 0; + return OK; + } + + /* In the following code, we create a character pool and a line descriptor + pool either by loading into memory, or by memory mapping. We are expected + to compute the number of lines. */ + char_pool *cp = NULL; + line_desc_pool *ldp = NULL; + + if (len > 0) { /* Seekable */ + if (lseek(fd, 0, SEEK_SET) < 0) return IO_ERROR; + block_signals(); + free_buffer_contents(b); + cp = alloc_char_pool(len, fd, 0); + + if (! cp) { // mmap() + const int error = load_fd_mmap(b, fd, len, terminators, &cp, &ldp); + if (error) { + clear_buffer(b); + release_signals(); + return error; + } + } + } + else { /* Not seekable */ + block_signals(); + free_buffer_contents(b); + + int64_t curr_size = START_SIZE; + len = 0; + char *pool = calloc(curr_size, 1); + for(;;) { + const int64_t res = read_safely(fd, pool + len, curr_size - len); + if (res < 0) { + free(pool); + clear_buffer(b); + release_signals(); + return IO_ERROR; + } + len += res; + if (len < curr_size) break; + char * const new_pool = realloc(pool, curr_size *= 2); + if (new_pool == NULL) { + free(pool); + clear_buffer(b); + release_signals(); + return OUT_OF_MEMORY; + } + pool = new_pool; + memset(pool + len, 0, curr_size - len); + } + + cp = alloc_char_pool_from_memory(pool, curr_size); + if (!cp) { + free(pool); + clear_buffer(b); + release_signals(); + return OUT_OF_MEMORY; + } + } + + if (! ldp) { // Not mmap()'s + b->allocated_chars = cp->size; + b->free_chars = cp->size - len; + + char *p = cp->pool; + + /* This is the first pass on the data we just read. We count the number + of lines. If we meet a CR/LF sequence and we did not ask for binary + files, we decide the file is of CR/LF type. Note that this cannot happen + if preserve_cr is set. */ + + for(int64_t i = b->num_lines = 0; i < len; i++, p++) + if (!b->opt.binary && (*p == terminators[0] || *p == terminators[1]) || !*p) { + if (i < len - 1 && p[0] == '\r' && p[1] == '\n') { + b->is_CRLF = true; + p++, i++; + b->free_chars++; + } + b->num_lines++; + b->free_chars++; + } + + b->num_lines++; + + ldp = alloc_line_desc_pool(b->num_lines + STANDARD_LINE_INCREMENT, -1); + if (ldp) { + + char *p = cp->pool, * const end = p + len; + + /* This is the second pass. Here we find the actual lines, and set to + NUL the line terminators if necessary, following the same rationale of + the first pass (this is important, as b->free_chars has been computed + on the first pass). */ + + for(int64_t i = 0; i < b->num_lines; i++) { + line_desc *ld = do_syntax ? &((line_desc *)ldp->pool)[i] : (line_desc *)&((no_syntax_line_desc *)ldp->pool)[i]; + rem(&ld->ld_node); + add_tail(&b->line_desc_list, &ld->ld_node); + + char *q = p; + while(q < end && (b->opt.binary || *q != terminators[0] && *q != terminators[1]) && *q) q++; + + ld->line_len = q - p; + ld->line = q - p ? p : NULL; + + if (q < end) { + if (q - cp->pool < len - 1 && q[0] == '\r' && q[1] == '\n') *q++ = 0; + *q++ = 0; + } + + p = q; + } + + ldp->allocated_items = b->num_lines; + } + else { + free_char_pool(cp); + clear_buffer(b); + release_signals(); + return OUT_OF_MEMORY_DISK_FULL; + } + } + + /* Now, if UTF-8 auto-detection is enabled, we try to guess whether this + buffer is in UTF-8. */ + + const encoding_type encoding = detect_encoding(cp->pool, len); + if (encoding == ENC_ASCII) b->encoding = ENC_ASCII; + else { + if (b->opt.utf8auto && encoding == ENC_UTF8) b->encoding = ENC_UTF8; + else b->encoding = ENC_8_BIT; + } + + /* We set correctly the offsets of the first and last character used. If no + character is used (i.e., we have a file of line feeds), the char pool is + freed. */ + + if (b->free_chars < b->allocated_chars) { + cp->last_used = len; + while(!cp->pool[cp->first_used]) cp->first_used++; + while(!cp->pool[--cp->last_used]); + add_head(&b->char_pool_list, &cp->cp_node); + + assert_char_pool(cp); + } + else free_char_pool(cp); + + add_head(&b->line_desc_pool_list, &ldp->ldp_node); + + reset_position_to_sof(b); + if (b->opt.do_undo) b->undo.last_save_step = 0; + release_signals(); + return OK; +} + +/* Recomputes initial states for all lines in a buffer. */ + +void reset_syntax_states(buffer *b) { + if (b->syn) { + HIGHLIGHT_STATE next_line_state = { 0, 0, "" }; + for(line_desc *ld = (line_desc *)b->line_desc_list.head; ld->ld_node.next; ld = (line_desc *)ld->ld_node.next) { + ld->highlight_state = next_line_state; + next_line_state = parse(b->syn, ld, next_line_state, b->encoding == ENC_UTF8); + } + + b->attr_len = -1; + } +} + + +/* Ensures that the attribute buffer of this buffer is large enough. */ + +void ensure_attr_buf(buffer * const b, const int64_t capacity) { + if (capacity == 0) return; + /* attr_buf already exists? */ + if (!b->attr_buf) { + b->attr_size = capacity; + b->attr_buf = malloc(b->attr_size * sizeof *b->attr_buf); + } + else if (capacity > b->attr_size) { + b->attr_size = capacity; + b->attr_buf = realloc(b->attr_buf, b->attr_size * sizeof *b->attr_buf); + } +} + + +/* Here we save a buffer to a given file. If no file is specified, the + buffer filename field is used. The is_modified flag is set to 0, + and the mtime is updated. */ + + +int save_buffer_to_file(buffer *b, const char *name) { + line_desc *ld = (line_desc *)b->line_desc_list.head; + + if (!b) return ERROR; + + assert_buffer(b); + + if (name == NULL) name = b->filename; + + if (!name) return ERROR; + + name = tilde_expand(name); + + if (is_directory(name)) return FILE_IS_DIRECTORY; + if (is_migrated(name)) return FILE_IS_MIGRATED; + + block_signals(); + + int error = OK; + const int fd = open(name, WRITE_FLAGS, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + if (fd >= 0) { + + /* If we can allocate SAVE_BLOCK_LEN bytes, we will use + them as a buffer for our saves. */ + + char * const p = malloc(SAVE_BLOCK_LEN + 1); + if (p) { + + /* used keeps track of the number of bytes used in the buffer. l, len + specify the pointer to the block of characters to save, and + its length. In case of very long lines, or buffer border crossing, + they could point in the middle of a line descriptor. */ + + int64_t used = 0, len; + char *l; + + while(ld->ld_node.next) { + l = ld->line; + len = ld->line_len; + + while(len > 0) { + if (SAVE_BLOCK_LEN - used > len) { + memcpy(p + used, l, len); + used += len; + len = 0; + } + else { + memcpy(p + used, l, SAVE_BLOCK_LEN - used); + len -= SAVE_BLOCK_LEN - used; + l += SAVE_BLOCK_LEN - used; + + used = 0; + + if (write(fd, p, SAVE_BLOCK_LEN) < SAVE_BLOCK_LEN) { + error = CANNOT_SAVE_DISK_FULL; + break; + } + } + } + + if (error) break; + + ld = (line_desc *)ld->ld_node.next; + + /* Note that the two previous blocks never leave used == SAVE_BLOCK_LEN. + Thus, we can always assume there are two free bytes at p+used. */ + + if (ld->ld_node.next) { + if (b->opt.binary) p[used++] = 0; + else { + if (b->is_CRLF) p[used++] = '\r'; + p[used++] = '\n'; + } + } + + if (used >= SAVE_BLOCK_LEN) { + if (write(fd, p, used) < used) { + error = IO_ERROR; + break; + } + else used = 0; + } + } + + if (!error && used && write(fd, p, used) < used) error = IO_ERROR; + + free(p); + } + else { + + /* If the buffer is not available, just save line by line. */ + + while(ld->ld_node.next) { + + if (ld->line) { + if (write(fd, ld->line, ld->line_len) < ld->line_len) { + error = IO_ERROR; + break; + } + } + + ld = (line_desc *)ld->ld_node.next; + + if (ld->ld_node.next) { + if (!b->opt.binary && b->is_CRLF && write(fd, "\r", 1) < 1) { + error = IO_ERROR; + break; + } + if (write(fd, b->opt.binary ? "\0" : "\n", 1) < 1) { + error = IO_ERROR; + break; + } + } + } + } + + if (close(fd)) error = IO_ERROR; + if (error == OK) b->is_modified = 0; + b->mtime = file_mod_time(name); + } + else error = CANT_OPEN_FILE; + + release_signals(); + return error; +} + + +/* + +g + line_desc *alloc_line_desc(buffer * cons + herep + + uffer handling functions, including allocation, deallocation, and I/O. + line_desc *alloc_line_desc(buffer * const b) {} Buffer handling functions, including allocation, deallocation, and I/O. + line_desc *alloc_line_desc(buffer * const b) {} Buffer handling functions, including allocation, deallocation, and I/O. + line_desc *alloc_line_desc(buffer * const b) {} Buffer handling functions, including allocation, deallocation, and I/O. + line_desc *alloc_line_desc(buffer * const b) {} Buffer handling functions, including allocation, deallocation, and I/O. +en buf +ffer has +er to th +on the o +t caused + + +uffer *b +s_modifi +char *p; +if (b->f + + + + +} +else if +save_buf +free(p); + + + + + +Autosaves a gfer. If the buffer has a name, a '#' is prefixed to + it. If the bu no name, a fake name is generated using the PID of ne + and the pointe buffer structure. This ensures uniqueness. Autosave + never writes riginal file, also because it can be called during an + emergency exi by a signal. */ + + +void auto_save(b) { + if (b->ied) { + + ilename) { + if (p = malloc(strlen(file_part(b->filename)) + )) { + strcpy(p, "#"); + strcat(p, file_part(b->filename)); + } + + (p = malloc(MAX_INT_LEN * )) sprintf(p, "%p.%x", b, getpid()); + fer_to_file(b, p); + + } +} +; + x + } +assert(((ld->line +- +1) +- +before) ++ +(after +- +(ld->line ++ +ld->line_len)) +<= +n);m + release_signals(); +A \ No newline at end of file diff -pruN 3.1.1-1/src/buffer.c 3.1.2-1/src/buffer.c --- 3.1.1-1/src/buffer.c 2017-05-17 17:00:22.000000000 +0000 +++ 3.1.2-1/src/buffer.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Buffer handling functions, including allocation, deallocation, and I/O. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/clips.c 3.1.2-1/src/clips.c --- 3.1.1-1/src/clips.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/clips.c 2018-10-04 15:00:02.000000000 +0000 @@ -1,7 +1,7 @@ /* Clip handling functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -181,7 +181,7 @@ int copy_to_clip(buffer *b, int n, bool if (cut) { goto_line_pos(b, b->block_start_line, b->block_start_pos); delete_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, clip_len); - update_syntax_and_lines(b, b->cur_line_desc, NULL); + update_syntax_states_delay(b, b->cur_line_desc, NULL); } if (chaining) end_undo_chain(b); @@ -241,7 +241,7 @@ int copy_to_clip(buffer *b, int n, bool set_stream_encoding(cd->cs, b->encoding); assert_clip_desc(cd); if (cut) delete_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, clip_len); - update_syntax_and_lines(b, b->cur_line_desc, NULL); + update_syntax_states_delay(b, b->cur_line_desc, NULL); if (chaining) end_undo_chain(b); return OK; } @@ -262,9 +262,10 @@ int copy_to_clip(buffer *b, int n, bool -/* Simply erases a block, without putting it in a clip. Calls update_syntax_and_lines(). */ +/* Simply erases a block, without putting it in a clip. Calls + update_syntax_states_delay() if update is true. */ -int erase_block(buffer *b) { +int erase_block(buffer *b, const bool update) { if (!b->marking) return MARK_BLOCK_FIRST; if (b->block_start_line >= b->num_lines) return MARK_OUT_OF_BUFFER; @@ -323,7 +324,7 @@ int erase_block(buffer *b) { delete_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, erase_len - 1); if (chaining) end_undo_chain(b); - update_syntax_and_lines(b, b->cur_line_desc, NULL); + if (update) update_syntax_states_delay(b, b->cur_line_desc, NULL); return OK; } @@ -351,7 +352,7 @@ int paste_to_buffer(buffer *b, int n) { end_undo_chain(b); assert(ld == b->cur_line_desc); - update_syntax_and_lines(b, ld, end_ld); + update_syntax_states_delay(b, ld, end_ld); return OK; } @@ -427,7 +428,7 @@ int copy_vert_to_clip(buffer *b, int n, set_stream_encoding(cd->cs, b->encoding); assert_clip_desc(cd); if (cut) { - update_syntax_and_lines(b, (line_desc *)ld->ld_node.next, b->cur_line_desc); + update_syntax_states_delay(b, (line_desc *)ld->ld_node.next, b->cur_line_desc); goto_line_pos(b, min(b->block_start_line, b->cur_line), min(b->block_start_pos, cur_pos)); end_undo_chain(b); } @@ -468,7 +469,7 @@ int copy_vert_to_clip(buffer *b, int n, set_stream_encoding(cd->cs, b->encoding); assert_clip_desc(cd); if (cut) { - update_syntax_and_lines(b, b->cur_line_desc, (line_desc *)ld->ld_node.prev); + update_syntax_states_delay(b, b->cur_line_desc, (line_desc *)ld->ld_node.prev); goto_line_pos(b, min(b->block_start_line, b->cur_line), min(b->block_start_pos, cur_pos)); end_undo_chain(b); } @@ -487,10 +488,10 @@ int copy_vert_to_clip(buffer *b, int n, return OK; } -/* Simply erases a vertical block, without putting it in a clip. Calls update_syntax_and_lines(). */ - -int erase_vert_block(buffer *b) { +/* Simply erases a vertical block, without putting it in a clip. Calls + update_syntax_states_delay() if update is true. */ +int erase_vert_block(buffer *b, const bool update) { if (!b->marking) return MARK_BLOCK_FIRST; if (b->block_start_line >= b->num_lines) return MARK_OUT_OF_BUFFER; @@ -524,7 +525,7 @@ int erase_vert_block(buffer *b) { delete_stream(b, ld, i, start_pos, len); ld = (line_desc *)ld->ld_node.prev; } - update_syntax_and_lines(b, (line_desc *)ld->ld_node.next, b->cur_line_desc); + if (update) update_syntax_states_delay(b, (line_desc *)ld->ld_node.next, b->cur_line_desc); } else { for(int64_t i = y; i <= b->block_start_line; i++) { @@ -533,7 +534,7 @@ int erase_vert_block(buffer *b) { delete_stream(b, ld, i, start_pos, len); ld = (line_desc *)ld->ld_node.next; } - update_syntax_and_lines(b, b->cur_line_desc, (line_desc *)ld->ld_node.prev); + if (update) update_syntax_states_delay(b, b->cur_line_desc, (line_desc *)ld->ld_node.prev); } end_undo_chain(b); @@ -595,7 +596,7 @@ int paste_vert_to_buffer(buffer *b, int } end_undo_chain(b); - update_syntax_and_lines(b, b->cur_line_desc, ld); + update_syntax_states_delay(b, b->cur_line_desc, ld); return OK; } diff -pruN 3.1.1-1/src/cm.c 3.1.2-1/src/cm.c --- 3.1.1-1/src/cm.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/cm.c 2018-10-02 14:18:17.000000000 +0000 @@ -4,7 +4,7 @@ Copyright (C) 1985, 1995 Free Software Foundation, Inc. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/cm.h 3.1.2-1/src/cm.h --- 3.1.1-1/src/cm.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/cm.h 2018-10-02 14:18:17.000000000 +0000 @@ -4,7 +4,7 @@ Copyright (C) 1985, 1989 Free Software Foundation, Inc. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/command.c 3.1.2-1/src/command.c --- 3.1.1-1/src/command.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/command.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Command table manipulation functions and vectors. - Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1993-1998 Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -158,7 +158,7 @@ static const command commands[ACTION_COU { NAHL(RECORD ), IS_OPTION | DO_NOT_RECORD }, { NAHL(REDO ),0 }, { NAHL(REFRESH ), NO_ARGS }, - { NAHL(REPEATLAST ),0 }, + { NAHL(REPEATLAST ), ARG_IS_STRING | EMPTY_STRING_OK }, { NAHL(REPLACE ), ARG_IS_STRING | EMPTY_STRING_OK }, { NAHL(REPLACEALL ), ARG_IS_STRING | EMPTY_STRING_OK }, { NAHL(REPLACEONCE ), ARG_IS_STRING | EMPTY_STRING_OK }, @@ -690,7 +690,7 @@ char *find_key_strokes(int c, int n) { char *bound_keys_string(int c) { char *key_strokes = find_key_strokes(c, 9); - char *str=NULL, *p; + char *str=NULL; if (key_strokes) { if ((str = malloc(strlen(key_strokes) + 16))) strcat(strcpy(str, "Bound keys(s): "), key_strokes); diff -pruN 3.1.1-1/src/debug.h 3.1.2-1/src/debug.h --- 3.1.1-1/src/debug.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/debug.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Definition for debug statements and assertions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/display.c 3.1.2-1/src/display.c --- 3.1.1-1/src/display.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/display.c 2018-10-04 15:00:02.000000000 +0000 @@ -1,7 +1,7 @@ /* Display handling functions with optional update delay Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -94,7 +94,6 @@ void update_syntax_states(buffer *b, int bool got_end_ld = end_ld == NULL; bool invalidate_attr_buf = false; HIGHLIGHT_STATE next_line_state = b->attr_len < 0 ? parse(b->syn, ld, ld->highlight_state, b->encoding == ENC_UTF8) : b->next_state; - assert(b->attr_len < 0 || b->attr_len == calc_char_len(ld, ld->line_len, b->encoding)); for(;;) { @@ -105,7 +104,6 @@ void update_syntax_states(buffer *b, int /* We update lines until next_line_state is equal to our current highlight_state, but we go until end_ld if it is not NULL. In any case, we bail out at the end of the file. */ if ((highlight_cmp(&ld->highlight_state, &next_line_state) && got_end_ld) || !ld->ld_node.next) break; - if (row >= 0) { row++; if (row < ne_lines - 1) { @@ -183,9 +181,8 @@ void output_line_desc(const int row, con if (*s == '\t') { const int tab_width = tab_size - curr_col % tab_size; - int i; - for(i = 0; i < tab_width; i++) + for(int i = 0; i < tab_width; i++) if (curr_col + i >= from_col && curr_col + i < from_col + num_cols) { move_cursor(row, output_col + i); output_char(' ', attr ? attr[attr_pos] : 0, false); @@ -196,7 +193,7 @@ void output_line_desc(const int row, con else { const int c_width = output_width(c); - if (output_col >= col || output_col + c_width > col && output_col >= 0) { + if (output_col >= col) { if (output_col + c_width <= ne_columns) { if (attr) { /* In the case of a differential update, we output only @@ -218,6 +215,15 @@ void output_line_desc(const int row, con output_spaces(ne_columns - output_col, attr ? &attr[attr_pos] : NULL); } } + else if (output_col + c_width > col) { + /* The caracter is only partially displayed. We can only output spaces. */ + const int output_width = output_col + c_width - col; + for(int i = 0; i < output_width; i++) { + move_cursor(row, col + i); + output_char(' ', attr ? attr[attr_pos] : 0, false); + } + } + curr_col += c_width; } s += c_len; @@ -251,7 +257,7 @@ void output_line_desc(const int row, con After a call to this function with argument b->cur_line_desc, b->attr_buf will be updated so to contain again the currently displayed - attributes, unless no refresh has been performed, in which base + attributes, unless no refresh has been performed, in which case b->attr_len will be set to -1. */ @@ -288,7 +294,8 @@ void update_line(buffer * const b, line_ /* If we updated current line, we update the local attribute buffer. */ b->next_state = next_state; ensure_attr_buf(b, attr_len); - memcpy(b->attr_buf, attr_buf, (b->attr_len = attr_len) * sizeof *b->attr_buf); + // This test is necessary to avoid warnings from -fsanitize + if (b->attr_len = attr_len) memcpy(b->attr_buf, attr_buf, attr_len * sizeof *b->attr_buf); } } else output_line_desc(row, from_col, ld, from_col + b->win_x, ne_columns - from_col, b->opt.tab_size, cleared_at_end, b->encoding == ENC_UTF8, NULL, NULL, 0); @@ -346,7 +353,7 @@ void update_window(buffer * const b) { a call to delay_update(). This is mainly written to fix the screen state after a block operation. */ -void update_syntax_and_lines(buffer *b, line_desc *start_ld, line_desc *end_ld) { +void update_syntax_states_delay(buffer *b, line_desc *start_ld, line_desc *end_ld) { delay_update(); if (b->syn) { @@ -373,20 +380,21 @@ void update_syntax_and_lines(buffer *b, taken into consideration. */ void update_deleted_char(buffer * const b, const int c, const int a, line_desc * const ld, int64_t pos, int64_t attr_pos, const int line, const int x) { - if (b->syn) { - assert(b->attr_len >= 0); - assert(b->attr_len - 1 == calc_char_len(ld, ld->line_len, b->encoding)); - memmove(b->attr_buf + attr_pos, b->attr_buf + attr_pos + 1, (--b->attr_len - attr_pos) * sizeof *b->attr_buf); - } - if (++updated_lines > TURBO) window_needs_refresh = true; if (window_needs_refresh) { if (line < first_line) first_line = line; if (line > last_line) last_line = line; + b->attr_len = -1; return; } + if (b->syn) { + assert(b->attr_len >= 0); + assert(b->attr_len > attr_pos); + memmove(b->attr_buf + attr_pos, b->attr_buf + attr_pos + 1, (--b->attr_len - attr_pos) * sizeof *b->attr_buf); + } + if (pos > ld->line_len || (pos == ld->line_len && ((c == '\t' || c == ' ') && !a))) return; move_cursor(line, x); @@ -449,6 +457,15 @@ void update_deleted_char(buffer * const void update_inserted_char(buffer * const b, const int c, line_desc * const ld, const int64_t pos, const int64_t attr_pos, const int line, const int x) { assert(pos < ld->line_len); + if (++updated_lines > TURBO) window_needs_refresh = true; + + if (window_needs_refresh) { + if (line < first_line) first_line = line; + if (line > last_line) last_line = line; + b->attr_len = -1; + return; + } + const uint32_t * const attr = b->syn ? &attr_buf[attr_pos] : NULL; if (b->syn) { @@ -461,14 +478,6 @@ void update_inserted_char(buffer * const b->attr_buf[attr_pos] = *attr; } - if (++updated_lines > TURBO) window_needs_refresh = true; - - if (window_needs_refresh) { - if (line < first_line) first_line = line; - if (line > last_line) last_line = line; - return; - } - move_cursor(line, x); const int c_len = b->encoding == ENC_UTF8 ? utf8seqlen(c) : 1; @@ -521,6 +530,15 @@ void update_overwritten_char(buffer * co assert(ld != NULL); assert(pos < ld->line_len); + if (++updated_lines > TURBO) window_needs_refresh = true; + + if (window_needs_refresh) { + if (line < first_line) first_line = line; + if (line > last_line) last_line = line; + b->attr_len = -1; + return; + } + const uint32_t * const attr = b->syn ? &attr_buf[attr_pos] : NULL; if (b->syn) { @@ -531,14 +549,6 @@ void update_overwritten_char(buffer * co b->attr_buf[attr_pos] = *attr; } - if (++updated_lines > TURBO) window_needs_refresh = true; - - if (window_needs_refresh) { - if (line < first_line) first_line = line; - if (line > last_line) last_line = line; - return; - } - const int old_width = old_char == '\t' ? b->opt.tab_size - x % b->opt.tab_size : output_width(old_char); const int new_width = new_char == '\t' ? b->opt.tab_size - x % b->opt.tab_size : output_width(new_char); @@ -730,8 +740,9 @@ void ensure_attributes(buffer *b) { void store_attributes(buffer *b, line_desc *ld) { b->next_state = parse(b->syn, ld, ld->highlight_state, b->encoding == ENC_UTF8); assert(calc_char_len(ld, ld->line_len, b->encoding) == attr_len); + // This test is necessary to avoid warnings from -fsanitize ensure_attr_buf(b, attr_len); - memcpy(b->attr_buf, attr_buf, (b->attr_len = attr_len) * sizeof *b->attr_buf); + if (b->attr_len = attr_len) memcpy(b->attr_buf, attr_buf, attr_len * sizeof *b->attr_buf); } /* (Un)highlights (depending on the value of show) the bracket matching diff -pruN 3.1.1-1/src/edit.c 3.1.2-1/src/edit.c --- 3.1.1-1/src/edit.c 2017-05-17 15:39:34.000000000 +0000 +++ 3.1.2-1/src/edit.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Various editing functions such as word wrap, to upper, etc. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -137,11 +137,11 @@ int match_bracket(buffer *b) { int find_matching_bracket(buffer *b, const int64_t min_line, int64_t max_line, int64_t *match_line, int64_t *match_pos, int *c, line_desc ** match_ld) { - static unsigned char bracket_table[NUM_BRACKETS][2] = { { '(', ')' }, - { '[', ']' }, - { '{', '}' }, - { '<', '>' }, - { '`', '\'' } }; + static unsigned char bracket_table[NUM_BRACKETS][2] = { { '(', ')' }, + { '[', ']' }, + { '{', '}' }, + { '<', '>' }, + { '`', '\'' } }; line_desc *ld = b->cur_line_desc; @@ -226,7 +226,7 @@ int64_t word_wrap(buffer * const b) { /* Now we know that the line shouldn't be broken before &line[first_pos]. */ - /* Start from the other end now and find a candidate space to break the line on.*/ + /* Search left from the current position to find a candidate space to break the line on.*/ while((pos = prev_pos(line, pos, b->encoding)) && !ne_isspace(get_char(&line[pos], b->encoding), b->encoding)); if (! pos || pos < first_pos) return ERROR; @@ -261,9 +261,9 @@ int word_wrap2(buffer * const b) { int64_t pos, original_line; /* If the char to our left is a space, we need to insert - a non-space to attach our WORDWRAP_BOOKMARK to because - spaces at the split point get removed, which effectively - leaves our bookmark on the current line. */ + a non-space to attach our WORDWRAP_BOOKMARK to because + spaces at the split point get removed, which effectively + leaves our bookmark on the current line. */ delay_update(); pos = prev_pos(line, b->cur_pos, b->encoding); if (pos >= 0 && (non_blank_added = ne_isspace(get_char(&line[pos], b->encoding), b->encoding))) { @@ -272,7 +272,7 @@ int word_wrap2(buffer * const b) { line = b->cur_line_desc->line; goto_pos(b, next_pos(line, b->cur_pos, b->encoding)); } - b->bookmark[WORDWRAP_BOOKMARK].pos = b->cur_pos; + b->bookmark[WORDWRAP_BOOKMARK].pos = b->cur_pos; b->bookmark[WORDWRAP_BOOKMARK].line = original_line = b->cur_line; b->bookmark[WORDWRAP_BOOKMARK].cur_y = b->cur_y; b->bookmark_mask |= (1 << WORDWRAP_BOOKMARK); @@ -294,72 +294,7 @@ int word_wrap2(buffer * const b) { } /* These functions reformat a paragraph while preserving appropriate -leading US-ASCII white space. The strategy is as follows: - - 1. Establish appropriate leading space. This will be taken from the line - following the current line if it is non-blank. Otherwise it will be - taken from the current line. Save a copy of it for later as space[]. - - 1.1 If the leading non-blank (the part after space[]) is not an alphanumeric, - then we take it as a comment initiator and preserve it for later as spots[]. - - 2. Start an undo chain. - - 3. Trim trailing space off the current line. - - 4. while the current line is too long (i.e., needs to be split: - 4.1 Find the split point - 4.2 Remove any space at the split point - 4.3 Split the line at the split point. (We are done with this line) - 4.4 Make the new line the current line - 4.5 Insert the space[] stream we saved in step 1. - 4.5.1 Insert the spots[] stream we saved from step 1.1. - 4.6 Trim trailing space off the end of the line. - - 5. If the _following_ line is part of this paragraph (i.e., its first - non-blank character is in the correct position): - 5.1 Add a space to the end of the current line. - 5.2 Delete this line's leading white space. - 5.3 If the leading non-blank character matches the first character - of spots[], remove it any any subsequent non-alphanumeric. - 5.2 Copy following line's data starting with the first - non-blank to the end of the current line. - 5.3 Remove the following line. - 5.4 Goto step 3. - - 6. end the undo chain. - - 7. Free space[]. - - 8. and refresh the screen - - 9. move to the next non-blank after the current line. (We have to do - this so that commands like "Paragraph 5" will do 5 paragraphs - instead of only three.) - -*/ - -static char *pa_spots = NULL; /* Where we keep leading non-alphanumerics */ -static int pa_spots_pos; /* How long pa_spots is in chars */ - -/* save_spots() is like save_space(), but it preserves the string of non-alphanumerics - immediately follow where save_space() left off. */ - -static int save_spots(line_desc * const ld, const int pos, const encoding_type encoding) { - if (pa_spots) free(pa_spots); - pa_spots = NULL; - pa_spots_pos = 0; - - if (!ld->line || ld->line_len <= pos) return 0; /* No data on this line. */ - - while(pos + pa_spots_pos < ld->line_len && isparaspot(ld->line[pos+pa_spots_pos])) - pa_spots_pos = next_pos(ld->line, pos+pa_spots_pos, encoding) - pos; - if (pa_spots_pos) { - if ((pa_spots = malloc(pa_spots_pos))) memcpy(pa_spots, ld->line+pos, pa_spots_pos); - else pa_spots_pos = 0; - } - return pa_spots_pos > 0; -} + leading US-ASCII white space. */ static char *pa_space; /* Where we keep space for paragraph left offsets */ static int64_t pa_space_len; /* How long pa_space is when tabs are expanded */ @@ -389,14 +324,11 @@ static int save_space(line_desc * const pa_space_len = calc_width(ld, pos, tab_size, encoding); if (pos == 0) { - pa_space = NULL; - save_spots(ld, pos, encoding); return 1; } if ((pa_space = malloc(pos))) { memcpy(pa_space, ld->line, pos); - save_spots(ld, pos, encoding); return 1; } @@ -405,8 +337,7 @@ static int save_space(line_desc * const /* trim_trailing_space() removes spaces from the end of the line referred to by - the line_desc ld. The int line is necessary if you want to be able to undo - later. */ + the line_desc ld. The int line is necessary for undo to work. */ static void trim_trailing_space(buffer * const b, line_desc *ld, const int64_t line, const encoding_type encoding) { if (!ld->line) return; @@ -439,68 +370,69 @@ static int is_part_of_paragraph(const li right_margin (a value of 0 forces the use of the full screen width). On completion the cursor is positioned either: - * on the first non-blank character after the paragraph if there is one, or + * on the first non-blank character after the paragraph if there is one, or - * on a blank line following the paragraph if there is one, or + * on a blank line following the paragraph if there is one, or - * on the last line of the paragraph. + * on the last line of the paragraph. - paragraph() returns OK unless the cursor ends up on the last line of the - file, in which case it returns ERROR. */ + paragraph() returns OK unless the cursor ends up on the last line of the + file, in which case it returns ERROR. */ int paragraph(buffer * const b) { line_desc *ld = b->cur_line_desc, *start_line_desc = ld; if (!ld->line) return line_down(b); - /** Step 1 **/ - if (!( - (ld->ld_node.next->next && - save_space((line_desc *)ld->ld_node.next, b->opt.tab_size, b->encoding) - ) - || save_space(ld, b->opt.tab_size, b->encoding) - ) - ) return line_down(b); + /* Establish appropriate leading space. This will be taken from the line + following the current line if it is non-blank. Otherwise it will be + taken from the current line. Save a copy of it for later as space[]. **/ + + if ( !( (ld->ld_node.next->next && save_space((line_desc *)ld->ld_node.next, b->opt.tab_size, b->encoding)) + || save_space(ld, b->opt.tab_size, b->encoding) ) + ) return line_down(b); + int64_t pos = b->cur_pos; b->cur_pos = -1; - /** Step 2 **/ start_undo_chain(b); - /* This useless insertion and deletion of a single character ensures - that the text isn't shifted way over to the left after an undo. */ + /* This insertion and deletion of a single character ensures + that the cursor ends up here after an undo. */ int64_t line = b->cur_line; insert_one_char(b, ld, line, 0, ' '); delete_stream(b, ld, line, 0, 1); const int right_margin = b->opt.right_margin ? b->opt.right_margin : ne_columns; - bool done = false, skip; - int64_t pos; + bool done; + do { - /** Step 3 **/ + done = true; /* set this to false if we do any work in the loop. */ + trim_trailing_space(b, ld, line, b->encoding); - /** Step 4 **/ - while (!stop && !done && calc_width(ld, ld->line_len, b->opt.tab_size, b->encoding) > right_margin) { + /* Suck up subsequent lines until this one is long enough to need splitting */ + while ((calc_width(ld, ld->line_len, b->opt.tab_size, b->encoding) <= right_margin) && + ld->ld_node.next->next && is_part_of_paragraph((line_desc *)ld->ld_node.next, b->opt.tab_size, &pos, b->encoding)) { + line_desc *ld_next = (line_desc *)ld->ld_node.next; + insert_one_char(b, ld, line, ld->line_len, ' '); + if (pos) delete_stream(b, ld_next, line + 1, 0, pos); /* pos was set by is_part_of_paragraph() above. */ + delete_stream(b, ld, line, ld->line_len, 1); /* joins next line to this one */ + trim_trailing_space(b, ld, line, b->encoding); + done = false; + } + + if (calc_width(ld, ld->line_len, b->opt.tab_size, b->encoding) > right_margin) { int64_t spaces; int64_t split_pos; - bool did_split; - - /** 4.1 Find the split point **/ - - pos = 0; /* Skip past leading spaces... */ + /* Skip past leading spaces... */ + pos = 0; while(pos < ld->line_len && isasciispace(ld->line[pos])) - pos = next_pos(ld->line, pos, b->encoding); - /* ...and the invariants if any. */ - while(pos < ld->line_len && isparaspot(ld->line[pos])) - pos = next_pos(ld->line, pos, b->encoding); + pos = next_pos(ld->line, pos, b->encoding); - did_split = false; + /* Find the split point */ split_pos = spaces = 0; - - while (pos < ld->line_len && - (calc_width(ld, pos, b->opt.tab_size, b->encoding) < right_margin || - ! split_pos)) { + while (pos < ld->line_len && (calc_width(ld, pos, b->opt.tab_size, b->encoding) < right_margin || ! split_pos)) { if (isasciispace(ld->line[pos])) { split_pos = pos; spaces = 0; @@ -511,88 +443,39 @@ int paragraph(buffer * const b) { } else pos = next_pos(ld->line, pos, b->encoding); } - if (split_pos) { - /** 4.2 Remove any space at the split point. **/ + done = false; + /* Remove any space at the split point. */ if (spaces) delete_stream(b, ld, line, split_pos, spaces); - /** 4.3 Split the line at the split point. (We are done with this line) **/ - insert_one_line(b, ld, line, split_pos); - did_split = true; - } - /** 4.4 Make the (new?) next line the current line **/ - if (ld->ld_node.next->next) { - ld = (line_desc *)ld->ld_node.next; - line++; - - /** 4.5 Insert the pa_space[] stream we saved in step 1. Note that **/ - /** we only want to do this if this line is the result of a split, **/ - /** which is true if did_split is true. **/ + /* Split the line at the split point. (We are done with this line) */ + insert_one_line(b, ld, line, split_pos); - if (did_split) { + /* Make the new next line the current line **/ + if (ld->ld_node.next->next) { + ld = (line_desc *)ld->ld_node.next; + line++; if (pa_space && pa_space_len && pa_space_pos) insert_stream(b, ld, line, 0, pa_space, pa_space_pos); - /** 4.5.1 Insert the pa_spots[] stream if there is one. **/ - if (pa_spots && pa_spots_pos) - insert_stream(b, ld, line, pa_space_pos, pa_spots, pa_spots_pos); + trim_trailing_space(b, ld, line, b->encoding); + } + } else { /* Line not split; is there a next one in the paragraph? */ + if ( ld->ld_node.next->next && is_part_of_paragraph((line_desc *)ld->ld_node.next, b->opt.tab_size, &pos, b->encoding) ) { + ld = (line_desc *)ld->ld_node.next; + line++; + done = false; } - - /** 4.6 Trim trailing space off the end of the line. **/ - trim_trailing_space(b, ld, line, b->encoding); - } - else done = true; - } - - /** If the current line is just a spot (no text), we skip over it. **/ - pos = 0; /* Skip past leading spaces... */ - skip = false; - while(pos < ld->line_len && isasciispace(ld->line[pos])) - pos = next_pos(ld->line, pos, b->encoding); - /* ...and the invariants if any. */ - while(pos < ld->line_len && isparaspot(ld->line[pos])) - pos = next_pos(ld->line, pos, b->encoding); - if (pos == ld->line_len) skip = true; - - /** 5. If the _following_ line is part of this paragraph (i.e., its first **/ - /** non-blank character is in the correct position): **/ - - if (ld->ld_node.next->next && is_part_of_paragraph((line_desc *)ld->ld_node.next, b->opt.tab_size, &pos, b->encoding)) { - /** If the next line is just a spot (no text), we want to skip over it **/ - /** rather than splicing it to the current line. **/ - if (skip || save_spots((line_desc *)ld->ld_node.next, pos, b->encoding) && ((line_desc *)ld->ld_node.next)->line_len <= pos+pa_spots_pos) { - /* skip to next line */ - ld = (line_desc *)ld->ld_node.next; - line++; - } - else { - /** 5.1 Add a space to the end of the current line. **/ - insert_one_char(b, ld, line, ld->line_len, ' '); - - /** 5.4 Move following line's data starting with the first **/ - /** non-blank to the end of the current line. **/ - - /** We do this by first deleting the leading spaces **/ - if (pos > 0) delete_stream(b, (line_desc *)ld->ld_node.next, line + 1, 0, pos); - /** 5.2 Cache the leading non-alphanumeric in pa_spots, then delete it, **/ - if (save_spots((line_desc *)ld->ld_node.next, 0, b->encoding)) - delete_stream(b, (line_desc *)ld->ld_node.next, line + 1, 0, pa_spots_pos); - /** Finally splice the lines by deleting the newline at the end of the current line. **/ - delete_stream(b, ld, line, ld->line_len, 1); } } - else done = true; - } while (!done && !stop); + } while (!stop && !done); - /** Step 6 **/ end_undo_chain(b); - /** Step 7 **/ if (pa_space) { free(pa_space); pa_space = NULL; } - /** Step 8 **/ if (b->syn) { b->attr_len = -1; need_attr_update = true; @@ -600,7 +483,6 @@ int paragraph(buffer * const b) { } update_window_lines(b, b->cur_line_desc, b->cur_y, ne_lines - 2, false); - /** Step 9 **/ goto_line_pos(b, line, pos); if (stop || line_down(b) == ERROR) return stop ? STOPPED : ERROR; @@ -671,7 +553,7 @@ int auto_indent_line(buffer * const b, c assert_line_desc(prev_ld, b->encoding); int c; - int64_t pos = 0; + int64_t pos = 0; for(int64_t col = 0; pos < prev_ld->line_len && ne_isspace(c = get_char(&prev_ld->line[pos], b->encoding), b->encoding); ) { col += (c == '\t' ? b->opt.tab_size - col % b->opt.tab_size : 1); if (col > up_to_col) break; @@ -774,7 +656,7 @@ int shift(buffer * const b, char *p, cha while (pos < ld->line_len && isasciispace(ld->line[pos])) pos = next_pos(ld->line, pos, b->encoding); if (pos >= ld->line_len) continue; /* We ran off the end of the line. */ - /* line[pos] should be the first non-blank character. */ + /* line[pos] should be the first non-blank character. */ /* 2. */ c_pos = pos; c_col_orig = calc_width(ld, c_pos, b->opt.tab_size, b->encoding); diff -pruN 3.1.1-1/src/errors.c 3.1.2-1/src/errors.c --- 3.1.1-1/src/errors.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/errors.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Error message vector. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/errors.h 3.1.2-1/src/errors.h --- 3.1.1-1/src/errors.h 2017-04-27 20:46:58.000000000 +0000 +++ 3.1.2-1/src/errors.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Error index enum, and extern declaration of the error vector. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/exec.c 3.1.2-1/src/exec.c --- 3.1.1-1/src/exec.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/exec.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* List handling functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/help.c 3.1.2-1/src/help.c --- 3.1.1-1/src/help.c 2017-06-04 20:43:44.000000000 +0000 +++ 3.1.2-1/src/help.c 2018-10-06 09:56:06.000000000 +0000 @@ -338,22 +338,25 @@ const char * const DELETELINE_HELP[9] = "respect to 'InsertLine'.", }; -const char * const DELETENEXTWORD_HELP[6] = { +const char * const DELETENEXTWORD_HELP[8] = { "Syntax: DeleteNextWord [N]", "Abbreviation: DNW", "", - "deletes text from the current position to the next word N times. If the", - "optional N argument is not specified, it is assumed to be one.", + "deletes text from the current position to the N'th next end-of-word If", + "the optional N argument is not specified, it is assumed to be one (in", + "which case, if the cursor is in the middle of a word the effect is just", + "to delete to the end of that word).", }; -const char * const DELETEPREVWORD_HELP[8] = { +const char * const DELETEPREVWORD_HELP[9] = { "Syntax: DeletePrevWord [N]", "Abbreviation: DPW", "", - "deletes text from the current position to the first character of the", - "previous word N times. If the optional N argument is not specified, it", - "is assumed to be one (in which case, if the cursor is in the middle of a", - "word the effect is just to delete to the start of that word).", + "deletes text from the current position through the first character of", + "the N'th previous start-of-word. If the optional N argument is not", + "specified, it is assumed to be one (in which case, if the cursor is in", + "the middle of a word the effect is just to delete to the start of that", + "word).", }; const char * const DELTABS_HELP[9] = { @@ -1338,13 +1341,14 @@ const char * const REFRESH_HELP[11] = { "has changed, and will modify the display to take that into account.", }; -const char * const REPEATLAST_HELP[30] = { - "Syntax: RepeatLast [TIMES]", +const char * const REPEATLAST_HELP[31] = { + "Syntax: RepeatLast [TIMES] [F|Find|R|Replace]", "Abbreviation: RL", "", "repeats for the given number of times the last find or replace operation", "(with replace we mean here a single replace, even if the last 'Replace'", - "operation ended with a global substitution).", + "operation ended with a global substitution). If you don't specify", + "either FIND or REPLACE, it will repeat whichever one was last performed.", "", " If any find or replace operation runs into the end of the document", "(in the direction indicated by the 'SearchBack' flag) and stops, then", diff -pruN 3.1.1-1/src/help.h 3.1.2-1/src/help.h --- 3.1.1-1/src/help.h 2017-06-04 20:43:44.000000000 +0000 +++ 3.1.2-1/src/help.h 2018-10-06 09:56:06.000000000 +0000 @@ -42,8 +42,8 @@ extern const char * const CUT_HELP[ 5 ]; extern const char * const DELETECHAR_HELP[ 10 ]; extern const char * const DELETEEOL_HELP[ 10 ]; extern const char * const DELETELINE_HELP[ 9 ]; -extern const char * const DELETENEXTWORD_HELP[ 6 ]; -extern const char * const DELETEPREVWORD_HELP[ 8 ]; +extern const char * const DELETENEXTWORD_HELP[ 8 ]; +extern const char * const DELETEPREVWORD_HELP[ 9 ]; extern const char * const DELTABS_HELP[ 9 ]; extern const char * const DOUNDO_HELP[ 21 ]; extern const char * const ERASE_HELP[ 6 ]; @@ -117,7 +117,7 @@ extern const char * const READONLY_HELP[ extern const char * const RECORD_HELP[ 21 ]; extern const char * const REDO_HELP[ 8 ]; extern const char * const REFRESH_HELP[ 11 ]; -extern const char * const REPEATLAST_HELP[ 30 ]; +extern const char * const REPEATLAST_HELP[ 31 ]; extern const char * const REPLACE_HELP[ 45 ]; extern const char * const REPLACEALL_HELP[ 14 ]; extern const char * const REPLACEONCE_HELP[ 10 ]; diff -pruN 3.1.1-1/src/info2cap.c 3.1.2-1/src/info2cap.c --- 3.1.1-1/src/info2cap.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/info2cap.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* terminfo emulation through GNU termcap code. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/info2cap.h 3.1.2-1/src/info2cap.h --- 3.1.1-1/src/info2cap.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/info2cap.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* terminfo emulation through GNU termcap definitions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/input.c 3.1.2-1/src/input.c --- 3.1.1-1/src/input.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/input.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Input line handling. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/inputclass.c 3.1.2-1/src/inputclass.c --- 3.1.1-1/src/inputclass.c 2017-05-16 12:32:38.000000000 +0000 +++ 3.1.2-1/src/inputclass.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Input class, key bindings and upper casing vector definitions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/keycodes.h 3.1.2-1/src/keycodes.h --- 3.1.1-1/src/keycodes.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/keycodes.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Extended codes for special keys. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/keys.c 3.1.2-1/src/keys.c --- 3.1.1-1/src/keys.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/keys.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Terminfo database scanning and keyboard escape sequence matching functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/makefile 3.1.2-1/src/makefile --- 3.1.1-1/src/makefile 2017-04-04 10:35:59.000000000 +0000 +++ 3.1.2-1/src/makefile 2018-10-04 15:00:02.000000000 +0000 @@ -1,34 +1,37 @@ # -# This is the makefile for ne. -# +# This is the makefile for ne. +# # The default build relies on terminfo, but you can specify NE_TERMCAP=1 to # rely on termcap, or even NE_ANSI=1 to rely on termcap and to use by default # the built-in ANSI terminal description. For example: -# +# # make # make NE_ANSI=1 # make NE_TERMCAP=1 -# +# # If you use NE_ANSI=1 or NE_TERMCAP=1, no external library is needed. # # Specifying NE_DEBUG=1 will enable debugging info and will compile in a # number of assertions. Moreover, specifying NE_NOWCHAR=1 will remove the # calls to wide character versions of toupper(), tolower(), isspace(), etc., # and also calls to wcwidth(). -# -# Defining ALTPAGING will create an ne which by default will bind the PageUp -# and PageDown commands to the ^p and ^n keys as well as the PgUp and PgDn -# keys. Some users may prefer this to the PrevPage and NextPage command -# behavior. N.B.: This will cause ne's operation to differ slightly from the -# documentation. -# +# +# Defining ALTPAGING will create an ne with slightly different configuration: +# - PageUp and ^p map to PageUp (rather than PrevPage) +# - PageDown and ^n map to PageDown (rather than NextPage) +# - Home and End map to MoveSOL and MoveEOL (rather than MoveIncUp and MoveIncDown) +# - (Shift-,Ctrl-)(F5,F6) shift left and right by (tabs,spaces) +# - RequestOrder is set, so requesters display in column major order. +# Some users may prefer this to the historical settings. +# N.B.: This will cause ne's operation to differ slightly from the documentation. +# # make OPTS=-DALTPAGING -# +# # By changing the value of NE_GLOBAL_DIR, you can change the directory # where ne tries to read system-wide information (configuration # files, etc.). -NE_GLOBAL_DIR = /usr/local/share/ne +NE_GLOBAL_DIR ?= /usr/local/share/ne PROGRAM = ne @@ -81,7 +84,7 @@ NE_NOWCHAR= NE_DEBUG= NE_TEST= -CC=c99 +CC?=c99 ifeq ($(CC),gcc) GCCFLAGS=-std=c99 -Wall -Wno-parentheses @@ -91,7 +94,7 @@ CFLAGS=$(OPTS) $(GCCFLAGS) \ -D_REGEX_LARGE_OFFSETS -D_GNU_SOURCE -DSTDC_HEADERS -Dinline=__inline__ \ $(if $(NE_NOWCHAR), -DNOWCHAR,) \ $(if $(NE_TEST), -DNE_TEST -coverage,) \ - $(if $(NE_DEBUG), -g,-O3 -DNDEBUG) \ + $(if $(NE_DEBUG), -g -fsanitize=address -fsanitize=undefined,-O3 -DNDEBUG) \ $(if $(NE_TERMCAP), -DTERMCAP,) \ $(if $(NE_ANSI), -DTERMCAP -DANSI,) @@ -99,7 +102,7 @@ CFLAGS=$(OPTS) $(GCCFLAGS) \ LIBS=$(if $(NE_TERMCAP)$(NE_ANSI),,-lcurses) ne: $(OBJS) $(if $(NE_TERMCAP)$(NE_ANSI),$(TERMCAPOBJS),) - $(CC) $(OPTS) $(LDFLAGS) $(if $(NE_TEST), -coverage -lefence,) $^ -lm $(LIBS) -o $(PROGRAM) + $(CC) $(OPTS) $(LDFLAGS) $(if $(NE_TEST), -coverage,) $(if $(NE_DEBUG), -fsanitize=address -fsanitize=undefined,) $^ -lm $(LIBS) -o $(PROGRAM) clean: rm -f ne *.o *.gcda *.gcda.info *.gcno core @@ -112,6 +115,7 @@ really-clean: clean coverage: geninfo . -rm -fr coverage + -rm -f hash.gcda.info help.gcda.info inputclass.gcda.info names.gcda.info errors.gcda.info genhtml -o coverage *.info ### @@ -135,7 +139,7 @@ enums.h names.c names.h hash.c hash.h he perl info2src.pl rm -f ne.info* -actions.o: $(MAINH) support.h keycodes.h names.h names.c errors.h errors.c protos.h version.h +actions.o: $(MAINH) support.h keycodes.h names.h names.c errors.h errors.c protos.h version.h autocomp.o: $(MAINH) support.h protos.h diff -pruN 3.1.1-1/src/menu.c 3.1.2-1/src/menu.c --- 3.1.1-1/src/menu.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/menu.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Menu handling function. Includes also key and menu configuration parsing. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/navigation.c 3.1.2-1/src/navigation.c --- 3.1.1-1/src/navigation.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/navigation.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Navigation functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -684,7 +684,11 @@ parameter -1. */ void goto_line_pos(buffer * const b, const int64_t n, const int64_t pos) { b->y_wanted = 0; - if (n >= b->num_lines || n == b->cur_line && (pos == -1 || pos == b->cur_pos)) return; + if (n >= b->num_lines || n == b->cur_line && pos == b->cur_pos) return; + if (n == b->cur_line && pos == -1) { + resync_pos(b); + return; + } line_desc *ld; diff -pruN 3.1.1-1/src/ne.c 3.1.2-1/src/ne.c --- 3.1.1-1/src/ne.c 2017-05-17 20:57:21.000000000 +0000 +++ 3.1.2-1/src/ne.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* main(), global initialization and global buffer functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -36,7 +36,7 @@ char *NO_WARRANTY_msg[] = { PROGRAM_NAME " " VERSION ".", "Copyright (C) 1993-1998 Sebastiano Vigna", - "Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna", + "Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna", "", "This program is free software; you can redistribute it and/or modify it under", "the terms of the GNU General Public License as published by the Free Software", diff -pruN 3.1.1-1/src/ne.h 3.1.2-1/src/ne.h --- 3.1.1-1/src/ne.h 2017-04-11 17:03:19.000000000 +0000 +++ 3.1.2-1/src/ne.h 2018-10-02 14:33:48.000000000 +0000 @@ -1,7 +1,7 @@ /* Main typedefs and defines. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -543,7 +543,7 @@ typedef struct { assert((b)->cur_pos == -1 || calc_width((b)->cur_line_desc, (b)->cur_pos, (b)->opt.tab_size, (b)->encoding) == (b)->win_x + (b)->cur_x);\ assert((b)->cur_pos == -1 || calc_virt_pos((b)->cur_line_desc, (b)->win_x + (b)->cur_x, (b)->opt.tab_size, (b)->encoding) == (b)->cur_pos);\ assert((b)->cur_pos == -1 || (b)->cur_pos > (b)->cur_line_desc->line_len || calc_char_len((b)->cur_line_desc, (b)->cur_pos, (b)->encoding) == (b)->cur_char);\ - assert((b)->cur_pos >= (b)->cur_line_desc->line_len || (b)->encoding != ENC_UTF8 || utf8len((b)->cur_line_desc->line[(b)->cur_pos] > 0));\ + assert((b)->cur_pos < 0 || (b)->cur_pos >= (b)->cur_line_desc->line_len || (b)->encoding != ENC_UTF8 || utf8len((b)->cur_line_desc->line[(b)->cur_pos] > 0));\ assert_undo_buffer(&(b)->undo);\ }} diff -pruN 3.1.1-1/src/ne.texinfo 3.1.2-1/src/ne.texinfo --- 3.1.1-1/src/ne.texinfo 2017-06-01 06:03:44.000000000 +0000 +++ 3.1.2-1/src/ne.texinfo 2018-10-04 15:00:02.000000000 +0000 @@ -3067,12 +3067,13 @@ pattern replaced by @code{ReplaceAll}. S @subsection RepeatLast @cmindex RepeatLast -@noindent Syntax: @code{RepeatLast [@var{times}]}@* +@noindent Syntax: @code{RepeatLast [@var{times}] [F|Find|R|Replace]}@* @noindent Abbreviation: @code{RL} @noindent repeats for the given number of times the last find or replace operation (with replace we mean here a single replace, even if the last @code{Replace} -operation ended with a global substitution). +operation ended with a global substitution). If you don't specify either +@var{Find} or @var{Replace}, it will repeat whichever one was last performed. If any find or replace operation runs into the end of the document (in the direction indicated by the @code{SearchBack} flag) and stops, then and only then will a @@ -5088,8 +5089,8 @@ no action will be performed. @noindent Syntax: @code{DeletePrevWord [@var{n}]}@* @noindent Abbreviation: @code{DPW} -@noindent deletes text from the current position to the first character of the -previous word @var{n} times. If the optional @var{n} argument is not specified, +@noindent deletes text from the current position through the first character of the +@var{n}'th previous start-of-word. If the optional @var{n} argument is not specified, it is assumed to be one (in which case, if the cursor is in the middle of a word the effect is just to delete to the start of that word). @@ -5103,9 +5104,10 @@ word the effect is just to delete to the @noindent Syntax: @code{DeleteNextWord [@var{n}]}@* @noindent Abbreviation: @code{DNW} -@noindent deletes text from the current position to the next word @var{n} -times. If the optional @var{n} argument is not specified, it is assumed to be -one. +@noindent deletes text from the current position to the @var{n}'th next end-of-word +If the optional @var{n} argument is not specified, it is assumed to be +one (in which case, if the cursor is in the middle of a word the effect is +just to delete to the end of that word). diff -pruN 3.1.1-1/src/prefs.c 3.1.2-1/src/prefs.c --- 3.1.1-1/src/prefs.c 2017-05-17 17:03:21.000000000 +0000 +++ 3.1.2-1/src/prefs.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Preferences functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/protos.h 3.1.2-1/src/protos.h --- 3.1.1-1/src/protos.h 2017-06-01 06:03:44.000000000 +0000 +++ 3.1.2-1/src/protos.h 2018-10-04 15:00:02.000000000 +0000 @@ -1,7 +1,7 @@ /* Function prototypes Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -72,10 +72,10 @@ void free_clip_desc(clip_desc *cd); int is_encoding_neutral(clip_desc *cd); clip_desc *get_nth_clip(int n); int copy_to_clip(buffer *b, int n, bool cut); -int erase_block(buffer *b); +int erase_block(buffer *b, const bool update); int paste_to_buffer(buffer *b, int n); int copy_vert_to_clip(buffer *b, int n, bool cut); -int erase_vert_block(buffer *b); +int erase_vert_block(buffer *b, const bool update); int paste_vert_to_buffer(buffer *b, int n); int load_clip(int n, const char *name, bool preserve_cr, bool binary); int save_clip(int n, const char *name, bool CRLF, bool binary); @@ -104,7 +104,7 @@ void delay_update(); void output_line_desc(int row, int col, const line_desc *ld, int64_t start, int64_t len, int tab_size, bool cleared_at_end, bool utf8, const uint32_t * const attr, const uint32_t * const diff, const int64_t diff_size); void update_line(buffer *b, line_desc *ld, int n, int64_t start_x, bool cleared_at_end); void update_window_lines(buffer *b, line_desc *ld, int start_line, int end_line, bool doit); -void update_syntax_and_lines(buffer *b, line_desc *start_ld, line_desc *end_ld); +void update_syntax_states_delay(buffer *b, line_desc *start_ld, line_desc *end_ld); void update_window(buffer *b); void update_deleted_char(buffer *b, int c, int a, line_desc *ld, int64_t pos, int64_t attr_pos, int line, int x); void update_inserted_char(buffer *b, int c, line_desc *ld, int64_t pos, int64_t attr_pos, int line, int x); diff -pruN 3.1.1-1/src/regcomp.c 3.1.2-1/src/regcomp.c --- 3.1.1-1/src/regcomp.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/regcomp.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff -pruN 3.1.1-1/src/regex.c 3.1.2-1/src/regex.c --- 3.1.1-1/src/regex.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/regex.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff -pruN 3.1.1-1/src/regexec.c 3.1.2-1/src/regexec.c --- 3.1.1-1/src/regexec.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/regexec.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff -pruN 3.1.1-1/src/regex_internal.c 3.1.2-1/src/regex_internal.c --- 3.1.1-1/src/regex_internal.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/regex_internal.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff -pruN 3.1.1-1/src/regex_internal.h 3.1.2-1/src/regex_internal.h --- 3.1.1-1/src/regex_internal.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/regex_internal.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2017 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . diff -pruN 3.1.1-1/src/request.c 3.1.2-1/src/request.c --- 3.1.1-1/src/request.c 2017-06-01 06:03:44.000000000 +0000 +++ 3.1.2-1/src/request.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Requester handling. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -332,7 +332,6 @@ static int count_fuzz_matches(const int /* Shift fuzz_len by +1 or -1 until the matching count changes or we run out of string. */ static void shift_fuzz(const int d) { - int c0 = count_fuzz_matches(fuzz_len); const char * const p0 = rl.entries[PXY2N(page, x, y)]; assert(d==1||d==-1); if (d==-1) { diff -pruN 3.1.1-1/src/search.c 3.1.2-1/src/search.c --- 3.1.1-1/src/search.c 2017-04-29 10:22:41.000000000 +0000 +++ 3.1.2-1/src/search.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Search/replace functions (with and without regular expressions). Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -503,7 +503,7 @@ int find_regexp(buffer * const b, const i0 should be <= number of paren groups in original regex. */ char *nth_regex_substring(const line_desc *ld, int i0) { char *str; - int j, i; + int i; if ((i = use_map_group ? map_group[i0] : i0) >= RE_NREGS) return NULL; diff -pruN 3.1.1-1/src/signals.c 3.1.2-1/src/signals.c --- 3.1.1-1/src/signals.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/signals.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Signal handling setup and code. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/streams.c 3.1.2-1/src/streams.c --- 3.1.1-1/src/streams.c 2017-04-04 10:35:59.000000000 +0000 +++ 3.1.2-1/src/streams.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Stream handling functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/support.c 3.1.2-1/src/support.c --- 3.1.1-1/src/support.c 2017-04-29 10:17:31.000000000 +0000 +++ 3.1.2-1/src/support.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Miscellaneous support functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/support.h 3.1.2-1/src/support.h --- 3.1.1-1/src/support.h 2017-04-04 10:35:59.000000000 +0000 +++ 3.1.2-1/src/support.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Miscellaneous inline support functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -135,18 +135,6 @@ static int64_t inline calc_virt_pos(cons return pos; } -/* Returns true if the specified character is invariant on the left edge of re-wrapped paragraphs */ -/* This will require a re-think for leading non-space invariants. For now, always assume false. */ -static bool inline isparaspot(const int c) { - /* - char *spots = "%*#/>\t "; - char *p = spots; - while (*p) { - if (*p++ == c) return true; - } */ - return false; -} - /* Returns true if the specified character is an US-ASCII whitespace character. */ static bool inline isasciispace(const int c) { diff -pruN 3.1.1-1/src/syn_hash.c 3.1.2-1/src/syn_hash.c --- 3.1.1-1/src/syn_hash.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_hash.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Simple hash tables. Copyright (C) 1992 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_hash.h 3.1.2-1/src/syn_hash.h --- 3.1.1-1/src/syn_hash.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_hash.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Simple hash tables. Copyright (C) 1992 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_regex.c 3.1.2-1/src/syn_regex.c --- 3.1.1-1/src/syn_regex.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_regex.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Regular expression subroutines. Copyright (C) 1992 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_regex.h 3.1.2-1/src/syn_regex.h --- 3.1.1-1/src/syn_regex.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_regex.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Regular expression subroutines. Copyright (C) 1992 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syntax.c 3.1.2-1/src/syntax.c --- 3.1.1-1/src/syntax.c 2017-04-04 10:35:59.000000000 +0000 +++ 3.1.2-1/src/syntax.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Syntax highlighting DFA interpreter. Copyright (C) 2004 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syntax.h 3.1.2-1/src/syntax.h --- 3.1.1-1/src/syntax.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syntax.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Syntax highlighting DFA interpreter. Copyright (C) 2004 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_types.h 3.1.2-1/src/syn_types.h --- 3.1.1-1/src/syn_types.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_types.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: Types Copyright (C) 2004 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_utf8.c 3.1.2-1/src/syn_utf8.c --- 3.1.1-1/src/syn_utf8.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_utf8.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: UTF-8 utilities. Copyright (C) 2004 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_utf8.h 3.1.2-1/src/syn_utf8.h --- 3.1.1-1/src/syn_utf8.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_utf8.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Syntax highlighting from Joe's Own Editor: UTF-8 utilities. Copyright (C) 2004 Joseph H. Allen - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_utils.c 3.1.2-1/src/syn_utils.c --- 3.1.1-1/src/syn_utils.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_utils.c 2018-10-02 14:18:17.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1992 Joseph H. Allen Copyright (C) 2001 Marek 'Marx' Grac - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/syn_utils.h 3.1.2-1/src/syn_utils.h --- 3.1.1-1/src/syn_utils.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/syn_utils.h 2018-10-02 14:18:17.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (C) 1992 Joseph H. Allen Copyright (C) 2001 Marek 'Marx' Grac - Copyright (C) 2009-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 2009-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/term.c 3.1.2-1/src/term.c --- 3.1.1-1/src/term.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/term.c 2018-10-02 14:18:17.000000000 +0000 @@ -3,7 +3,7 @@ Copyright (C) 1985, 1986, 1987 Free Software Foundation, Inc. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -675,7 +675,7 @@ void output_chars(const char *string, co len. Moreover, we don't dare write in last column of bottom line, if AutoWrap, since that would scroll the whole screen on some terminals. */ - cmplus(string_output_width(string, &len, ne_columns - curX - (AutoWrap && curY == ne_lines - 1), utf8)); + cmplus(string_output_width(string, &len, ne_columns - curX - (AutoWrap && !MagicWrap && curY == ne_lines - 1), utf8)); if (string == NULL) { for(int i = 0; i < len; i++) { @@ -787,7 +787,7 @@ void insert_chars(const char * start, co bottom line, if AutoWrap, since that would scroll the whole screen on some terminals. */ - cmplus(string_output_width(start, &len, ne_columns - curX - (AutoWrap && curY == ne_lines - 1), utf8)); + cmplus(string_output_width(start, &len, ne_columns - curX - (AutoWrap && !MagicWrap && curY == ne_lines - 1), utf8)); if (!ne_transparent_underline && !ne_tilde_glitch && start && ne_insert_padding == NULL && ne_insert_character == NULL) { diff -pruN 3.1.1-1/src/termchar.h 3.1.2-1/src/termchar.h --- 3.1.1-1/src/termchar.h 2017-04-04 10:35:59.000000000 +0000 +++ 3.1.2-1/src/termchar.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* extern's of flags describing terminal's characteristics. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/term.h 3.1.2-1/src/term.h --- 3.1.1-1/src/term.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/term.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* Function prototypes for term.c Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. diff -pruN 3.1.1-1/src/undo.c 3.1.2-1/src/undo.c --- 3.1.1-1/src/undo.c 2017-04-04 10:35:59.000000000 +0000 +++ 3.1.2-1/src/undo.c 2018-10-02 14:34:12.000000000 +0000 @@ -1,7 +1,7 @@ /* Undo/redo system management functions. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -201,12 +201,12 @@ int undo(buffer * const b) { if (b->undo.steps[b->undo.cur_step].len < 0) { delete_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, -b->undo.steps[b->undo.cur_step].len); - update_syntax_and_lines(b, b->cur_line_desc, NULL); + update_syntax_states_delay(b, b->cur_line_desc, NULL); } else { line_desc *end_ld = (line_desc *)b->cur_line_desc->ld_node.next; insert_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, b->undo.streams + (b->undo.cur_stream -= b->undo.steps[b->undo.cur_step].len), b->undo.steps[b->undo.cur_step].len); - update_syntax_and_lines(b, b->cur_line_desc, end_ld); + update_syntax_states_delay(b, b->cur_line_desc, end_ld); } } @@ -249,12 +249,12 @@ int redo(buffer * const b) { if (b->undo.steps[b->undo.cur_step].len < 0) { line_desc *end_ld = (line_desc *)b->cur_line_desc->ld_node.next; insert_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, b->undo.redo.stream + (b->undo.redo.len += b->undo.steps[b->undo.cur_step].len), -b->undo.steps[b->undo.cur_step].len); - update_syntax_and_lines(b, b->cur_line_desc, end_ld); + update_syntax_states_delay(b, b->cur_line_desc, end_ld); } else { delete_stream(b, b->cur_line_desc, b->cur_line, b->cur_pos, b->undo.steps[b->undo.cur_step].len); b->undo.cur_stream += b->undo.steps[b->undo.cur_step].len; - update_syntax_and_lines(b, b->cur_line_desc, NULL); + update_syntax_states_delay(b, b->cur_line_desc, NULL); } } diff -pruN 3.1.1-1/src/utf8.c 3.1.2-1/src/utf8.c --- 3.1.1-1/src/utf8.c 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/utf8.c 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* UTF-8 support. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -40,6 +40,7 @@ int64_t utf8strlen(const char * const s, /* Returns the length of a bytes sequence encoding the given character. */ int utf8seqlen(const int c) { + assert(c >= 0); if (c < 0x80) return 1; if (c < 0x800) return 2; if (c < 0x10000) return 3; @@ -65,6 +66,7 @@ int utf8char(const char * const ss) { given string. Returns the length of the string written. */ int utf8str(const int c, char * const ss) { + assert(c >= 0); unsigned char * const s = (unsigned char *)ss; if (c < 0x80) { @@ -116,6 +118,7 @@ int utf8str(const int c, char * const ss has the same prototype as toupper(). */ int utf8toupper(const int c) { + assert(c >= 0); #ifdef NOWCHAR return c < 0x80 ? toupper(c) : c; #else @@ -127,6 +130,7 @@ int utf8toupper(const int c) { has the same prototype as tolower(). */ int utf8tolower(const int c) { + assert(c >= 0); #ifdef NOWCHAR return c < 0x80 ? tolower(c) : c; #else diff -pruN 3.1.1-1/src/utf8.h 3.1.2-1/src/utf8.h --- 3.1.1-1/src/utf8.h 2017-02-03 16:07:44.000000000 +0000 +++ 3.1.2-1/src/utf8.h 2018-10-02 14:18:17.000000000 +0000 @@ -1,7 +1,7 @@ /* UTF-8 support prototypes. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -44,3 +44,5 @@ int utf8toupper(int c); #include #include #endif + +#define MAX_UTF_8 (0x7FFFFFFF) diff -pruN 3.1.1-1/src/version.h 3.1.2-1/src/version.h --- 3.1.1-1/src/version.h 2017-06-04 20:43:38.000000000 +0000 +++ 3.1.2-1/src/version.h 2018-10-06 09:55:59.000000000 +0000 @@ -3,7 +3,7 @@ /* String definitions for version and 'About...' messages. Copyright (C) 1993-1998 Sebastiano Vigna - Copyright (C) 1999-2017 Todd M. Lewis and Sebastiano Vigna + Copyright (C) 1999-2018 Todd M. Lewis and Sebastiano Vigna This file is part of ne, the nice editor. @@ -21,8 +21,8 @@ along with this program; if not, see . */ -#define DATE "(2017-06-04)" -#define VERSION "3.1.1" +#define DATE "(2018-10-06)" +#define VERSION "3.1.2" #define PROGRAM_NAME "ne, the nice editor" #define ABOUT_MSG PROGRAM_NAME " " VERSION " " DATE "." diff -pruN 3.1.1-1/syntax/json.jsf 3.1.2-1/syntax/json.jsf --- 3.1.1-1/syntax/json.jsf 2017-03-31 10:54:54.000000000 +0000 +++ 3.1.2-1/syntax/json.jsf 2017-11-04 18:24:50.000000000 +0000 @@ -215,7 +215,7 @@ done :integer Number * end noeat "0-9" integer - "." decimalpoint + "." decimalpart "eE" exponentpart :decimalpoint Number diff -pruN 3.1.1-1/syntax/yaml.jsf 3.1.2-1/syntax/yaml.jsf --- 3.1.1-1/syntax/yaml.jsf 2017-05-16 12:31:06.000000000 +0000 +++ 3.1.2-1/syntax/yaml.jsf 2017-11-04 18:24:50.000000000 +0000 @@ -12,7 +12,7 @@ =Directive red =Reference yellow -=LocalType blue +=LocalType fg_310 # brown =BlockDelim bold blue =BadTab inverse red @@ -23,14 +23,9 @@ "#" line_comment recolor=-1 " " line_start -:maybe_idlecomment Comment - * idle noeat - "#" line_comment recolor=-1 - :idle Constant * plain_scalar noeat "\n" line_start - " " maybe_idlecomment "%" directive recolor=-1 " " maybe_idle_comment "'" string_sq_1 recolor=-1 @@ -55,7 +50,8 @@ :maybe_key1 Constant * idle noeat ":" key - " a-zA-Z0-9_-" maybe_key1 + "a-zA-Z0-9_-" maybe_key1 + " " maybe_key1_comment # necessary to include the : :key Idle @@ -72,6 +68,10 @@ * plain_scalar noeat "#" line_comment +:maybe_key1_comment Comment + * maybe_key1 noeat + "#" line_comment + :maybe_idle_comment Comment * idle noeat "#" line_comment