GetMethodAtCursor
Posted: 20 Aug 2011 17:07
I'm attempting to write a script that will select the entire method that contains insertion cursor. Looking at the scripting docs, GetMethodAtCursor(True) sounds like exactly what I need.
However, using that, the lines that get selected seem to depend on where the cursor is in the method. For instance, placing the cursor on the first line of a method generally selects the entire method, but placing the cursor somewhere within the method generally "misses" a few lines at seemingly random locations (so most of the method is selected, but a few random lines are not part of the selection).
If you need more details, I'll try to provide them.
Once I'm able to successfully select the current method, I'd like to automatically copy the selection to the clipboard. However, I didn't see any clipboard-related methods in the scripting docs. Is that possible?
Thanks,
Jeff
However, using that, the lines that get selected seem to depend on where the cursor is in the method. For instance, placing the cursor on the first line of a method generally selects the entire method, but placing the cursor somewhere within the method generally "misses" a few lines at seemingly random locations (so most of the method is selected, but a few random lines are not part of the selection).
If you need more details, I'll try to provide them.
Once I'm able to successfully select the current method, I'd like to automatically copy the selection to the clipboard. However, I didn't see any clipboard-related methods in the scripting docs. Is that possible?
Thanks,
Jeff