<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sciteco/src, branch session-extensions</title>
<subtitle>Scintilla-based Text Editor and COrrector</subtitle>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/'/>
<entry>
<title>scroll caret __almost__ always automatically after key presses</title>
<updated>2025-04-04T00:53:07+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-04-04T00:36:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=d2f759a1d4c8a42db73ac62cb8317847a1b40249'/>
<id>d2f759a1d4c8a42db73ac62cb8317847a1b40249</id>
<content type='text'>
* The old heuristics - scroll if dot changes after key press -
  turned out to be too simplistic.
  They broke the clang-format macro (M#cf), which left the view at the
  top of the document since the entire document is temporarily erased.
  Other simplified examples of this bug would be:
  @^Um{[: HECcat$ ]:} Mm
  Or even: @^Um{[: H@X.aG.a ]:} Mm
* Actually, the heuristics could be tricked even without deleting any
  significant amount of text from the buffer.
  The following test case replaces the previous character with a linefeed
  in a single key press:
  @^Um{-DI^J$} Mm
  If executed on the last visible line, dot wouldn't be scrolled into the view
  since it did not change.
* At the same time, we'd like to keep the existing mouse scroll behavior from
  fnkeys.tes, which is allowed to scroll dot outside of the visible area.
  Therefore, dot is scrolled into view always, except after mouse events.
  You may have to call SCI_SCROLLCARET manually in the ^KMOUSE macro,
  which is arguably not always straight forward.
* Some macros like M#cf may still leave the vertical scrolling position
  in unexpected positions. This could either be fixed by eradicating all
  remaining automatic scrolling from Scintilla or by explicitly restoring
  the vertical position from the macro (FIXME).
* This was broken since the introduction of mouse support,
  so it wasn't in v2.3.0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The old heuristics - scroll if dot changes after key press -
  turned out to be too simplistic.
  They broke the clang-format macro (M#cf), which left the view at the
  top of the document since the entire document is temporarily erased.
  Other simplified examples of this bug would be:
  @^Um{[: HECcat$ ]:} Mm
  Or even: @^Um{[: H@X.aG.a ]:} Mm
* Actually, the heuristics could be tricked even without deleting any
  significant amount of text from the buffer.
  The following test case replaces the previous character with a linefeed
  in a single key press:
  @^Um{-DI^J$} Mm
  If executed on the last visible line, dot wouldn't be scrolled into the view
  since it did not change.
* At the same time, we'd like to keep the existing mouse scroll behavior from
  fnkeys.tes, which is allowed to scroll dot outside of the visible area.
  Therefore, dot is scrolled into view always, except after mouse events.
  You may have to call SCI_SCROLLCARET manually in the ^KMOUSE macro,
  which is arguably not always straight forward.
* Some macros like M#cf may still leave the vertical scrolling position
  in unexpected positions. This could either be fixed by eradicating all
  remaining automatic scrolling from Scintilla or by explicitly restoring
  the vertical position from the macro (FIXME).
* This was broken since the introduction of mouse support,
  so it wasn't in v2.3.0.
</pre>
</div>
</content>
</entry>
<entry>
<title>^W also rubs out/in `@` and `:` modifiers</title>
<updated>2025-03-29T13:25:48+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-29T13:25:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=62a9c8d112e33d1202c8562744bddfa102c1f96e'/>
<id>62a9c8d112e33d1202c8562744bddfa102c1f96e</id>
<content type='text'>
* It makes little sense to e.g. rub out until `I` in `@I/foo/`, but
  leave the `@` modifier.
  Modifiers have to be considered part of the command,
  even though the state machine is not currently modelled like that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* It makes little sense to e.g. rub out until `I` in `@I/foo/`, but
  leave the `@` modifier.
  Modifiers have to be considered part of the command,
  even though the state machine is not currently modelled like that.
</pre>
</div>
</content>
</entry>
<entry>
<title>added `@W`, `@P`, `@V` and `@Y` command variants</title>
<updated>2025-03-29T12:29:34+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-29T12:15:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=ca0d7656b606703f1b5b52e59f0b46ca0038477e'/>
<id>ca0d7656b606703f1b5b52e59f0b46ca0038477e</id>
<content type='text'>
* They swap the default order of skipping characters.
  For positive arguments: first non-word chars, then word chars.
* This is especially useful after executing the non-at-modified versions.
  For instance, at the beginning of a word, `@W` jumps to its end.
  `@V` would delete the remainder of the word.
* Since they have to evaluate the at-modifier, which has syntactic
  significance, the command implementations can no longer use
  transition tables, so they are in the switch-statements instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* They swap the default order of skipping characters.
  For positive arguments: first non-word chars, then word chars.
* This is especially useful after executing the non-at-modified versions.
  For instance, at the beginning of a word, `@W` jumps to its end.
  `@V` would delete the remainder of the word.
* Since they have to evaluate the at-modifier, which has syntactic
  significance, the command implementations can no longer use
  transition tables, so they are in the switch-statements instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>the ES command (send Scintilla message) now supports passing both wParam and lParam as null-terminated strings</title>
<updated>2025-03-23T15:42:07+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-23T15:31:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=9e101ec36e0bf45f294f63015e0352d1d08d641d'/>
<id>9e101ec36e0bf45f294f63015e0352d1d08d641d</id>
<content type='text'>
* Being able to embed null bytes into the lParam string is
  practically useless - there aren't any messages where this is useful
  and where there are no native SciTECO counterparts - so this case is now catched
  and the null-byte separates wParam from lParam.
* wParam can be the empty string, but it is not supported to pass wParam as a
  string and lParam as the empty string.
  If the second string argument ends in ^@, lParam is popped from the stack instead.
* This is a temporary workaround until we can properly parse the Scintilla.iface and
  generate more elegant per-message wrappers.
* It in particular unlocks the SCI_SETREPRESENTATION and SCI_SETPROPERTY messages.
  The former allows us to write a special hex-editor macro which sets hexadecimal
  character representations, while the latter allows you to set lexer properties.
* The C-based lexers ("cpp" in Lexilla) can now take preprocessor definitions into account.
  This is disabled by default, unless you set lexer.c.defines before opening a file.
  You can also set it interactively and re-set the lexer. For instance:
  ^U[lexer.c.defines]NDEBUG$ M[lexer.set.c]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Being able to embed null bytes into the lParam string is
  practically useless - there aren't any messages where this is useful
  and where there are no native SciTECO counterparts - so this case is now catched
  and the null-byte separates wParam from lParam.
* wParam can be the empty string, but it is not supported to pass wParam as a
  string and lParam as the empty string.
  If the second string argument ends in ^@, lParam is popped from the stack instead.
* This is a temporary workaround until we can properly parse the Scintilla.iface and
  generate more elegant per-message wrappers.
* It in particular unlocks the SCI_SETREPRESENTATION and SCI_SETPROPERTY messages.
  The former allows us to write a special hex-editor macro which sets hexadecimal
  character representations, while the latter allows you to set lexer properties.
* The C-based lexers ("cpp" in Lexilla) can now take preprocessor definitions into account.
  This is disabled by default, unless you set lexer.c.defines before opening a file.
  You can also set it interactively and re-set the lexer. For instance:
  ^U[lexer.c.defines]NDEBUG$ M[lexer.set.c]
</pre>
</div>
</content>
</entry>
<entry>
<title>refactored Lexilla/Scintillua support: it's now in teco_create_lexer()</title>
<updated>2025-03-23T02:31:24+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-23T02:31:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=8f0fea5b17025a424474bc78c668ae3bfb0e2661'/>
<id>8f0fea5b17025a424474bc78c668ae3bfb0e2661</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>the ^W immediate editing command now mimics `Y` more closely and also rubs out no-op commands (whitespace)</title>
<updated>2025-03-23T01:36:37+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-23T01:21:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=e066864eb3a468b64970107e880a2f3e16d67a37'/>
<id>e066864eb3a468b64970107e880a2f3e16d67a37</id>
<content type='text'>
* In string arguments, ^W first rubs out non-word chars (usually whitespace),
  so it makes sense if ^W would work analogously at the command level.
  A non-command would be one of the no-ops.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* In string arguments, ^W first rubs out non-word chars (usually whitespace),
  so it makes sense if ^W would work analogously at the command level.
  A non-command would be one of the no-ops.
</pre>
</div>
</content>
</entry>
<entry>
<title>added `P` command as a reverse form of `W`</title>
<updated>2025-03-22T12:19:53+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-22T12:19:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=ab35f6618bc8beb4543cbc7c62332f82d7d5699c'/>
<id>ab35f6618bc8beb4543cbc7c62332f82d7d5699c</id>
<content type='text'>
* All the movement commands have shortcuts for their negative forms:
  `R` instead of `-C`, `B` instead of `-L`.
  Therefore there was always the need for a `-W` shortcut as well.
* `P` is a good choice because it is a file IO command in TECO-11,
  that does not make sense supporting.
  In Video TECO it toggles between display windows (ie. split screens)
  and I do not plan to support multiple windows in SciTECO.
* Added to the cheat sheet.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* All the movement commands have shortcuts for their negative forms:
  `R` instead of `-C`, `B` instead of `-L`.
  Therefore there was always the need for a `-W` shortcut as well.
* `P` is a good choice because it is a file IO command in TECO-11,
  that does not make sense supporting.
  In Video TECO it toggles between display windows (ie. split screens)
  and I do not plan to support multiple windows in SciTECO.
* Added to the cheat sheet.
</pre>
</div>
</content>
</entry>
<entry>
<title>factored out all cursor movement and deletion commands into the new compilation unit move-commands.c</title>
<updated>2025-03-22T12:00:51+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-22T11:58:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=fe69fdb29f994db3bbcaffcb202856618b03b9b0'/>
<id>fe69fdb29f994db3bbcaffcb202856618b03b9b0</id>
<content type='text'>
* This made sense to include both `W` and `V`, so we also included `D` and `K`.
  `^Q` is included since it converts between lines and glyphs.
* These are all single-letter commands, so they aren't complete parser states
  but callbacks to be referenced in teco_machine_main_transition_t.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This made sense to include both `W` and `V`, so we also included `D` and `K`.
  `^Q` is included since it converts between lines and glyphs.
* These are all single-letter commands, so they aren't complete parser states
  but callbacks to be referenced in teco_machine_main_transition_t.
</pre>
</div>
</content>
</entry>
<entry>
<title>harmonized all word-movement and deletion commands: they move/delete until the beginning of words now</title>
<updated>2025-03-22T11:13:53+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-22T10:45:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=867d22e419afe769f05ad26b61c6ea5ea1432c3c'/>
<id>867d22e419afe769f05ad26b61c6ea5ea1432c3c</id>
<content type='text'>
* 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.
  * &lt;W&gt; (and &lt;V&gt; and &lt;Y&gt; by extension) moved to the end of the next word.
  * The cheat sheet would claim that &lt;W&gt; moves to the beginning of the next word.
* Video TECO's &lt;W&gt; 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 &lt;W&gt; 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 &lt;W&gt; 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).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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.
  * &lt;W&gt; (and &lt;V&gt; and &lt;Y&gt; by extension) moved to the end of the next word.
  * The cheat sheet would claim that &lt;W&gt; moves to the beginning of the next word.
* Video TECO's &lt;W&gt; 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 &lt;W&gt; 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 &lt;W&gt; 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).
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed rubout of Q-Register specifications</title>
<updated>2025-03-21T10:40:52+00:00</updated>
<author>
<name>Robin Haberkorn</name>
<email>robin.haberkorn@googlemail.com</email>
</author>
<published>2025-03-21T10:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.fmsbw.de/sciteco/commit/?id=33f71654136014bac094babaaa81d91245fdd24c'/>
<id>33f71654136014bac094babaaa81d91245fdd24c</id>
<content type='text'>
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a.
* The undo token that frees newly allocated teco_machine_qregspec_t must actually
  reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(),
  will expect a valid pointer.
* Could have been done via
  ctx-&gt;expectqreg = NULL;
  teco_undo_qregspec_own(ctx-&gt;expectqreg);
  but using a special clear function requires less memory and is easier to understand.
* Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* This was a regression introduced by 257a0bf128e109442dce91c4aaa1d97fed17ad1a.
* The undo token that frees newly allocated teco_machine_qregspec_t must actually
  reset the pointer as well since any subsequent token, pushed by teco_undo_qregspec_own(),
  will expect a valid pointer.
* Could have been done via
  ctx-&gt;expectqreg = NULL;
  teco_undo_qregspec_own(ctx-&gt;expectqreg);
  but using a special clear function requires less memory and is easier to understand.
* Added test case. This wouldn't always crash, but should definitely show up in Valgrind.
</pre>
</div>
</content>
</entry>
</feed>
