scintilla
在将 Scintilla.dll 5.6.4 集成到 Windows 编辑器、调用其消息 API、配置语法样式和通知、使用 Lexilla 或构建该 DLL 时使用。
- License 许可
- MIT
- 所属仓库
- luestr/skills
- 最近更新
- 2026-11-14
- Stars
- ★ 94
- Forks
- 1
01 前言 Front Matter
- name
- scintilla
- metadata
- { "version": "5.6.4", "language": "zh-CN" }
- description
- 在将 Scintilla.dll 5.6.4 集成到 Windows 编辑器、调用其消息 API、配置语法样式和通知、使用 Lexilla 或构建该 DLL 时使用。
02 资源文件 22
- 参考文档references/api-catalog.md7.8 KB
- 参考文档references/api.md2.3 KB
- 参考文档references/autocomplete-calltips.md700 B
- 参考文档references/building.md1.7 KB
- 参考文档references/compatibility-catalog.md1.3 KB
- 参考文档references/editor-features.md1.8 KB
- 参考文档references/gtk.md1.2 KB
- 参考文档references/images.md1.4 KB
- 参考文档references/indicators-annotations.md769 B
- 参考文档references/input-output-platform.md757 B
- 参考文档references/lexer-objects.md1.4 KB
- 参考文档references/margins-markers-folding.md654 B
- 参考文档references/messages-reference.md2.2 KB
- 参考文档references/multiple-views-direct-access.md785 B
- 参考文档references/notification-catalog.md2.2 KB
- 参考文档references/overview.md1.4 KB
- 参考文档references/platform-apis.md1.3 KB
- 参考文档references/precision-audit.md1.5 KB
- 参考文档references/search-replace.md1.0 KB
- 参考文档references/styling-lexers.md931 B
- 参考文档references/version-migration.md1.0 KB
- 参考文档references/windows-build.md1.7 KB
03 SKILL.md 正文
Scintilla.dll v5.6.4
这是一个面向 Windows 编辑器集成的索引技能。Scintilla 是带完整源码和宽松许可证的源代码编辑控件;Windows 端主要通过窗口消息通信。先确认 DLL、头文件和宿主程序来自同一版本,再按主题阅读具体参考。
快速索引
- 概览与集成边界:组件职责、版本、平台、Lexilla、生命周期。
- 消息 API 与数据约定:
SCI_*、SCN_*、位置/长度、指针和缓冲区规则。 - 编辑器功能配方:文本、选择、撤销、样式、折叠、补全、标记和通知。
- Windows 构建与诊断:C++17、动态/静态链接、类注册、构建宏和排错。
- 完整消息参考导航:官方
SCI_*/SCN_*分组、参数合同和通知规则。 - API 主题目录:按官方 Contents 逐项覆盖消息主题、功能边界和版本核对入口。
- SCN_* 通知目录:通知字段、生命周期和 reentrancy 规则。
- Lexer、Lexer Objects 与 Lexilla:普通 lexer library、
ILexer5和CreateLexer。 - 平台 API 与输入输出细节:Windows、GTK、Cocoa、Qt、编码、行尾、RTL 和图片。
- Deprecated、Never-supported 与 Removed API:兼容、弃用、未支持和移除功能。
- Images 图像 API:RGBA、XPM、图像注册、尺寸、alpha 和生命周期。
- GTK API:widget、message、ID、资源释放和线程边界。
- Building Scintilla 构建矩阵:Windows、GTK、Cocoa、Qt、regex 和构建宏。
- 官方章节精确核对清单:官方锚点、5.6.4 headers、平台条件和不确定性标记。
- 查找、替换与正则:target、flags、regex、增量搜索和结果高亮。
- Styling 与 Lexilla:style、lexer、properties、keywords 和 Lexilla 边界。
- Indicators、Annotations 与可视反馈:范围诊断、行注释和 marker 反馈。
- Margins、Markers 与 Folding:行号、折叠、调试器标记和 fold levels。
- Autocompletion、User Lists 与 Call Tips:补全、用户列表、签名提示和通知生命周期。
- Multiple Views、Document Interface 与 Direct Access:共享 document、视图状态和后台 IO。
- 输入输出、平台与可访问性:编码、换行、剪贴板、拖放、打印、RTL、DPI 和平台后端。
- 版本、迁移与兼容性:5.6.4 变更、Lexilla 迁移、provisional 和 deprecated API。
使用规则
- 以官方文档为准,不凭旧版 RichEdit 或第三方 wrapper 的习惯猜测参数。
- 所有未使用的
wParam/lParam传0;指针参数必须确认生命周期、编码和缓冲区大小。 - 文档以 byte 为单位描述位置和长度;不要把 UTF-8 code point 数量当作 Scintilla position。
- Scintilla 5 已将 lexer 移至 Lexilla;需要语法分析时同时检查 Lexilla 的部署和版本。
- 将
SCN_MODIFIED、SCN_SAVEPOINTREACHED、SCN_SAVEPOINTLEFT等通知接入宿主状态管理,并在保存后调用SCI_SETSAVEPOINT。
官方来源
- 主页:https://www.scintilla.org/
- API 文档:https://www.scintilla.org/ScintillaDoc.html
- 下载:https://www.scintilla.org/ScintillaDownload.html
- Lexilla:https://www.scintilla.org/Lexilla.html
交付前检查
- DLL、import library、headers 的版本均为 5.6.4。
- Windows 控件已注册,宿主窗口可创建并能收发消息。
- 文本读写覆盖空指针探测长度、NUL 结尾和非 NUL 结尾两类返回规则。
- 只使用稳定 API,或明确启用并接受 provisional/deprecated API 的兼容风险。
- 已在目标架构上验证 UTF-8、换行、撤销、只读和通知行为。
04 同仓库更多 Skills
write-ublock-origin-filters
完整的 uBlock Origin (uBO) 静态过滤语法参考。编写 uBlock Origin 自定义过滤规则时使用此技能,涵盖广告拦截、隐私保护或内容过滤。包含基础网络过滤模式(||、*、^、|)、所有网络过滤选项($domain、$third-party、$important、$redirect、$removeparam、$csp、$replace、$header、$method、$denyallow、$badfilter、$all 等)、内容类型选项($script、$image、$stylesheet、$font、$media、$xhr、$popup、$document、$frame 等)、元素隐藏规则(## 选择器、实体匹配、主机名正则)、过程式元素隐藏过滤器(:has、:has-text、:matches-css、:upward、:xpath、:matches-path、:watch-attr 等)、动作操作符(:remove、:style、:remove-attr、:remove-class)、HTML 过滤器(##^)、响应头过滤(##^responseheader)、脚本注入(##+js())以及预处理指令(!#include、!#if)。当用户提到 uBlock Origin 过滤规则、uBO 语法、广告拦截规则、元素隐藏规则、过程式选择器、脚本注入或希望编写/调试任何 uBO 兼容过滤列表时触发。即使用户只是在编写或调试 uBlock Origin 过滤规则、创建自定义过滤列表或从 AdBlock Plus/AdGuard 迁移过滤规则到 uBO,也应使用此技能。
write-ublock-origin-filters
Complete uBlock Origin (uBO) static filter reference. Use this skill when writing or debugging uBO custom filters or filter lists for ad blocking, privacy or content filtering, or when migrating filters from AdBlock Plus/AdGuard. Covers network patterns (||, *, ^, |) and options ($domain, $third-party, $important, $redirect, $removeparam, $csp, $replace, $header, $method, $badfilter, $all), content-type options ($script, $image, $stylesheet, $font, $media, $xhr, $popup, $document, $frame), cosmetic filters (##, CSS selectors, entity matching), procedural filters (:has, :has-text, :matches-css, :upward, :xpath, :matches-path, :watch-attr), action operators (:remove, :style, :remove-attr), HTML filters (##^), response-header filtering (##^responseheader), scriptlet injection (##+js()), and pre-parsing directives (!#include, !#if). Trigger whenever the user mentions uBO syntax, ad blocking rules, element hiding, procedural selectors, scriptlet injection, or a uBO-compatible filter list.
write-tampermonkey-scripts
引导 AI 代理规划、编写、调试、测试和维护 Tampermonkey 用户脚本。当用户请求用户脚本、浏览器页面自动化、DOM 增强、Tampermonkey 元数据、GM_* API、@match、@grant、@run-at、@connect、跨源请求、SPA 页面集成或脚本注入任务时使用此技能,即使用户没有明确提及 Tampermonkey。
write-tampermonkey-scripts
Guide an AI agent through planning, writing, debugging, testing, and maintaining Tampermonkey userscripts. Use this skill whenever a user asks for a userscript, browser-page automation, DOM enhancement, Tampermonkey metadata, GM_* API, @match, @grant, @run-at, @connect, cross-origin request, SPA page integration, or script injection task, even when Tampermonkey is not named explicitly.
write-adguard-filters
编写 AdGuard 自定义过滤规则时使用此技能。涵盖基本规则语法、所有修饰符($domain/$third-party/$important/$redirect/$replace/$removeparam/$cookie/$csp 等)、外观规则(元素隐藏/CSS/Extended CSS 选择器)、HTML 过滤、JavaScript/脚本片段规则、非基本规则修饰符、预处理器指令和调试技巧。当用户提及 AdGuard 过滤规则、广告拦截规则语法、过滤器列表编写、ABP 语法兼容、元素隐藏规则、Extended CSS 选择器(:has/:contains/:matches-css 等)时触发。即使用户只是在编写或调试任何类型的广告过滤规则,也应使用此技能。
write-adguard-filters
Complete AdGuard filtering rules syntax reference. Use this skill when writing AdGuard custom filters. Covers basic rule syntax, all modifiers ($domain/$third-party/$important/$redirect/$replace/$removeparam/$cookie/$csp etc.), cosmetic rules (element hiding/CSS/Extended CSS selectors), HTML filtering, JavaScript/scriptlet rules, non-basic rule modifiers, preprocessor directives, and debugging. Trigger when user mentions AdGuard filtering rules, ad blocking rule syntax, filter list authoring, ABP syntax compatibility, element hiding rules, Extended CSS selectors (:has/:contains/:matches-css etc.). Use this skill even when the user is just writing or debugging any type of ad filtering rules.