Transformation > Straight Quotes to Smart Quotes disregarding highlighted text, applies to whole project

Hey there!

Just another post describing an issue where I noticed something not working quite as intended. I use Scrivener 3 for Windows on the latest update.

With your newest update applied (Version: 3.1.2.0 (1812589) 64-bit - 18 Oct 2022), I went to convert some copied text’s quotes to smart quotes. Now, I did take the time to read through your changelog when it updated. The log mentions, “The menu commands in Edit ▸ Transformations ▸ to convert straight quotes to smart quotes and the reverse now apply to all documents loaded in a Scrivenings session when no text is selected.”

It’s that “when no text is selected” part that I’m having issues with. I selected the text with the straight quotes, went up to Edit > Transformations, and selected the conversion to smart quotes. The problem, as it says on the tin (and the title above), is that it didn’t seem to care that I selected some text. It went ahead and applied smart quotes to every single document in my project throughout the manuscript.

I tested this a few ways, to make sure I wasn’t just… not doing something or doing something wrong. But in an entirely different folder in the manuscript, a file had text that read as such:

“’bout an hour and a half.”

and another line in another file that read:

“‘Brother?’”

These are the proper direction of the smart quotes; one is a contraction based apostrophe that is foreshortening the word “about” and the other is a quoted phrase… both inside dialogue double-quotes.
However, after selecting text and using the transformation, the file with the “Brother” line (which wasn’t even the file/folder I was typing in at the time) was likewise transformed to appear as such:

“’Brother?’”

I know, it doesn’t seem like a huge deal… but I try to be as grammatically correct as possible with my punctuation. And granted, I know there’s next to no editor that will actually pick up on the distinction of what I’m doing… so I do often find myself manually changing that “’ to a “‘ in scenarios where I’m having a person quote something inside dialogue.

But if the Transformation is going to ignore my selected text and simply transform everything regardless… well, I don’t think that was the intent of the change/refinement. The problem then becomes that it makes me go through my entire document, searching for "’ and to fix all the ones that I’d purposefully turned around.

For reference, I usually do the manual change by entering a space between the " and the text, then placing the ’ next to the text (which places the ’ facing the correct direction), then deleting the space.

I do like the idea of just… blanket applying the smart quotes to an entire project. It saves me from going to each individual scene-file in my chapter-folders and repeating the transformation process. But since it’s not adhering to your “when no text is selected” (which implies it should only change selected text if text is selected)… it makes it about the same amount of work as not using it at all.

Is this a bug or some form of setting that’s disregarding the “only affect highlighted/selected text”? It it’s the former, I can wait for a patch and simply hold off on using the transformations unless I’m sure I want it to apply to my entire project no matter what’s selected. If it’s the latter, I have no problems tweaking some settings.

Please let me know!

Thanks!

What you’re describing is definitely a bug. The behaviour seems to be correct when viewing a single document in the editor, but in a Scrivenings session with a text selection, the change is applying to only the selected text in that document but then also to all the other documents loaded in the session, which it should not be doing. It also shouldn’t be applying the transformation to smart quotes to quotes that are already smart, but that’s a separate issue as far as the text selection bug goes.

What I’m not seeing is any case where the transformation applies to documents that weren’t even loaded in the editor. That shouldn’t be happening at all–the command is one that is run on the text in the editor, so while it’s possible to do a bulk transformation by loading a large Scrivenings session and applying the command with no text selection, it shouldn’t affect text in other documents. On rereading though, maybe I’ve just misunderstood your comment—did you have the whole manuscript loaded in Scrivenings when you ran the command?

Yeah, I probably worded that a little poorly. Short answer: yes, I had the whole Manuscript loaded into the editor.

In full, in a single .SCRIV file, I have my Manuscript set up as a multi-chapter story. These appear on the left side in my Binder. My editor is in the center, focused on the text–upon inspecting how I had it opened… I was looking at the entire document by loading the entire Manuscript (thus viewing multiple chapters and scenes simultaneously). I often do this when I want to be able to reference things throughout a story or if I’m proofreading for continuity purposes to make sure everything flows naturally between one chapter and the next. So can see that, having essentially the entire story loaded in the editor, that using the Transformation without selection would apply to the whole story.

I’m going to isolate a chapter and try that now just to verify.

Yes, in testing, if I only have a single Scene isolated in the Binder, and so only showing that Scene in the Editor (so not on Chapter level or on Manuscript level), it only applies the transformation to that particular Scene.

Here’s the odd part!

Next, I tested if–in that same, isolated, single-scene selected–if multiple straight quotes (I copy-pasted a line with a straight-quote multiple times)… and I highlight/select a single line and use the transformation… it works as intended, and the other lines keep their straight quotes.

The best I can figure is that this is some form of overflow error if the entire Manuscript is loaded into the editor? Maybe it can’t count that much text and stops checking entirely whether or not text is selected?

The story, which is in progress, is only ~37K words, but I know that there is a limit to the amount of text a spell-checker will check in a single editor session before it conks out and stops checking (even gives a tool-tip saying that it will no longer display error-underlines). Perhaps this is similar?

Thanks for the clarification; that matches what I was able to reproduce, so I’ve got this written up for fixing. The problem I think is more to do with the way a Scrivenings session consists of multiple individual documents and how those are being treated discretely by the Qt framework Scrivener uses—so that when applying the transformation command to the whole session, the text selection is observed only in the single document wherein it occurs, and the other documents are all treated as having no text selection (thus the command applies to the whole text of that document), whereas what we want to have happen is that if there is a text selection anywhere in the session, only that text is altered, as though the entire session were a single document.

That makes a lot of sense!

I was discussing this on Discord with a friend while waiting on a reply and I was spouting off theories as I went. (I’m IT, so I tend to sit and troubleshoot random things when I find glitches or bugs in anything–try to understand the cause and such based on what I can test.)

I had thought that it was taking the single, active document in the file and checking for its selection… but, by the simple impossibility of not being able to have more than one active document (even with split-screen, one of them is active)… you can’t really select something outside of that document. So if other documents are open (as they are in manuscript mode), then they obviously don’t have anything selected… and thus… when the transformation is run… it sees no selection in those likewise open documents and considers them free game to transform.

Although, weirdly, there are sometimes when I’m scrolling through the manuscript and I’ll find something still selected–a line of text, a word, something–that I’d highlighted during a search or for copy-paste reasons… and moving to another document doesn’t deselect it. Even if I do deselect the text… and even type in that document, or switch documents and type there… sometimes I save my work and open the file another day… … and the text is selected again. I get it, but it’s still weird.

So, sometimes, I’ll be proof-reading my story and see some random thing selected in a random scene of my story. Heh. And it’s also possible to be in one document with the entire manuscript loaded in the editor and search the whole story for some text (sometimes I forget where a key bit of dialogue I’m wanting to reference or exactly what I said).

I figured… if those things are possible, then it’s entirely likely that the transform function, which is basically a very specifically filtered find-and-replace(?), would work the same way.

Thanks for clarifying!

At least for now, I have something of a work-around until it’s patched: simply don’t do the transform at manuscript level (unless that’s what I really, really want); switch to either a folder and sub-documents or a single document to prevent over-zealous replacement.

Thanks for looking into this. Scrivener has been such a boon for my writing that I can’t even really compare to how my writing went previously. So I sincerely also thank you and the whole L&L team for bringing us such wonderful tools!