Menu

Folding & copy & paste

Anonymous
2010-04-21
2012-11-14
  • Anonymous

    Anonymous - 2010-04-21

    Is there any way to disable the underlining of the folded text.

    Also it would be great to be able just to copy then paste the non folded text.

    Why do I want this you may ask, I'm using folding to try and hide text that I have to copy and paste into a report.

     
  • cchris

    cchris - 2010-04-22

    You can change various options related to folded txt appearance using a synthetic macro.
    Paste the following into shortcuts.xml, preferrably before the </Macros> tag:
    <Macro name="foldMakeUp" Ctrl="yes" Alt="yes" Shift="no" Key="100">
      <Action type="0" message="2233" wParam="0" lParam="0" sParam=""/>
    </Macros>

    The Scintilla docs for the SCI_SETFOLDFLAGS will telll you how to change wParam to add lines before or after the block, if so you choose. Be sure to fire the macro if you want to apply the changes.

    Concerning copy/paste for folded text, you may ask for the feature on IdeaTorrent. However, I think only a plugin could do it without interfering with Scintilla, which we don't do.

    CChris

     
  • Fool4UAnyway

    Fool4UAnyway - 2010-04-22

    Text FX Viz may be of help here.

    Folded lines are just a kind of hidden lines, however, it doesn't work exactly correct.

    For folded lines, the end of line / newline character is not considered to be hidden, with the following consequences.

    You could copy "all visible lines" after folding the code.
    - Select all (desired) lines
    - Use Text FX (Menu), Text FX Viz (Submenu), Copy Visible Selection (Menuitem, first of the third part of the Submenu).
    - When you paste the copied text in another document, you will find that all text is on a single line: the newline characters have not been copied

    You could work around this by inserting an identifier string at the end of the lines before the actions above, and then replace this identifier string after having pasted the copied text.

    You could delete "all invisible lines" after folding the (copied) code (in a new document).
    - Select all (desired) lines
    - Use Text FX (Menu), Text FX Viz (Submenu), Delete Invisible Selection (Menuitem, sixth of the third part of the Submenu).
    - All contents of the invisible lines are deleted, the lines themselves remain as blanks, and all lines will be visible

    So you just get empty lines instead of (deleting the) undesired lines. You could be helped by Text FX, Text FX Edit, Delete Blank Lines. However, this may also remove intentionally empty lines in the previously unfolded sections. For this reason, the first method is preferable. It is safer.

     
MongoDB Logo MongoDB