Skip to content

Releases: nobk/NotepadEE

NotepadEE — 基于 Notepad4 的功能增强版 — An Enhanced Fork of Notepad4

Choose a tag to compare

@nobk nobk released this 06 Jul 03:40

概览

NotepadEE 在 Notepad4 的基础上增加了三大核心功能:

  1. 编辑器内联数学运算与扩展表达式引擎
  2. 即时求值(Just-In-Time / JIT) — 编辑、选中等操作时,数学表达式自动交互求值
  3. Unicode 16.0 全集的字数统计

✨ 新增功能

1. 内联数学运算

在编辑器正文中直接输入数学表达式,在等号后按 回车?,立即求值并填入结果。

支持的表达式类型:

类型 示例 结果
基础算术 5*5/5+5= → 回车 10
三角函数 sin(30*pi/180)= → 回车 0.5
幂运算 5**5= → 回车 3125
时间加减 1h30m15.019s+15m= → 回车 01h45m15.019s
冒号格式时间 01:30:00-15:00.079= → 回车 01:14:59.921
混合时间 15:00-1h30m= → 回车 -01h15m00s
时间转秒 toSec(1h-1m)= → 回车 3540
秒转时间 toTime(5415.5s)= → 回车 01h30m15.5s
toTime(32*24*60/2)= → 回车 06h24m00s
进制转换 num(x, 0x1f03d - 3 * 0xff)= → 回车 0x1ed40
进制符号 b 二进制、 o 八进制、 d 十进制、x 十六进制

技术实现:基于 tinyexpr++ 数学解析库,支持常见数学函数和运算符,详细语法见 tinyexpr++ PDF 文档。


2. 扩展表达式语法(命令行执行)

支持在编辑器内通过 Markdown 代码块语法执行任意命令行程序。

多行模式(支持管道输入):

```python3.exe
import re
def thousands(num):
    return re.sub(r'\B(?=(\d{3})+$)', r',', num.split('.')[0])

tests = ['1234567', '-1234567.8901', '42']
for t in tests:
    print(t, '→', thousands(t))
```=

1234567 → 1,234,567
-1234567.8901 → -1,234,567
42 → 42


```ruby
$stderr.puts "This is an error message"
puts "This goes to stdout"
```=

This goes to stdout

[Error num: 0]This is an error message


```node -
with(Math) {
  console.log(sin(PI/2))
}
```=

1

光标在代码块内部按 Shift+Enter 执行;光标在代码块尾部 = 号后面紧贴 = 号时按 回车? 执行。

单行模式(无管道输入):

```ping -n 1 8.8.8.8```=

内置特殊命令(以冒号开头):

命令 功能
:tts 管道输入文本进行 TTS 语音朗读(基于 Windows SAPI)
:runtest 运行单元测试并输出结果
:speedtest 基准测试:比较 JS 引擎与 tinyexpr++ 的数学求值性能

3. 即时求值(JIT)

状态栏新增了一个 求值 栏(位于 找到 栏右侧),可以交互式地随输入或选中即时计算数学表达式,无需按回车。

两种触发方式:

键盘模式 — 输入过程中,若最后一个字符是数字或右圆括号 ),则自动从当前光标位置向左提取到行首,跳过左侧非表达式字符后,作为 tinyexpr++ 表达式求值,结果即刻显示在状态栏求值栏中。单次耗时约 2 µs,未成功会缩减左边界重试,平均耗时约 5 µs。

敲入内容 → 状态栏显示
1+2+3(按 3 时) 求值 6
sin(pi/4)(按 ) 时) 求值 0.70710678
sqrt(5**2+12**2)(按 2 时) 求值 13

选中模式 — 选中任意文本后,将选中内容直接作为 tinyexpr++ 表达式求值(仅一次尝试,不缩减左边界重试)。支持单行和多行表达式。

选中以下多行表达式:

average(
   sin(pi/2),
   cos(0),
   ln(exp(1))
)

状态栏将显示:

求值 1

若选中文本不是合法的数学表达式,或键盘输入末尾不是数字或 ),求值栏显示 ---

双击求值栏可将计算结果数值复制到系统剪贴板(值为 --- 时无操作)。


🔧 配置

扩展表达式引擎支持通过 Notepad4.ini 配置文件进行细粒度控制,在 [Extend Expression] 节中设置:

