TSE: Character where the cursor moves to when doing Paste() and PasteFromWinClip()

41 views
Skip to first unread message

knud van eeden

unread,
Mar 6, 2026, 11:38:46 AM (6 days ago) Mar 6
to SemWare TSE Pro Text Editor, S.E. Mitchell
TSE: Character where the cursor moves to when doing Paste() and PasteFromWinClip()

Hello,

When deliberating about 'optimal' actions, it was noticed that in TSE, e.g. 4.50.20 for Windows
if you do a 

 Paste()

or a

 PasteFromWinClip()

then the character where the cursor ends is the FIRST character.

E.g.

This
^

On the other hand when doing a similar paste action in e.g. NotePad, NotePad++, Emacs, VIM, the email client in the browser, ...
the cursor moves to the position AFTER the LAST character

E.g.

This
    ^

Any historic reason why Semware decided to choose this less common action of moving the cursor to the FIRST character?

(it is a bit less optimal when pasting in a running text, because usually one has to do an extra action to move to the 
position from the current first character to the position of after the last character to continue further typing.

(so thus basically a default 'PRE' or 'prefix' or 'GOTOBEGIN' action in TSE versus a 'POST' or 'suffix' or 'GOTOEND' default action in (almost) all other applications).

with friendly greetings
Knud van Eeden
Artificial Intelligence
IT specialist
TSE specialist


S.E. Mitchell

unread,
Mar 7, 2026, 5:06:41 AM (5 days ago) Mar 7
to knud van eeden, SemWare TSE Pro Text Editor
re: why do the paste commands keep the cursor position, instead of
moving the cursor to the end of the pasted text, as virtually all
other editors do.

Because that is the way the editors I was familiar with did it.
But, I do think it is more convenient for the cursor to end up at the
end of the pasted text.
I am _loathe_ to introduce an option - as that makes it hard for macro
writers. e.g., one would have to account for the option when using
paste(), and act accordingly.

I am thinking about introducing two new commands:
Paste2() and PasteFromWinClip2() - which will place the cursor at the
end of the pasted text.
But those are horrible names. Hopefully I can come up with something better.
--
Sammy Mitchell

H P

unread,
Mar 7, 2026, 6:56:30 AM (5 days ago) Mar 7
to sem...@googlegroups.com
Knud,

Try the difference whebn marking with alt k (using the arrows) and marking by the mouse.
In a clean tsepro marking with the mouse and then (ctrl c) and then copying with ctrl v leaves the cursor to the right of the copied field (as it should).
However when doing the same but marking with the arrows using alt k and then ctrl c and then copying with ctrl v leaves the cursor at the last positition of the copied field.
The same is valid for using copy and paste with grey+ and grey*.
So to me it's the 1 position difference when using keybord to marking with the mouse.


Met vriendelijke groet,
With kind regards,
Muy atentamente,
Mit Freundliche Gruß,
Sinceramente,


H. Pikaar

Henri...@gmail.com



Op za 7 mrt 2026 om 11:06 schreef S.E. Mitchell <sammy.m...@gmail.com>:
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/semware/CA%2BgEvkaQofGL-g_HLEgA6p0tdO7ga8n3tdpLEH5t4ArG6KmP_w%40mail.gmail.com.

knud van eeden

unread,
Mar 7, 2026, 7:35:07 AM (5 days ago) Mar 7
to sem...@googlegroups.com, SemWare TSE Pro Text Editor
1. Introducing a new Paste2() and PasteFromWinClip2() 
or similarly PasteEnd() and PasteFromWinClipEnd() 
would be an option so that the user can explicitly express the intention to move to the end position.

2. Paste() and PasteFromWinClip() should not change their default behavior, for backwards compatibility purposes.

3. So one solution would be to additionally introduce a new TSE boolean parameter whch keeps when TRUE the old behavior of keeping the first character position (so nothing changes in behavior) and when FALSE moves to the end character position and can be set via Set() and be read via Query() and is present in the 'Full Options' and 'write to ASCII file'.

Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.

knud van eeden

unread,
Mar 7, 2026, 7:55:14 AM (5 days ago) Mar 7
to sem...@googlegroups.com
And then for me would the action be to choose and burn the parameter in in TSE configuration to always be FALSE so that when using Paste() and PasteFromWinClip() and <Ctrl v> and <Shift Ins> it always goes to the end of the word.


Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

S.E. Mitchell

unread,
Mar 7, 2026, 8:01:54 AM (5 days ago) Mar 7
to sem...@googlegroups.com
Instead of new commands, I am planning on doing this via macros.
If you use the win.ui or ws (wordstar), that (cursor goes to the end
of pasted text) will be the new behavior, so as to match virtually
ever editor in the world :)
For the tse.ui, tsejr.ui and brief.ui, one will have to add the macros
to it, and assign them appropriately. Or create a tsestart macro, to
avoid changing the .ui.

