AkelPad Forum Index AkelPad
Support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Request: Anti-Overwrite Plugin

 
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Sun Jan 31, 2016 2:48 am    Post subject: Request: Anti-Overwrite Plugin Reply with quote

Hello,
I have been using a not-that-well-known editor by the name of "Smedit" (Sinner Computing) for about ten years.
Now I'd like to switch to Akelpad, but there's a function missing that I very much rely on with Smedit, namely the Ovr Sel (Overwrite Selection) function. This prevents deletion of selected text by any key, except for the Delete key. Even keys such as backspace and tab will not delete selected text. Since I select text very often and also scroll about in the document, there is always a chance of accidentally deleting text. Smedit makes sure this will not happen.
Is it possible to write such a plugin (it should be absolutely reliable and intefer in no way with the functioning of Akelpad other than the stated purpose), and would anyone be interested in writing it? Smile

Thanks a lot for your attention!
Back to top
View user's profile Send private message
VladSh



Joined: 29 Nov 2006
Posts: 3016
Location: Киев, Русь

PostPosted: Mon Feb 01, 2016 1:40 pm    Post subject: Reply with quote

AkelPad has the Read only mode - it's 4216 command. I have given the command to Ctrl+E.
Back to top
View user's profile Send private message Visit poster's website
FeyFre



Joined: 07 Aug 2007
Posts: 2176
Location: Vinnitsa, Ukraine

PostPosted: Mon Feb 01, 2016 1:59 pm    Post subject: Reply with quote

VladSh
Немного недопонял. Редактировать можно, НО если есть выделение, то единственное что можно делать - удалить его кнопкой Delete, остальные должны игнорироваться. Тут скрипт может справиться по моему.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
VladSh



Joined: 29 Nov 2006
Posts: 3016
Location: Киев, Русь

PostPosted: Mon Feb 01, 2016 3:41 pm    Post subject: Reply with quote

FeyFre
Просто представил альтернативу. Можно уже пользоваться, а можно ждать)
Back to top
View user's profile Send private message Visit poster's website
KDJ



Joined: 06 Mar 2010
Posts: 1877
Location: Poland

PostPosted: Mon Feb 01, 2016 3:43 pm    Post subject: Reply with quote

SaFeTyPe
Resident script: NoOverwriteSelection.js.
Back to top
View user's profile Send private message
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Wed Feb 03, 2016 12:16 am    Post subject: Reply with quote