配置项 默认值 说明
Enable 1 扩展表达式主功能开关(0=关闭,1=开启)。关闭后 =+回车、?、代码块 Shift+Enter 等所有扩展功能均不可用
JITEval 1 即时求值(键盘输入时状态栏自动显示表达式结果)开关(0=关闭,1=开启)
SelEval 1 选区求值(选中文本时状态栏自动计算表达式)开关(0=关闭,1=开启)
SignificantDigits 8 输出有效数字位数,取值范围 1~15,对应 G 格式精度。例如设为 4 时,pi=3.142(不含末尾零)

JITEval=0SelEval=0 时,状态栏完全隐藏求值栏,仅保留 =+回车、?、代码块 Shift+Enter 等手动求值功能。

配置文件示例:

[Extend Expression]
Enable=1
JITEval=1
SelEval=1
SignificantDigits=8

4. Unicode 16.0 全集字数统计

在编辑器中选中文本后,状态栏自动显示四类字符的统计结果:

类别 说明
中文 (中) 简体以及繁体中文字符
符号 (符) Unicode 标点符号 (Pc,Pd,Ps,Pe,Pi,Pf,Po) 及数学符号 (Sm)
文字 (字) 其他语言文字字符
空白 (空) Unicode 空白字符 (Zs,Zl,Zp) 及 C0/C1 控制字符 (Cc)

核心特性

  • 基于 Unicode 16.0 标准分类,完整覆盖所有码位
  • 异步多线程计算,对大文件采用 C++20 std::jthread 并行分块处理,配合缓存行对齐(cache-line aligned)的线程局部计数器,避免伪共享
  • 无文件大小限制,1GB 文本也能快速出结果
  • UTF-8 直接处理,无需转码,内存效率高
  • 支持取消:每次选中变更自动取消旧任务并启动新任务

启用方式

字数统计默认不启用,仅面向中文用户。在菜单 设置 → 外观 → 语言(Settings → Appearance → Language)中选择以下任一即可生效:

  • Chinese Simplified(简体中文)
  • Chinese Traditional(繁体中文)

无需下载中文语言资源文件,无需重启,即时生效。

当语言设为 "System Default" 且系统 UI 为中文时,也会自动启用。


📥 下载

Releases 页面下载最新构建。

安装包说明

本次发布将分发方式从原来的"架构 × 语言 × (HiDPI: 是/否)"多组合模式,调整为按架构提供 i18n 多语言安装包(共五个):

安装包 架构
NotepadEE_x86_i18n x86 (Win32)
NotepadEE_x64_i18n x64
NotepadEE_AVX2_i18n x64 (AVX2)
NotepadEE_AVX512_i18n x64 (AVX512)
NotepadEE_ARM64_i18n ARM64

每个安装包内置 全部支持的语言,安装后可在 设置 → 外观 → 语言 菜单中切换。

如需单语言版独立执行文件(如仅俄文的 notepad4.exe / metapath.exe),请解压 i18n 安装包后,在目录中运行:

mergelang.exe

该工具会自动合并语言资源,生成单语言版本的可执行文件。不支持在压缩包内直接运行,请先完全解压。


感谢 Notepad4 项目,以及 tinyexpr++CTRE 库的贡献者。

NotepadEE — An Enhanced Fork of Notepad4

Overview

NotepadEE builds on top of Notepad4 with three major new features:

  1. Inline Math Evaluation & Extended Expression Engine
  2. Just-In-Time (JIT) Evaluation — interactive math evaluation as you type or select
  3. Unicode 16.0 Full-Repertoire Character Count for Selection

✨ New Features

1. Inline Math Evaluation

Type a math expression directly in the editor, followed by =, then press Enter (or ?) — the result is computed and inserted right after the = sign.

Supported expression types:

Type Example Result
Basic arithmetic 5*5/5+5= → Enter 10
Trig functions sin(30*pi/180)= → Enter 0.5
Exponentiation 5**5= → Enter 3125
Time arithmetic 1h30m15.019s+15m= → Enter 01h45m15.019s
Colon-format time 01:30:00-15:00.079= → Enter 01:14:59.921
Mixed-format time 15:00-1h30m= → Enter -01h15m00s
Time to seconds toSec(1h-1m)= → Enter 3540
toTime(32*24*60/2)= → Enter 06h24m00s
Seconds to time toTime(5415.5s)= → Enter 01h30m15.5s
Base conversion num(x, 0x1f03d - 3 * 0xff)= → Enter 0x1ed40
b: binary, o: octal, d: decimal, x: hexadecimal

