Skip to content

Commit

Permalink
v1.110 min/max for MenuWidth; Search; ClipChain preview; Notes removed
Browse files Browse the repository at this point in the history
  • Loading branch information
hi5 committed Feb 1, 2024
1 parent 6622505 commit a8d5293
Show file tree
Hide file tree
Showing 11 changed files with 161 additions and 218 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

### v1.110

* Fix: Add minimum (20) and maximum value (100) for MenuWidth setting (safety check) - https://github.com/hi5/CL3/issues/26
* Change: Search plugin, only search text after [ID] marker (also excludes possible timestamp)
* New: ClipChain preview of full item on mouseover
* Removed: Notes plugin/settings (commented code so easy to reactivate for those who need it)

### v1.109

* Fix: AutoReplace was still active when Clipboard History was Paused
Expand Down
56 changes: 28 additions & 28 deletions cl3.ahk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Script : CL3 ( = CLCL CLone ) - AutoHotkey 1.1+
Version : 1.109
Version : 1.110
Author : hi5
Purpose : CL3 started as a lightweight clone of the CLCL clipboard caching utility
which can be found at http://www.nakka.com/soft/clcl/index_eng.html.
Expand Down Expand Up @@ -42,7 +42,7 @@ SetWorkingDir, %A_ScriptDir%
AutoTrim, off
StringCaseSense, On
name:="CL3 "
version:="v1.109"
version:="v1.110"
CycleFormat:=0
Templates:={}
Global CyclePlugins,History,SettingsObj,Slots,ClipChainData ; CyclePlugins v1.72+, others v1.9.4 for API access
Expand Down Expand Up @@ -682,25 +682,25 @@ DispMenuText(TextIn,lines="1",time="")
TextOut:=RegExReplace(TextOut, "\s+", " ")
StringReplace, TextOut, TextOut, &, &, All
StringReplace, TextOut, TextOut, &, &&, All

If StrLen(TextOut) > MenuWidth
{
TextOut:=SubStr(TextOut,1,MenuWidth) " " Chr(8230) " " SubStr(RTrim(TextOut,".`n"),-10) ; 8230 ...
}
TextOut .= " " Chr(171)

If ShowLines
TextOut .= StrReplace(linetext,"\l",lines)
TextOut .= StrReplace(linetext,"\l",lines)

If ShowTime
{
disptime:=""
If TimeFormat and Time
{
FormatTime, disptime, %time%, %TimeFormatTime%
TextOut .= TimeFormatIndicator disptime
}
}
{
disptime:=""
If TimeFormat and Time
{
FormatTime, disptime, %time%, %TimeFormatTime%
TextOut .= TimeFormatIndicator disptime
}
}

Return LTRIM(TextOut," `t")
}
Expand All @@ -715,13 +715,13 @@ DispToolTipText(TextIn,Format=0,time=0)
If IsFunc(FormatFunc)
TextOut:=%FormatFunc%(TextOut)
If ShowTime
{
If TimeFormat and Time
{
FormatTime, disptime, %time%, %TimeFormatTime%
TextOut := Ltrim(TimeFormatIndicator) disptime "`n" TextOut
}
}
{
If TimeFormat and Time
{
FormatTime, disptime, %time%, %TimeFormatTime%
TextOut := Ltrim(TimeFormatIndicator) disptime "`n" TextOut
}
}
Return TextOut
}

Expand Down Expand Up @@ -830,7 +830,7 @@ TemplateMenuHandler:
If (A_ThisMenuItem = "&0. Open templates folder")
{

; try to get Commander_Path, it will be empty if TC is not running (yet)
; try to get Commander_Path, it will be empty if TC is not running (yet) or Cl3 was started before TC
EnvGet, Commander_Path, Commander_Path

If (Commander_Path = "") ; try to read registry
Expand All @@ -841,18 +841,18 @@ If (A_ThisMenuItem = "&0. Open templates folder")
WinGet TCPath, ProcessPath, ahk_exe %TCName%

If (TCPath = "") and (Commander_Path <> "")
TCPath:=Commander_Path "\TOTALCMD.EXE"
TCPath:=Commander_Path "\TOTALCMD.EXE"

If (TCPath = "") and (Commander_Path = "")
{
Run, %TemplateFolder%
Return
}
Try
{
If FileExist(TCPath)
Run, %TCPath% /O /T %TemplateFolder%
}
{
If FileExist(TCPath)
Run, %TCPath% /O /T %TemplateFolder%
}
Return

}
Expand All @@ -879,9 +879,9 @@ If (ClipText <> Clipboard)
else
IconExe:="res\" iconT
If History[MenuItemPos].HasKey("crc")
crc:=History[MenuItemPos,"crc"]
else
crc:=crc32(ClipText)
crc:=History[MenuItemPos,"crc"]
else
crc:=crc32(ClipText)
History.Insert(1,{"text":ClipText,"icon": IconExe,"lines": Count+1,"crc":crc,"time":A_Now})
}
OnClipboardChange("FuncOnClipboardChange", 0)
Expand Down
4 changes: 3 additions & 1 deletion docs/notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Notes
Note: Notes has been removed as of CL3 v1.110 (code is commented so easy to reinstate for those wanting to keep it)

