PDA

View Full Version : Copy / Paste issue



Topdecker
January 14th, 2018, 05:00
I'd not noticed the following behavior before, so I am mentioning it in the hopes that it will get fixed with a future release.

If I copy text that appears as:


System notes: G-class star (Ionia-1) and M-class star (Ionia-2)

Planet list: --, Hot Gas Giant, Small barren planet, Habitable medium, etc

When it is pasted into a new story entry, it will appear as...


System notes:

G-class star (Ionia-1) and M-class star (Ionia-2)Planet list:

Hot Gas Giant, Small barren planet, Habitable medium, etc

In the past, it would strip out all of the text attributes, but now it seems to be creating even more needless work by leaving copied text on the wrong lines.

It would be nice if a primitive function like copy and paste worked. It is, afterall, an editor and copy and pasting is a necessary capability.

Thanks for reading

Top

damned
January 14th, 2018, 05:53
Copy and paste what you have written in your post and it pastes fine.
Unfortunately I suspect it is something in your original source material...

Bidmaron
January 14th, 2018, 05:55
What ruleset? I have not seen that behavior where it combines text on different lines. Usually, it is a PDF problem of the opposite kind, where you have carriage returns that appear at the end of PDF lines.

Zacchaeus
January 14th, 2018, 11:39
Indeed, it is going to depend on the source you are copying from as to what results you get. Many pdfs are terrible and you have to do a lot of correction to get rid of all the extra hidden codes and other stuff that's packed in there.

Topdecker
January 14th, 2018, 16:31
The following was just typed manually (no PDF involvement):

https://i.imgur.com/YC2Yrgo.png

I disabled all extensions, tried again, and get the same behavior.

https://i.imgur.com/OMo1BDo.png

Note that it appears to only happen when a style is applied to the beginning of a line - it doesn't matter if it is bold or italics.

It is absolutely wrecking havoc with copying and pasting shared elements.

EDIT: Savage Worlds ruleset.

EDIT SOME MORE: Also tested against 5e and getting the same results.

Top

Bidmaron
January 14th, 2018, 17:09
What is on the left and what is on the right? You are saying that if you type it in manually without cut and paste it does the same thing? Is the first pair SW and the second 5e?
Please provide a screen shot of your PDF, what program you are using to copy from, and a screenshot of your paste results.

Topdecker
January 14th, 2018, 17:20
There is no source PDF - the shown examples are manually typed.

There is no screener of the 5e example since it is not needed because it does the same thing.

Bidmaron
January 14th, 2018, 17:24
So, when you manually typed, how did you do the formatting? I guarantee you formatting works, so you are doing something incorrect.

Trenloe
January 14th, 2018, 17:28
This is functionality within the base formattedtextcontrol - it has nothing to do with rulesets or extension. It doesn't keep existing formatting during a text copy/paste.

If you want to copy from one one record to another and keep all of the existing formatting then create a copy of the base record - drag/drop the record to create a copy, then edit the new record.

Topdecker
January 14th, 2018, 17:46
It doesn't keep existing formatting during a text copy/paste.


Right, and this is what is borked - FG is goofing up while it cleans up the formatting. It appears to be messing up the CR/LF when the start of a line has formating of some sort. (It also goofs this up when using delete during editing and pulling a line up.)

For my purposes, I am fine with going back and bolding 3 or 4 words. But it is a major bummer when it screws up the lines and I am reassembling what had been correctly formatted sentences and paragraphs.

I do appreciate the suggested work around - it would be great except I really just want to copy a small portion of pre-formatted text where the formatting matters less than the actual text.

Tim

Topdecker
January 14th, 2018, 17:52
I am copying and pasting formatted text - nothing more, nothing less. The problem occurs when the first element of a paragraph is formatted bold or italic.

If I am wrong to want to bold the first word in a paragraph, then wrong I am.

Topdecker
January 14th, 2018, 17:54
I think that where we are at is that I appear to have a problem that no one else is experiencing. It should be super-easy to reproduce and no one seems to have the problem.

How do I fix that? Reinstall? Check data files?

