Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 04-18-2024, 05:59 PM   #1
lomkiri
Zealot
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 148
Karma: 1451628
Join Date: Jul 2021
Device: N/A
[Feature req] Regex-function editor : Confirmation before exit

TL;DR :
Would it be possible to add a warning when exiting the regex-function editor (on "esc" key) when the state of the editor is "dirty" ?

This dialog could have a checkbox "Ask next time" so if it perturbs someone, it's easy to get rid of it.

Tip : I use vim so it became a reflex for me to use "esc" before any operation.

=========
Why I' asking this :

Regex-function is a powerful recourse. I use it a lot. I'm even working on a plugin (together with a friend) that uses them quite a few (to be published in some months).

When the code of the function is not trivial, I write it in vim, then I copy it in the function-editor of calibre. When I modify it in the function-editor to correct typos or bugs, I often use, by mistake, "esc", that in vim restores the "normal-mode". But, in calibre, ... it exits the modified function without warning and without saving, so I loose all the modifications (sometime extensive).

TIA
lomkiri is offline   Reply With Quote
Old 04-18-2024, 10:41 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,539
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...9d158e5e86a996
kovidgoyal is offline   Reply With Quote
Old 04-19-2024, 07:03 AM   #3
lomkiri
Zealot
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 148
Karma: 1451628
Join Date: Jul 2021
Device: N/A
Thousand thanks, Kovid, very kind of you!
lomkiri is offline   Reply With Quote
Old 04-19-2024, 08:39 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,539
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I am a vim user mysef, so I sympathize
kovidgoyal is offline   Reply With Quote
Old 04-19-2024, 09:50 AM   #5
lomkiri
Zealot
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 148
Karma: 1451628
Join Date: Jul 2021
Device: N/A
Yes, I've noticed it by the shebang line in your code: I have guessed you would be sensible to my explanation. ;-)

Vim is a fantastic editor, but it gives some strange reflexes, e.g. putting some "i", "o" or "u" everywhere, when one is typing in a conventional soft ;-)
lomkiri is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex in Regex function mode lindlind Editor 5 03-22-2024 04:41 AM
Regex-function to merge endnotes files in editor EbookMakers Editor 11 11-27-2020 10:35 AM
Predefined regex for Regex-function sherman Editor 3 01-19-2020 06:32 AM
Req for devs: assign another function to goodreads button. Barty Kindle Developer's Corner 5 01-22-2014 10:53 PM
Feature Req: List Missing Formats edbro Calibre 2 04-04-2009 11:24 AM


All times are GMT -4. The time now is 09:18 PM.


MobileRead.com is a privately owned, operated and funded community.