Bug 129273 - EDITING: Swap-Text feature request
Summary: EDITING: Swap-Text feature request
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Enhancements
  Show dependency treegraph
 
Reported: 2019-12-08 07:41 UTC by Luke Kendall
Modified: 2023-04-21 16:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kendall 2019-12-08 07:41:24 UTC
When editing my writing, I often wish to swap two phrases or clauses that are comma, conjunction, or otherwise separated:
TEXT1, blah blah, and TEXT2.
It would be helpful to be able to swap TEXT1 and TEXT2, but until today I couldn't think of a simple UI to enable that, because you need two separate selections.

Here's the idea for how to do it: 

1) select and CUT one text item. (LO is enhanced to remember that insertion point.)
2) select a 2nd piece of text
3) Choose the Swap Text function.  The current selection is copied as-is into the remembered insertion point, and the previously cut text is then copied down over the current selection.

Please consider!
Comment 1 Heiko Tietze 2019-12-09 10:06:04 UTC
Shift+ctrl+up down swapes the paragraph up/down (the command is configurable so you may add it to the toolbar of your choice, if it isn't somewhere).

Is that sufficient for you?
Comment 2 Luke Kendall 2019-12-09 12:24:00 UTC
Short answer: no, definitely not.

Reasons:
1. Main problem is that it only swaps paragraphs (not a word, phrase, or clause).
2. For me, swapping paragraphs is very rare. For a paragraph, I would be far more likely to simply cut and paste one para into a different place than to swap two.
3. If Shift+ctrl+up/down only swaps the text (para) with the previous/next, it would require more user steps than  cut/paste, when the paragraph needs to be bubbled up/down further.
4. It also doesn't take advantage of the UI idea of having 
  <last-cut text + associated location in document>
coupled with
  <current text selection + its location in document>
to give you two text "selections" which you could apply binary operations to. Admittedly, the only binary operation that springs immediately to mind as useful is "swap"!

I hope these comments are helpful.
Comment 3 Heiko Tietze 2019-12-10 09:05:49 UTC
So your expected workflow is to select some text, put the cursor somewhere else, and "swap" the selection to this position? Probably not, so how do you mark the target text to which the conventionally selected part is to swap?
Comment 4 Luke Kendall 2019-12-13 08:27:10 UTC
No, that's not the workflow I described. I don't think it's even possible to put the insertion point in a new location without losing the selection is it?

Anyway:

1) select and CUT one text item. (LO is enhanced to remember that insertion point.)
2) select a 2nd piece of text
3) Choose the Swap Text function.  The current selection is copied as-is into the remembered insertion point from the text that was most recently CUT, and the previously cut text is then copied down over the current selection.
Comment 5 Heiko Tietze 2019-12-13 08:57:54 UTC
Git it. So let's see if a developer wants to implement this Paste Special > Swap way (please don't add another command/interaction).
Comment 6 Luke Kendall 2020-02-15 12:41:31 UTC
Simplification.

This is far, far simpler than I proposed.

I only wondered today if you could make separate disjoint text selections manually, and discovered that you can, simply by holding down the Control key while selecting.

So the UI is basically nothing now, the steps being:

1) Select 1st piece of text.
2) Hold Control key while selecting 2nd piece of text.
3) Choose Swap Text function.

I don't know if it would be useful to allow more than two selections, and have the text 'cycle' between the selections: probably only useful if the text remained selected after the Swap Text (Cycle Text) was performed.