Trenloe
January 14th, 2018, 18:00
I think that where we are at is that I appear to have a problem that no one else is experiencing.
Nope. I'm seeing it too. It's part of the standard "functionality" of the formattedtextcontrol.

Topdecker
January 14th, 2018, 18:12
Ok, well, then I will consider this a bug report. Thanks for letting me know, Trenloe.

This hopefully gets some attention since it seems like basic functionality.


Top

Trenloe
January 14th, 2018, 18:18
This hopefully gets some attention since it seems like basic functionality.
I think this problem, or something very similar has been reported before. To be honest, I don't think you'll see anything soon. Moon Wizard has said a few times he wants to re-work the formattedtextcontrol, but with his work on FGU taking up the majority of his time I don't think you'll see anything soon. Just my opinion, but I want to manage your expectations.

LordEntrails
January 14th, 2018, 19:49
I remember recently a similar discussion about paste in FG stripping all the formatting. I think it was in a thread with Celestian wanting to be able to import tab delimited tables. Moon said something about it.

It is strange that it adds a line return, I would not have expected that. I think it's something they are considering to improve for FGU. But their are concerns because of special characters meaning something in XML etc. (Not that their are workaround that would make improvements).

One other possible work around for you is to create a story template to create your entry. And then use that to create the copies of the formatted story entries. It's what I do so that all my dungeon room descriptions are consistent.

Talyn
January 14th, 2018, 20:06
FG's clipboard is very limited and yes, it does strip formatting and strips/replaces a good deal of custom characters. It seems to be its own separate beast from the standard OS clipboard.

Another "feature" ::sarcastic cough:: is that formatted text control is contained within the text itself so if you, say, set a section of text in the middle of a sentence to bold or italic then copy that into a different formatted text window, you'll notice it creates a linebreak where you started the bold/italics. JPG said something to the effect that this is due to the original programmers (before SmiteWorks) not including CDATA in the XML, which is why a whole host of other character and text rendering issues occur as well. Unfortunately, thanks to backwards compatibility, this behavior will continue into Unity as well.

Topdecker
January 14th, 2018, 20:41
There is also some similar weirdness with using the delete key to 'pull' a formatted paragraph up a line. If a paragraph is adjacent to the point of 'delete,' it will lose it's formatting when the paragraph is drawn upwards. I suspect that this is entangled with the pasting problem that I highlighted here.

You learn to edit things into place and then format them. I hope that they get all this cleaned up with the unity version. It would also be nice to have a developer paste option - where the filters are off.

Top

damned
January 14th, 2018, 21:57
Hi Topdecker Can you repeat your experiment without the : just as a test?
Yes that delete things annoys me too!

Topdecker
January 14th, 2018, 22:21
Hi Topdecker Can you repeat your experiment without the : just as a test?
Yes that delete things annoys me too!

No need - I already tested that :). In one of the examples, there is a line that looks something like...

THis thing, that thing, the other thing

It breaks on THis (breaking on italics rather than bold) and there is no colon involved

Top

Nickademus
January 16th, 2018, 05:21
This has been around as long as I've used FG. When you copy paste formatted text, FG replaces the end format tag with a line break and replaces the beginning format tag with a backspace (combining the line with the previous one). Either unformat the text before copy pasta or fix the lines and formatting after. It was decided long ago it wasn't getting fixed.

ProNobis
October 31st, 2018, 19:08
Stumbled across this looking for an easy way to copy large tables... One solution that does work is switching to doing editing in Notepad++ or XMLSpy where you can copy and past the formatted text field. Of note ALWAYS make a backup first as if you make one mistake FG will wipe the effected section (like all your stories, or all your npcs) to salvage the rest of what it can read. XML spy (by altova) allows for checking of well-formedness which pinpoints these errors before a data scrub making it safer and easier to use than Notepad++ but it is rather expensive (about $500) https://www.altova.com/xmlspy-xml-editor so most people should probably stick with Notepad++ https://notepad-plus-plus.org/ as it is free. There is a free plugin for Notepad++ which claims to add some of the features of XMLSpy https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/Xml%20Tools%202.4.9%20Unicode/, however I have not tested it and do not know how well it works.

