I can see your point of view. But I see it as an unexpected result.
When I try the same thing in the PythonWin editor all that is copied and pasted is the function name abc using the same example above. This is the result I expected. I have all the functions folded for readability, when i select a function name and copy it, I don't expect or want a column of text the width of the function name. Makes for unexpected results when you paste (what you expect) into a cmdline and get a potentially huge block of code pasted instead.
The workaround of opening the folded code, finding the start of the block and then selecting the word/function name you originally selected seems very cumbersome and slow.
The workaround of opening the folded code, finding the start of the block and then selecting the word/function name you originally selected seems very cumbersome and slow.
But if you actually wanted this current behaviour then the alternative would likewise be cumbersome and slow since you would have to manually column mark all the lines of the folded area.
But in any case don’t forget Zeus is scriptable, so by righting a simple script it should be easy enough to make Zeus behave which ever way you like.
See below my first rough attempt at a Python script to do exactly what you describe. As a first attempt it is a bit rough around the edges and still needs to be debugged but it does indicate that a script solution is possible
import zeus
def key_macro():
FOLD_NONE = 0
# check if the current line is a fold point or if we have no markings
if zeus.get_line_folding() == FOLD_NONE or zeus.is_marked() == 0:
# leave it up to default behaviour
zeus.MarkCopyEx()
else:
# get the current mark range
top = zeus.get_marked_top()
bottom = zeus.get_marked_bottom()
# see if this is the 'single line' marked case
if bottom == top:
# copy the lines to the clipboard
zeus.MarkCopyEx()
# read back the lines from the clipboard
text = zeus.get_clipboard_text()
# break clipboard data into lines and throw away the line feeds
keepends = 0
results = text.splitlines(keepends)
# put the first line back into the clipboard
zeus.set_clipboard_text(results[0])
else:
# leave it up to default behaviour
zeus.MarkCopyEx()
key_macro() # run the macro