Also note that if you use cuamark, pasting from Windows puts the
cursor at the end of the pasted text.

--
Sammy Mitchell

On Sat, Mar 7, 2026 at 7:55 AM 'knud van eeden' via SemWare TSE Pro
> To view this discussion visit https://groups.google.com/d/msgid/semware/1251571072.6129598.1772888103675%40mail.yahoo.com.

knud van eeden

unread,
Mar 7, 2026, 8:05:43 AM (5 days ago) Mar 7
to sem...@googlegroups.com
And of course with regard to that TSE parameter one might choose it instead to be TRUE to move to the end and FALSE to keep the first character position. Maybe that is indeed a more 'natural' and intuitive choice here.


Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

On Sat, Mar 7, 2026 at 13:55, 'knud van eeden' via SemWare TSE Pro text editor

knud van eeden

unread,
Mar 7, 2026, 8:10:21 AM (5 days ago) Mar 7
to sem...@googlegroups.com
> For the tse.ui, tsejr.ui and brief.ui, one will have to add the macros
to it, and assign them appropriately.

Would that not imply that the TSE user would have to explicitly manually adapt his TSE.UI at each new release of a new TSE version, e.g. at 4.50.21, also at 4.50.22, 4.50.23, ... and so on?

Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

S.E. Mitchell

unread,
Mar 7, 2026, 8:11:25 AM (5 days ago) Mar 7
to sem...@googlegroups.com
No - just use a tsestart macro. No need to change the ui file.

On Sat, Mar 7, 2026 at 8:10 AM 'knud van eeden' via SemWare TSE Pro
> To view this discussion visit https://groups.google.com/d/msgid/semware/1013994770.6139477.1772889009447%40mail.yahoo.com.

knud van eeden

unread,
Mar 7, 2026, 8:46:14 AM (5 days ago) Mar 7
to sem...@googlegroups.com
Just FYIO I have never used an extra native TSE 'tsestart.s' macro which must then always be present and existing, in order to avoid complicating things and having to maintain additionally an extra 'tsestart.s' start file.

My for me simplest solution has always been using a single '-e' TSE command line parameter (for example  'g32.exe -e myownstartup.s') in which I put loads (100++) of my startup macros and it fully avoids using that 'autoload' approach (which has possible side effects of showing error messages when not all those autoload macros are present or loaded) also. 

This '-e' command line approach works OK in TSE for Linux and TSE for Microsoft Windows.

Note: The simplest ad hoc solution for me personally would of course be to edit TSE.UI and change the behavior of Paste() and PasteFromWinClip() to include GotoEndWord() or something and reburn.
OK, but that would then be not a general solution for all interested TSE users and then it would be all just for your information.

But maybe your 'tsestart.s' source code for implementing this new Paste() and new PasteFromWinClip() could be added to my '-e' macro, as usual via a Hook() and events or similar, that would then be a most simple permanent solution as that source code migrates always with new versions automatically anyhow.