Under the hood: Powered by tinyexpr++, supporting common math functions and operators. See the tinyexpr++ PDF for the full syntax reference.


2. Extended Expression Syntax (Command Execution)

Run any external command from within the editor using a Markdown fenced-code-block syntax.

Multi-line mode (with piped input):

```python3.exe
import re
def thousands(num):
    return re.sub(r'\B(?=(\d{3})+$)', r',', num.split('.')[0])

tests = ['1234567', '-1234567.8901', '42']
for t in tests:
    print(t, '→', thousands(t))
```=

1234567 → 1,234,567
-1234567.8901 → -1,234,567
42 → 42


```ruby
$stderr.puts "This is an error message"
puts "This goes to stdout"
```=

This goes to stdout

[Error num: 0]This is an error message


```node -
with(Math) {
  console.log(sin(PI/2))
}
```=

1

Press Shift+Enter when the cursor is anywhere inside the fenced block, or press Enter (or ?) when the cursor is immediately after the trailing = of the fenced block.

Single-line mode (no piped input):

```ping -n 1 8.8.8.8```=

Built-in special commands (starting with a colon):

Command Description
:tts Text-to-speech via Windows SAPI for piped input
:runtest Run unit tests and output results
:speedtest Benchmark: compare JS engine vs tinyexpr++ math performance

3. Just-In-Time (JIT) Evaluation

The status bar now includes an Eval panel (to the right of the Find panel) that evaluates math expressions interactively as you type or select text — no need to press Enter.

Two modes:

Keyboard mode — While typing, if the last character is a digit or a closing parenthesis ), the text from the start of the current line up to the cursor is automatically extracted, trimmed of leading non-expression characters, and evaluated as a tinyexpr++ expression. The result appears instantly in the status bar Eval panel. Single evaluation takes ~2 µs. On failure, it retries with a reduced left boundary; average total time is ~5 µs.

Typing this in the editor → Status bar shows
1+2+3 (press 3) Eval 6
sin(pi/4) (press )) Eval 0.70710678
sqrt(5**2+12**2) (press 2) Eval 13

Selection mode — Select any text in the editor, and the selected content is passed to tinyexpr++ for evaluation (single attempt, no left-boundary retry). Both single-line and multi-line expressions work.

Select this multi-line expression:

average(
   sin(pi/2),
   cos(0),
   ln(exp(1))
)

The status bar then shows:

Eval 1

If the selected text is not a valid math expression, or the keyboard input does not end with a digit or ), the panel displays ---.

Double-click the Eval panel to copy the numeric result to the clipboard (no-op when the panel shows ---).


🔧 Configuration

The extended expression engine can be finely controlled via Notepad4.ini under the [Extend Expression] section:

Key Default Description
Enable 1 Master switch for all extended expression features (0=off, 1=on). When disabled, =+Enter, ?, and fenced code block Shift+Enter are all unavailable
JITEval 1 Just-in-time evaluation (status bar auto-displays result while typing) (0=off, 1=on)
SelEval 1 Selection evaluation (status bar auto-computes expression for selected text) (0=off, 1=on)
SignificantDigits 8 Number of significant digits in output, range 1~15, mapped to G format precision. E.g., with 4...
Read more

NotepadEE — 基于 Notepad4 的功能增强版

Choose a tag to compare

@nobk nobk released this 29 Jun 09:48

概览

NotepadEE 在 Notepad4 的基础上增加了两大核心功能:

  1. 编辑器内联数学运算与扩展表达式引擎
  2. Unicode 16.0 全集的字数统计

✨ 新增功能

1. 内联数学运算

在编辑器正文中直接输入数学表达式,在等号后按 回车?,立即求值并填入结果。

支持的表达式类型:

类型 示例 结果
基础算术 5*5/5+5= → 回车 10
三角函数 sin(30*pi/180)= → 回车 0.5
幂运算 5**5= → 回车 3125
时间加减 1h30m15.019s+15m= → 回车 01h45m15.019s
冒号格式时间 01:30:00-15:00.079= → 回车 01:14:59.921
混合时间 15:00-1h30m= → 回车 -01h15m00s
时间转秒 toSec(1h-1m)= → 回车 3540
秒转时间 toTime(5415.5s)= → 回车 01h30m15.5s
toTime(32*24*60/2)= → 回车 06h24m00s
进制转换 num(x, 0x1f03d - 3 * 0xff)= → 回车 0x1ed40
进制符号 b 二进制、 o 八进制、 d 十进制、x 十六进制

