From 867d22e419afe769f05ad26b61c6ea5ea1432c3c Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 22 Mar 2025 13:45:28 +0300 Subject: harmonized all word-movement and deletion commands: they move/delete until the beginning of words now * All commands and their documentations were inconsistent. * ^W rubbed out to the beginning of words. * Shift+Right (fnkeys.tes) moved to the beginning of the next word if invoked at the beginning of a word and to the end of the next word otherwise. * (and and by extension) moved to the end of the next word. * The cheat sheet would claim that moves to the beginning of the next word. * Video TECO's command would differ again from everything else. With positive arguments, it moved to the beginning of words, while with negative it moved to end of words. I decided not to copy this behavior. * It has been decided to adopt a consistent beginning-of-words policy. -W therefore differs from Video TECO in moving to the beginning of the current or previous word. * teco_find_words() is now based on parsing the document pointer, instead of relying on SCI_WORDENDPOSITION, since the latter cannot actually be used to skip strictly non-word characters. This requires a constant amount of Scintilla messages but will require fewer messages only when moving for more than 3 words. * The semantics of are therefore now consistent with Vim and Emacs as well. * Shift+Right/Left is still based on SCI_WORDENDPOSITION, so it's behavior differs slightly from for instance at the end of lines, as it will stop at linebreaks. * Unfortunately, these changes will break lots of macros, among others the M#rf, M#sp and git.blame macros ("Useful macros" from the wiki). --- lib/fnkeys.tes | 4 ++-- lib/opener.tes | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/fnkeys.tes b/lib/fnkeys.tes index 857c249..922548b 100644 --- a/lib/fnkeys.tes +++ b/lib/fnkeys.tes @@ -78,7 +78,7 @@ 1U[ LEFT] @[SLEFT]{ - 0,0,ESWORDSTARTPOSITIONESWORDSTARTPOSITIONU.p + 1,0,ESWORDSTARTPOSITIONESWORDSTARTPOSITIONU.p Q.pESGETCOLUMN,4EJ Q.p:-.M#c } @@ -94,7 +94,7 @@ 1U[ RIGHT] @[SRIGHT]{ - 0,0,ESWORDENDPOSITIONESWORDENDPOSITIONU.p + 0,1,ESWORDENDPOSITIONESWORDENDPOSITIONU.p Q.pESGETCOLUMN,4EJ Q.p:-.M#c } diff --git a/lib/opener.tes b/lib/opener.tes index 6a57317..21c118d 100644 --- a/lib/opener.tes +++ b/lib/opener.tes @@ -16,7 +16,7 @@ 1U.l 1U.c !* +line[,column] *! 0A-+"= - C 0A"D \U.l W 0A-,"= C \U.c ' 0A-10"=L' ' + C 0A"D \U.l <0A"DC|1;'> 0A-,"= C \U.c ' 0A-10"=L' ' ' !* filename:line[:column][:] *! -- cgit v1.2.3