# Notes

The Notes plugin must be enabled first and you can change the default hotkey `#n`
via the Setting menu (see Tray menu)
Expand Down
137 changes: 0 additions & 137 deletions lib/GetActiveBrowserURL.ahk

This file was deleted.

1 change: 0 additions & 1 deletion lib/cl3apiclass.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class CL3API
{
if (SlotID = 10)
SlotID:=0
MsgBox % SlotID
OnClipboardChange("FuncOnClipboardChange", 0)
Clipboard:=Slots[SlotID]
PasteIt()
Expand Down
23 changes: 13 additions & 10 deletions lib/settings.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ Settings()
IniRead, ShowMorehistory , %ini%, settings, ShowMorehistory, 1
IniRead, ShowExit , %ini%, settings, ShowExit , 1
IniRead, ActivateCmdr , %ini%, plugins , ActivateCmdr, 0
IniRead, ActivateNotes , %ini%, plugins , ActivateNotes, 0
;IniRead, ActivateNotes , %ini%, plugins , ActivateNotes, 0
If (Exclude = 0) or (Exclude = "Error")
Exclude:=""
StringLower, Exclude, Exclude

if MenuWidth not between 19 and 101
MenuWidth:=40

If (SettingsFolders = "") or (SettingsFolders = "ERROR") or (SettingsFolders = 0)
SettingsFolders:=""

Expand Down Expand Up @@ -81,7 +84,7 @@ Settings()

If !FileExist(ClipDataFolder)
FileCreateDir, %ClipDataFolder%
Loop, parse, % "History,ClipChain,AutoReplace,Slots,Notes", CSV
Loop, parse, % "History,ClipChain,AutoReplace,Slots,", CSV ; Notes
{
If !FileExist(ClipDataFolder A_LoopField)
FileCreateDir, %ClipDataFolder%%A_LoopField%
Expand Down Expand Up @@ -130,7 +133,7 @@ Settings_Default()
, hk_slot9 :">^9"
, hk_slot0 :">^0"
, hk_slotsmenu :""
, hk_notes :"#n"
;, hk_notes :"#n"
, hk_BypassAutoReplace :""
, hk_cmdr :"#j" }
Settings_Settings:={ MaxHistory :"150"
Expand Down Expand Up @@ -195,7 +198,7 @@ Settings_Hotkeys()
IniRead, hk_cycleforward , %ini%, Hotkeys, hk_cycleforward ,c
IniRead, hk_cycleplugins , %ini%, Hotkeys, hk_cycleplugins ,f
IniRead, hk_cyclecancel , %ini%, Hotkeys, hk_cyclecancel ,x
IniRead, hk_notes , %ini%, Hotkeys, hk_notes ,#n
;IniRead, hk_notes , %ini%, Hotkeys, hk_notes ,#n
IniRead, hk_cmdr , %ini%, Hotkeys, hk_cmdr ,#j
IniRead, hk_BypassAutoReplace, %ini%, Hotkeys, hk_BypassAutoReplace
If (hk_BypassAutoReplace = "ERROR")
Expand Down Expand Up @@ -282,15 +285,15 @@ Settings_Hotkeys()
If hk_cmdr
Try
Hotkey, %hk_cmdr% , hk_cmdr
If hk_notes
Try
Hotkey, %hk_notes% , hk_notes
; If hk_notes
; Try
; Hotkey, %hk_notes% , hk_notes
if !ActivateCmdr
Try
Hotkey, %hk_cmdr%, off
if !ActivateNotes
Try
Hotkey, %hk_notes%, off
; if !ActivateNotes
; Try
; Hotkey, %hk_notes%, off
}

Settings_menu:
Expand Down
Loading

0 comments on commit a8d5293

Please sign in to comment.