技术实现:基于 tinyexpr++ 数学解析库,支持常见数学函数和运算符,详细语法见 tinyexpr++ PDF 文档。


2. 扩展表达式语法(命令行执行)

支持在编辑器内通过 Markdown 代码块语法执行任意命令行程序。

多行模式(支持管道输入):

```python3.exe
import re
def thousands(num):
    return re.sub(r'\B(?=(\d{3})+$)', r',', num.split('.')[0])

tests = ['1234567', '-1234567.8901', '42']
for t in tests:
    print(t, '→', thousands(t))
```=

1234567 → 1,234,567
-1234567.8901 → -1,234,567
42 → 42


```ruby
$stderr.puts "This is an error message"
puts "This goes to stdout"
```=

This goes to stdout

[Error num: 0]This is an error message


```node -
with(Math) {
  console.log(sin(PI/2))
}
```=

1

光标在代码块内部按 Shift+Enter 执行;光标在代码块尾部 = 号后面紧贴 = 号时按 回车? 执行。

单行模式(无管道输入):

```ping -n 1 8.8.8.8```=

内置特殊命令(以冒号开头):

命令 功能
:tts 管道输入文本进行 TTS 语音朗读(基于 Windows SAPI)
:runtest 运行单元测试并输出结果
:speedtest 基准测试:比较 JS 引擎与 tinyexpr++ 的数学求值性能

3. Unicode 16.0 全集字数统计

在编辑器中选中文本后,状态栏自动显示四类字符的统计结果:

类别 说明
中文 (中) 简体以及繁体中文字符
符号 (符) Unicode 标点符号 (Pc,Pd,Ps,Pe,Pi,Pf,Po) 及数学符号 (Sm)
文字 (字) 其他语言文字字符
空白 (空) Unicode 空白字符 (Zs,Zl,Zp) 及 C0/C1 控制字符 (Cc)

核心特性

  • 基于 Unicode 16.0 标准分类,完整覆盖所有码位
  • 异步多线程计算,对大文件采用 C++20 std::jthread 并行分块处理,配合缓存行对齐(cache-line aligned)的线程局部计数器,避免伪共享
  • 无文件大小限制,1GB 文本也能快速出结果
  • UTF-8 直接处理,无需转码,内存效率高
  • 支持取消:每次选中变更自动取消旧任务并启动新任务

启用方式

字数统计默认不启用,仅面向中文用户。在菜单 设置 → 外观 → 语言(Settings → Appearance → Language)中选择以下任一即可生效:

  • Chinese Simplified(简体中文)
  • Chinese Traditional(繁体中文)

无需下载中文语言资源文件,无需重启,即时生效。

当语言设为 "System Default" 且系统 UI 为中文时,也会自动启用。


📥 下载

Releases 页面下载最新构建。

安装包说明

本次发布将分发方式从原来的"架构 × 语言 × (HiDPI: 是/否)"多组合模式,调整为按架构提供 i18n 多语言安装包(共五个):

安装包 架构
NotepadEE_x86_i18n x86 (Win32)
NotepadEE_x64_i18n x64
NotepadEE_AVX2_i18n x64 (AVX2)
NotepadEE_AVX512_i18n x64 (AVX512)
NotepadEE_ARM64_i18n ARM64

每个安装包内置 全部支持的语言,安装后可在 设置 → 外观 → 语言 菜单中切换。

如需单语言版独立执行文件(如仅俄文的 notepad4.exe / metapath.exe),请解压 i18n 安装包后,在目录中运行:

mergelang.exe

该工具会自动合并语言资源,生成单语言版本的可执行文件。不支持在压缩包内直接运行,请先完全解压。


感谢 Notepad4 项目,以及 tinyexpr++CTRE 库的贡献者。

NotepadEE — An Enhanced Fork of Notepad4

Overview

NotepadEE builds on top of Notepad4 with two major new features:

  1. Inline Math Evaluation & Extended Expression Engine
  2. Unicode 16.0 Full-Repertoire Character Count for Selection

✨ New Features

1. Inline Math Evaluation

Type a math expression directly in the editor, followed by =, then press Enter (or ?) — the result is computed and inserted right after the = sign.

