ProgerXP / Notepad2e

Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Other
375 stars 52 forks source link

Convert Paste Board into a dynamic option and add Cut Board #371

Open ProgerXP opened 3 years ago

ProgerXP commented 3 years ago

Currently, Paste Board mode is enabled only on startup via /B. However, it's often convenient to turn it on and off as one goes, including when editing a file (not an Untitled document). According to a brief code check, making it dynamic should be easy except for the fact it affects the window class (B appended). Any idea why this is useful or necessary?

When Cut Board is enabled, Notepad 2e acts as an on-demand clipboard data provider (similarly to MS Office apps when you copy a big chunk of data). Window title receives (Cut Board). When OS is asking for clipboard data, Notepad 2e pulls the first paragraph (Ctrl+]) in the document (provides it as the data on clipboard and removes it from the document). When clipboard changes (because user cuts/copies something), Cut Board is automatically disabled. Thus Paste Board puts paragraphs to the end, Cut Board - to the beginning.

Functionally, add a new toolbar button: Board Mode, after Paste by default. On click show a dropdown menu with 3 radio options (default - No&rmal, P&aste Board, &Cut Board). The menu is shown on mousedown so that mouseup may trigger a command without another click. In all but Normal modes the button is in the pressed state. Depending on the active mode, the button has its own icon (3). Remove Exit button from the default toolbar since it's getting large. Keep /B switch (simply enables Paste Board mode on startup).