paste text to the right of cursor
-
Did you try to record a macro?
-
I don’t see how this could be done as a macro, but it would be great if I could be enlightened! :-)
A simple bit of Pythonscript seems to satisfy, though:
p = editor.getCurrentPos() editor.paste() editor.setEmptySelection(p) -
to be honest, I don’t use macros - just thought it was possible.
And it shouldn’t be that hard for the OP to test whether it is possible or not. -
@Ekopalypse said in paste text to the right of cursor:
And it shouldn’t be that hard for the OP to test whether it is possible or not.
The “stopper” for me in thinking about recording a macro for it is what to do after the paste. Sure I could cursor left 7 times, but this only handles the specific case of the paste data being 7 characters, not the generic case where data could be any width at all (the script handles that aspect of it just fine).
-
I was thinking about using CTRL+LEFT_ARROW but I guess I understand what you mean.
The text could bemore text to insertand not only one word I see.
Right - macro seems not be the right choice here. -
@Alan-Kilborn
Thanks for your help, that little python snippet works perfectly! -
@Alan-Kilborn
Actually, now that I’m using it, I realised that its not perfectly working.
So I managed to use a python snippet and npp shortcut to paste text to the right, but when I (directly) go with the arrow key down to the next line, the cursor jumps to the end of the line/to the position of the end of the pasted text.
If I first use left right arrow, npp keeps the right position. Seems like npp doesnt update the cursor position properly.
Any idea how to fix this?
Thanks for your help! -
One solution might be to add
editor.charRight() editor.charLeft()to the end of the script.
-
@fahrrad13 said:
but when I (directly) go with the arrow key down to the next line, the cursor jumps to the end of the line/to the position of the end of the pasted text.
Put this at the end of the prior script to fix that problem:
editor.chooseCaretX() -
@Alan-Kilborn thanks a lot - that works perfectly.
So here the final solution to this thread summarized from above:p = editor.getCurrentPos() editor.paste() editor.setEmptySelection(p) editor.chooseCaretX()
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login