Supported expression types:

Type Example Result
Basic arithmetic 5*5/5+5= → Enter 10
Trig functions sin(30*pi/180)= → Enter 0.5
Exponentiation 5**5= → Enter 3125
Time arithmetic 1h30m15.019s+15m= → Enter 01h45m15.019s
Colon-format time 01:30:00-15:00.079= → Enter 01:14:59.921
Mixed-format time 15:00-1h30m= → Enter -01h15m00s
Time to seconds toSec(1h-1m)= → Enter 3540
toTime(32*24*60/2)= → Enter 06h24m00s
Seconds to time toTime(5415.5s)= → Enter 01h30m15.5s
Base conversion num(x, 0x1f03d - 3 * 0xff)= → Enter 0x1ed40
b: binary, o: octal, d: decimal, x: hexadecimal

Under the hood: Powered by tinyexpr++, supporting common math functions and operators. See the tinyexpr++ PDF for the full syntax reference.


2. Extended Expression Syntax (Command Execution)

Run any external command from within the editor using a Markdown fenced-code-block syntax.

Multi-line mode (with piped input):

```python3.exe
import re
def thousands(num):
    return re.sub(r'\B(?=(\d{3})+$)', r',', num.split('.')[0])

tests = ['1234567', '-1234567.8901', '42']
for t in tests:
    print(t, '→', thousands(t))
```=

1234567 → 1,234,567
-1234567.8901 → -1,234,567
42 → 42


```ruby
$stderr.puts "This is an error message"
puts "This goes to stdout"
```=

This goes to stdout

[Error num: 0]This is an error message


```node -
with(Math) {
  console.log(sin(PI/2))
}
```=

1

Press Shift+Enter when the cursor is anywhere inside the fenced block, or press Enter (or ?) when the cursor is immediately after the trailing = of the fenced block.

Single-line mode (no piped input):

```ping -n 1 8.8.8.8```=

Built-in special commands (starting with a colon):

Command Description
:tts Text-to-speech via Windows SAPI for piped input
:runtest Run unit tests and output results
:speedtest Benchmark: compare JS engine vs tinyexpr++ math performance

3. Unicode 16.0 Full-Repertoire Character Count

When text is selected, the status bar automatically shows counts for four character categories:

Category Description
Chinese (C) CJK unified ideographs and related characters
Punctuation (P) Unicode punctuation (Pc,Pd,Ps,Pe,Pi,Pf,Po) and math symbols (Sm)
Other (O) All other text characters not counted above
Space (S) Unicode whitespace (Zs,Zl,Zp) and C0/C1 control characters (Cc)

Key features:

  • Based on the Unicode 16.0 standard — covers the full codepoint range
  • Async multi-threaded processing: large files are split across C++20 std::jthread workers with cache-line-aligned thread-local counters to avoid false sharing
  • No file size limit: handles 1 GB+ text files quickly
  • Direct UTF-8 processing: no transcoding needed, memory-efficient
  • Cancellable: each new selection automatically cancels the previous task

How to enable:

The character count feature is disabled by default — it is designed for Chinese-language users. To enable it, go to Settings → Appearance → Language in the menu and select either:

  • Chinese Simplified
  • Chinese Traditional

No Chinese resource files are needed, and no restart is required — it takes effect immediately.

If the language is set to "System Default" and the system UI language is Chinese, it will also be enabled automatically.


📥 Download

Download the latest build from the Releases page.

Distribution changes:

Previously, builds were distributed as per-architecture × per-language × (HiDPI: yes/no) combinations. This release consolidates to a single i18n multi-language installer per architecture (five total):

Package Architecture
NotepadEE_x86_i18n x86 (Win32)
NotepadEE_x64_i18n x64
NotepadEE_AVX2_i18n x64 (AVX2)
NotepadEE_AVX512_i18n x64 (AVX512)
NotepadEE_ARM64_i18n ARM64

Each installer includes all supported languages, switchable at runtime via Settings → Appearance → Language.

If you need a single-language standalone executable (e.g., Russian-only notepad4.exe / metapath.exe), extract the i18n installer, then run:

mergelang.exe

This tool merges the language resources into single-language executables. Running directly from within the archive is not supported — please fully extract first.


Acknowledgments

Thanks to the Notepad4 project, as well as the contributors of tinyexpr++ and CTRE.