Post by chaat on Sept 21, 2014 21:12:49 GMT -5
I use the WINDOWS CUT followed by the blockpaste. The primary reason i use these is to move a block of code either right or left without changing the other data on the lines. I have this working well in SPFLITE except for the position of the cursor after the windows cut. Currently it moves the cursor position to the next line after the block of code which has been cut. Then I have to position the cursor back to the top-left position of the block which was cut before moving the cursor right or left to the desired position before doing the block paste.
would there be a was to do this with a macro ? perhaps some way to remember the top-left position of the selected code block and then use that remembered position to set the cursor position after the windows cut command.
I can see how to use the macro functions to get the positions of the selected text block. What I don't know how to do would be to issue the WINDOWS CUT command after that.
I've created two key mappings as follows
D + cntrl ==> (cut)
F + cntrl ==> (blockpaste)
These two work fine except that the cursor jumps after the selected block when the D+cntrl key is used.
To try to get around that I created two macros PUSHSEL which gets the line and position of the selected block of text and stores them in two global strings.
the second macro POPSEL retrieves the global strings containing the saved line and position and then does a Set_Csr to move the cursor back to the top left position of the text which was cut.
if i map these macros to separate keys for example P+cntrl and P+alt, then i can select the text, do a P+cntrl, then a D+cntrl, then a P+alt to arrive at the desired result which is a windows cut (i.e. primitive cut) and position the cursor at the top left of the text box which was cut.
I've tried to put all three of these functions to a single key map but its not working
for example ====> D+alt => pushsel (cut) popsel
it does push and then appears to stop and on the command line is the key mapping
I tried to use the "add attachment" function to include the two macro's that i created but it doesn't seem to work
would there be a was to do this with a macro ? perhaps some way to remember the top-left position of the selected code block and then use that remembered position to set the cursor position after the windows cut command.
I can see how to use the macro functions to get the positions of the selected text block. What I don't know how to do would be to issue the WINDOWS CUT command after that.
I've created two key mappings as follows
D + cntrl ==> (cut)
F + cntrl ==> (blockpaste)
These two work fine except that the cursor jumps after the selected block when the D+cntrl key is used.
To try to get around that I created two macros PUSHSEL which gets the line and position of the selected block of text and stores them in two global strings.
the second macro POPSEL retrieves the global strings containing the saved line and position and then does a Set_Csr to move the cursor back to the top left position of the text which was cut.
if i map these macros to separate keys for example P+cntrl and P+alt, then i can select the text, do a P+cntrl, then a D+cntrl, then a P+alt to arrive at the desired result which is a windows cut (i.e. primitive cut) and position the cursor at the top left of the text box which was cut.
I've tried to put all three of these functions to a single key map but its not working
for example ====> D+alt => pushsel (cut) popsel
it does push and then appears to stop and on the command line is the key mapping
I tried to use the "add attachment" function to include the two macro's that i created but it doesn't seem to work