<commit_before>﻿global g_GlobalMenuItems := ""

GlobalMenu:
    AddToGlobalMenu("查看剪切板内容", "Clip")
    AddToGlobalMenu("窗口置顶", "AlwaysOnTop")
    ; AddToGlobalMenu("发送文件到记事本", "OpenWithNotepad", "Notepad++")

    WinGetClass, lastWindowClass, A

    for index, element in g_GlobalMenuItems
    {
        if (element[3] == "" || lastWindowClass == element[3])
        {
            Menu, GlobalMenu, Add, % element[1], % element[2]
        }
    }

    Menu, GlobalMenu, Show
    Menu, GlobalMenu, DeleteAll
return

AddToGlobalMenu(name, label, winClass := "")
{
    if (g_GlobalMenuItems == "")
    {
        g_GlobalMenuItems := Object()
    }

    g_GlobalMenuItems.Push([name, label, winClass])
}

OpenWithNotepad:
    WinGetTitle, title, A
    StringReplace, title, title, - Notepad++, , All

    Run, notepad "%title%"
return

AlwaysOnTop:
    WinSet, AlwaysOnTop, on, A
return
<commit_msg>全局菜单中添加 取消窗口置顶<commit_after>﻿global g_GlobalMenuItems := ""

GlobalMenu:
    AddToGlobalMenu("查看剪切板内容", "Clip")
    AddToGlobalMenu("窗口置顶", "AlwaysOnTop")
    AddToGlobalMenu("取消窗口置顶", "CancelAlwaysOnTop")
    ; AddToGlobalMenu("发送文件到记事本", "OpenWithNotepad", "Notepad++")

    WinGetClass, lastWindowClass, A

    for index, element in g_GlobalMenuItems
    {
        if (element[3] == "" || lastWindowClass == element[3])
        {
            Menu, GlobalMenu, Add, % element[1], % element[2]
        }
    }

    Menu, GlobalMenu, Show
    Menu, GlobalMenu, DeleteAll
return

AddToGlobalMenu(name, label, winClass := "")
{
    if (g_GlobalMenuItems == "")
    {
        g_GlobalMenuItems := Object()
    }

    g_GlobalMenuItems.Push([name, label, winClass])
}

OpenWithNotepad:
    WinGetTitle, title, A
    StringReplace, title, title, - Notepad++, , All

    Run, notepad "%title%"
return

AlwaysOnTop:
    WinSet, AlwaysOnTop, on, A
return

CancelAlwaysOnTop:
    WinSet, AlwaysOnTop, off, A
return

{'fraction_non_alphanumeric': 0.13203577064702787, 'fraction_numerical': 0.004208311415044713, 'mean_word_length': 3.3325740318906605, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4767915', 'n_tokens_mistral': 691, 'n_tokens_neox': 696, 'n_words': 135}