Due to the limited nature of copy and past within FG I have been editing the XML directly for the past 8 months. (of note, editing the XML directly also allows you to do cool things like have a table with formatted text within the results boxes allowing for enhanced displays of randomly generated story templates). If you want some advice feel free to pm me or jump into my companies discord https://discord.gg/pqkeFYc

I know these are not perfect solutions, and I do have something in the works that might help... but it won't be ready for another 6-12 months.

LordEntrails
November 1st, 2018, 00:01
Stumbled across this looking for an easy way to copy large tables... ...

As for tables, their are 2 extensions that allow cut and paste of tables into FG. Note sure if that's what you are trying to do or not... One if for Tables and one is for text formatted as tables in a story entry.
https://www.fantasygrounds.com/forums/showthread.php?40812-5E-Table-Importer
https://www.fantasygrounds.com/forums/showthread.php?40821-CSV-Table-Paster-Community-Extension-Early-Access-release

ProNobis
November 1st, 2018, 16:34
Thanks, I had only found the first of those two. The second one will be helpful for some other things I will be doing.

Unfortunately I was looking for a way to copy past FG rich text (<table><tr><td><p><b><i><u></u></i></b></p></td></tr></table>) within FG. I can do this fluidly with the programs I noted above, and I'm very comfortable with the xml, it is just a pain to close out FG, load that program, make the changes, save, close that program, open FG, continue work.

Talyn
November 1st, 2018, 16:55
Unless you're editing the campaign db.xml (or an extension) there's no reason to exit FG to edit a normal module XML. Once you save the .xml file all you need to do is unload (if the module was already loaded) then reload that module in the Library.

ProNobis
November 1st, 2018, 17:22
Following best practices (https://www.fantasygrounds.com/forums/showthread.php?33538-Adventure-Module-Creation-Best-Practices) since I'm lead developer for 7 published (but free) modules, I run each in a separate "campaign" for editing, then export them before updating the published repository https://www.incarnategamingllc.com/download/.

Legal Disclaimer: I plan to continue to release all FG modules as free in accordance with the EULA here https://www.fantasygrounds.com/forums/faq.php?faq=fantasy_grounds_faq

Back to the point of this thread. I think that the only way to copy and paste formatted text is to do so in the underlying XML. The good news is that XML is one of the easiest computer "languages" to learn. I picked FG's version of it up by just working with it for a couple of months. It is a bit frustrating at the beginning, but if you are careful to make good backups then there is a LOT you can do with the XML that FG's Graphic User Interface cannot create, but it can execute. If you are serious about making modules (either commercially or non-commercially) I highly recommend that you learn XML.

LordEntrails
November 1st, 2018, 18:09
Editing the xml itself does have advantages, the only ways I know how to reload the xml is if you are editing the campaign data, a "/reload" in the chat window should reload it (along with the ruleset) and as Talyn said, for modules you should be able to unload and reload the module to get the xml re-read.

If one of those two methods don't work, let us know :)

Trenloe
November 1st, 2018, 18:21
... the only ways I know how to reload the xml is if you are editing the campaign data, a "/reload" in the chat window should reload it (along with the ruleset) ...
To clarify: this doesn't work for editing the campaign data (db.xml) - as \reload keeps the campaign data in memory (it doesn't reload it). Plus, you shouldn't be editing the campaign db.xml file directly while FG is running with that same campaign loaded - FG will overwrite your changes every 5 minutes and even if you keep it open in a text editor and save over the top, you're basically running without FG. The chances are you'll end up with lost/corrupted data.

/reload is primarily used when the ruleset (GUI XML and LUA code files) have been edited. The confusion can arise because FG uses XML for it's database and for it's GUI definition, and FG uses them differently.

ProNobis
November 1st, 2018, 18:32
Thank you for the clarification Trenloe. I had tried the /reload command several times and never noticed it doing anything. When I graduate to editing the GUI and rulesets I'll be sure to use it.