Sent from Yahoo Mail on Samsung Galaxy S24 Ultra / 1 terabyte / artificial intelligence

S.E. Mitchell

unread,
Mar 7, 2026, 11:03:17 AM (5 days ago) Mar 7
to sem...@googlegroups.com
proc mPasteFromWinClip()
integer unmark_after_paste = Set(UnmarkAfterPaste, Off)
PasteFromWinClip()
GotoBlockEnd()
Set(UnmarkAfterPaste, unmark_after_paste)
GotoBlockEnd()
if isBlockInCurrFile() in _COLUMN_
Right()
endif
if unmark_after_paste
UnmarkBlock()
endif
end

proc mPaste()
integer unmark_after_paste = Set(UnmarkAfterPaste, Off)
Paste()
GotoBlockEnd()
Set(UnmarkAfterPaste, unmark_after_paste)
GotoBlockEnd()
if isBlockInCurrFile() in _INCLUSIVE_, _COLUMN_
Right()
endif
if unmark_after_paste
UnmarkBlock()
endif
end

<ctrl v> mPasteFromWinClip()
<shift ins> mPasteFromWinClip()
<grey*> mPaste()

On Sat, Mar 7, 2026 at 8:46 AM 'knud van eeden' via SemWare TSE Pro
> To view this discussion visit https://groups.google.com/d/msgid/semware/834423676.6130587.1772891165444%40mail.yahoo.com.

Claus Futtrup

unread,
Mar 7, 2026, 12:17:19 PM (5 days ago) Mar 7
to sem...@googlegroups.com
Hi Sammy

>But those are horrible names.

Classical/typical names, with the complete absence of imagination, would
be paste_normal and paste_special.

:-)

With kind regards,
Claus

knud van eeden

unread,
Mar 7, 2026, 7:57:19 PM (4 days ago) Mar 7
to sem...@googlegroups.com
I think that in mPasteFromWinClip() one has also to add _INCLUSIVE_, otherwise the cursor might end at the last character
and not just beyond the last character.

Test
   ^

instead of as expected

Test
    ^

with friendly greetings
Knud van Eeden


===

proc mPasteFromWinClip()
    integer unmark_after_paste = Set(UnmarkAfterPaste, Off)
    PasteFromWinClip()
    GotoBlockEnd()
    Set(UnmarkAfterPaste, unmark_after_paste)
    GotoBlockEnd()
    if isBlockInCurrFile() in _INCLUSIVE_, _COLUMN_
        Right()
    endif
    if unmark_after_paste
        UnmarkBlock()
    endif
end

knud van eeden

unread,
Mar 7, 2026, 8:19:50 PM (4 days ago) Mar 7
to sem...@googlegroups.com
Additionally, not sure, but it might be that it is a little bit
more complicated because

 Paste()

is also used in TSE dialog boxes and the TSE dialog box software does not know
about for example mPaste().



H P

unread,
Mar 8, 2026, 4:36:54 PM (4 days ago) Mar 8
to sem...@googlegroups.com
Another solution could be to put it in the options, especially under the Text Entry/Block options after Unbmark After Paste.
As for instance Cursor at end or on first position after copy from.


Met vriendelijke groet,
With kind regards,
Muy atentamente,
Mit Freundliche Gruß,
Sinceramente,


H. Pikaar

Henri...@gmail.com



Op zo 8 mrt 2026 om 02:19 schreef 'knud van eeden' via SemWare TSE Pro text editor <sem...@googlegroups.com>:

zhong zhao

unread,
Mar 8, 2026, 9:04:29 PM (3 days ago) Mar 8
to SemWare TSE Pro text editor
I think there is a high probability that the pasted content needs to be modified after pasting, and the cursor position is better at the beginning of the pasted content than at the end.
Moreover, if the pasted content is a line fast or column block, which position is considered "behind"?
Reply all
Reply to author
Forward
0 new messages