To be clear, I’ll state the essential problem: my habit of closing files using the ⌘W command has made me lose many pages in which I had written useful texts for evaluating the font I’m designing.
Using Glyphs I often find myself having many windows (pages) where I normally insert texts to verify the extreme beauty or (more often) the transcendental horror of some letters coupled together and in these windows (pages) I also write many words, sentences, entire poems, the first chapter of the Iliad, the preface to War and Peace: all lost forever as soon as I use the ⌘W shortcut.
To avoid misunderstandings I must distinguish the closing of the file from the closing of the “text windows” so I will call these windows PAGES because they are actually pages where you can test the font and where you can modify it by going into the detail of the single glyph.
I installed the plugin Close Window by @FlorianPircher sure to solve the problem but I immediately noticed that if I use the keyboard equivalent that I specifically set for Close Window (⌘W) the file closes without asking to save (losing any changes made to the font! but if I close it with the mouse the dialog box appears). My hope was to be able to assign the ⌘⇧W keyboard shortcut through the plugin to close the PAGES and thus avoid their accidental closing (given my habit of closing files with the ⌘W shortcut).
If we considered these windows as pages, perhaps we could get to the bottom of the problem? I destroy a page but I can still undo the destruction with the ⌘Z shortcut?
Or rather: the ⌘W shortcut is used only to close the file, like in any other app. If I want to close a PAGE I can only do it with the mouse.
For now I have found a solution to the problem by deleting the plugin and replacing the keyboard shortcut ⌘W with ⌘⌥⇧⌃< (it takes a long training to learn to contort your fingers like that). Now I really have to want to close the file with my hands on the red button and now if I try with ⌘W I get a gentle congas sound and nothing else…