KDJ, thank you so much! Really! I am so happy I found Akelpad and this wonderful forum! I have tested dozens of editors (ALL mentioned on Wikipedia's "List of editors"!) and Akelpad is the only one that met all my criteria. That's so great! Very Happy

PS. For some stupid reason I started testing the editors from Z to A, so I found Akelpad when I was totally desparate Very Happy
Back to top
View user's profile Send private message
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Wed Feb 03, 2016 12:16 am    Post subject: Reply with quote

(sry, pls del)

Last edited by SaFeTyPe on Wed Feb 03, 2016 12:19 am; edited 1 time in total
Back to top
View user's profile Send private message
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Wed Feb 03, 2016 12:16 am    Post subject: Reply with quote

(sry, pls del)

Last edited by SaFeTyPe on Wed Feb 03, 2016 12:19 am; edited 1 time in total
Back to top
View user's profile Send private message
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Wed Feb 03, 2016 3:19 am    Post subject: Reply with quote

Hello,

there is a small but important bug:
CTRL-X (cut) no longer works with the script running... Would it please be possible to fix this? Thank you!

Also, in a related matter, may I ask for an additional safety measure: Would it be possible to deactivate the "OVERWRITE/INSERT" key (!) function altogether (i.e. the key left of the DELETE key is "INSERT". if you press this key, the cursor goes into overwrite mode (cursor is "_" instead of "|"). --> My suggestion would be to prevent OVERWRITE mode in all situations.

Perhaps this could be part of the anti-overwrite plugin to avoid too many scripts;) ?

Thanks!
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2176
Location: Vinnitsa, Ukraine

PostPosted: Wed Feb 03, 2016 8:58 am    Post subject: Reply with quote

SaFeTyPe wrote:
CTRL-X (cut) no longer works with the script running... Would it please be possible to fix this? Thank you!

Feature per your request Smile
Quote:
except for the Delete key.
You can fix it yourself by deleting
Code:
(nCmd == 4153 /*IDM_EDIT_CUT*/) ||
in script you have received.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Wed Feb 03, 2016 3:50 pm    Post subject: Reply with quote

Thank you! Stupid me could have peeked into the script beforehand. Again: What a wonderful program!

FYI: Ctrl-X should be an exception since this is an intentional action that requires some deliberation (hitting a key combination). I.e. the likelihood of losing text by unintentionally hitting Ctrl-X whilst some text is selected, is very low.

Also the danger posed by the Insert mode key (=Overwrite mode key) is low since it will only delete one character at a time.

The highest remaining threat would be hitting Delete by mistake whilst some part of text is selected, and not noticing. This could be addressed by a dialogue "really delete selected text?", or by requiring Shift to be pressed together with Delete, if selected text should be deleted (in fact both of these can be done in combination, i.e. if shift is not pressed, a dialogue could aappear). Of course, simple deletion of 1 character should not trigger a dialogue.

Similarly, a dialogue "really enter overwrite mode", when pressing the insert/overwrite key, would be ideal.

HOWEVER: I have been working with Smedit (Sinner Computing) for 10 years with exactly the same handling as that of the script KDJ already provided. So Akelpad already does everything Smedit did, thanks to KDJ. My above ideas are just some "icing on the cake" in case someone is just as paranoid as I am and feels it would be cool to eliminate even the most unlikely of events and make Akelpad not 99.999% but 99.99999% data loss resistant Smile Wink This means, I am already super-happy with the current situation!
Back to top
View user's profile Send private message
FeyFre



Joined: 07 Aug 2007
Posts: 2176
Location: Vinnitsa, Ukraine

PostPosted: Wed Feb 03, 2016 7:22 pm    Post subject: Reply with quote

SaFeTyPe, well, for [s]prevention[/s] fixing really unintentional modification of text we have wonderful function of Undo/Redo. Does Smedit lack that function?
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Thu Feb 04, 2016 12:23 am    Post subject: Reply with quote

Hi!

Smedit has a detailed undo function. It does not go as far back as Akelpad though. But that's not the reason I am asking for those paranoid functions.

I often have many texts opened (not in tabs, but as separate instances on the windows task bar). For example 10 text files.

In some of the text files, some text might be selected (perhaps simply forgotten to de-select). The selected area might even be in a non-visible area of the text. I use Alt-Tab a lot. When quickly alt-tabbing, it can happen that by mistake a pure tab is sent to the text editor, deleting the selected area. This was just an example. It happened to me once. There are many other situations where selected text might get deleted by mistake, especially if one juggles with 10 text editors + 10 other programs, and if one does a LOT of selecting of text.

The point is: I am talking about deletion of text that goes UNNOTICED. Otherwise, of course, undo would solve the problem.

It is also for peace of mind. When I don't have the great function that KDJ made for me, I am always super-careful and this makes me nervous. Now I can relax, knowing that even when I'm tired and unconcentrated, I will not lose any text.

So that's the story behind the request. As I said, KDJ's script has already solved most of the "problem".

PS. could someone explain to me what AkelEdit is? I could not find information, but it was mentioned in the WordWrap settings.
Back to top
View user's profile Send private message
SaFeTyPe



Joined: 27 Jan 2016
Posts: 60
Location: Europe

PostPosted: Fri Feb 05, 2016 7:51 pm    Post subject: Reply with quote

Just info for newbies:
>>>
I found you can disable the INSERT key with the hotkey plugin, you need to set it to Command(0). I didn't expect the hotkey plugin to be able to handle INSERT. Great! Very Happy You can disable all dangerous hotkeys there:
for example:
esc
ctrl w
ctrl d
alt: r w d k l b u
alt: f5
f5 f6 f8 f9

Bonus tips:
- Don't forget to set ctrl-y to REDO! otherwise it will delete a line.
- Use Command(-1) instead of (0) to keep system-wide hotkeys active (I think).
<<<

<3 Akelpad <3
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AkelPad Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


SourceForge.net Logo Powered by phpBB © 2001, 2005 phpBB Group