Is there a way to copy code from eclipse including ine numbers

前端 未结 3 2065
情歌与酒
情歌与酒 2021-01-18 10:11

I am writing a little bit of documentation and code explanation. I would like to copy code from eclipse including line numbers, so that it becomes easier to reference the co

3条回答
  •  暖寄归人
    2021-01-18 10:34

    Another not-so-clean work-around to achieve this. This is specific to the Subversive plug-in.

    3 steps to follow:

    1. Delete the piece of code you need to copy and save the source file.
    2. Right click the file and chose option Team -> Create Patch.. and save it to a file, say copy.patch
    3. Undo (Ctrl + Z) the changes to revert the deletion done in step 1 and save the source file again.

    Open the patch file and use the contents.

    This also includes the file-name (if desired) along with the line number and retains the indentation.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题