You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

684 regels
16 KiB

8 jaren geleden
8 jaren geleden
8 jaren geleden
8 jaren geleden
  1. # Changes in version 0.7.1
  2. - Remove out-of-date information from the 0.7.0 changelog.
  3. # Changes in version 0.7.0
  4. This is a stable bugfix and feature release. Major new features and changes include:
  5. - Add `ZSH_HIGHLIGHT_DIRS_BLACKLIST` to disable "path" and "path prefix"
  6. highlighting for specific directories
  7. [#379]
  8. - Add the "regexp" highlighter, modelled after the pattern highlighter
  9. [4e6f60063f1c]
  10. - When a word uses globbing, only the globbing metacharacters will be highlighted as globbing:
  11. in `: foo*bar`, only the `*` will be blue.
  12. [e48af357532c]
  13. - Highlight pasted quotes (e.g., `: foo"bar"`)
  14. [dc1b2f6fa4bb]
  15. - Highlight command substitutions (`` : `ls` ``, `: $(ls)`)
  16. [c0e64fe13178 and parents, e86f75a840e7, et al]
  17. - Highlight process substitutions (`: >(nl)`, `: <(pwd)`, `: =(git diff)`)
  18. [c0e64fe13178 and parents, e86f75a840e7, et al]
  19. - Highlight command substitutions inside double quotes (``: "`foo`"``)
  20. [f16e858f0c83]
  21. - Highlight many precommands (e.g., `nice`, `stdbuf`, `eatmydata`;
  22. see `$precommand_options` in the source)
  23. - Highlight numeric globs (e.g., `echo /lib<->`)
  24. - Assorted improvement to aliases highlighting
  25. (e.g.,
  26. `alias sudo_u='sudo -u'; sudo_u jrandom ls`,
  27. `alias x=y y=z z=nosuchcommand; x`,
  28. `alias ls='ls -l'; \ls`)
  29. [f3410c5862fc, 57386f30aec8, #544, and many others]
  30. - Highlight some more syntax errors
  31. [dea05e44e671, 298ef6a2fa30]
  32. - New styles: named file descriptors, `RC_QUOTES`, and unclosed quotes (e.g., `echo "foo<CURSOR>`)
  33. [38c794a978cd, 25ae1c01216c, 967335dfc5fd]
  34. - The 'brackets' highlighting no longer treats quotes specially.
  35. [ecdda36ef56f]
  36. Selected bugfixes include:
  37. - Highlight `sudo` correctly when it's not installed
  38. [26a82113b08b]
  39. - Handle some non-default options being set in zshrc
  40. [b07ada1255b7, a2a899b41b8, 972ad197c13d, b3f66fc8748f]
  41. - Fix off-by-one highlighting in vi "visual" mode (vicmd keymap)
  42. [be3882aeb054]
  43. - The 'yank-pop' widget is not wrapped
  44. [#183]
  45. Known issues include:
  46. - A multiline alias that uses a simple command terminator (such as `;`, `|`, `&&`)
  47. before a newline will incorrectly be highlighted as an error. See issue #677
  48. for examples and workarounds.
  49. [#677]
  50. # Changes in version 0.6.0
  51. This is a stable release, featuring bugfixes and minor improvements.
  52. ## Performance improvements:
  53. (none)
  54. ## Added highlighting of:
  55. - The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting].
  56. (79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support)
  57. [zshzle-Character-Highlighting]: http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting
  58. - Possible history expansions in double-quoted strings.
  59. (76ea9e1df316)
  60. - Mismatched `if`/`then`/`elif`/`else`/`fi`.
  61. (73cb83270262)
  62. ## Fixed highlighting of:
  63. - A comment line followed by a non-comment line.
  64. (#385, 9396ad5c5f9c)
  65. - An unquoted `$*` (expands to the positional parameters).
  66. (237f89ad629f)
  67. - history-incremental-pattern-search-backward under zsh 5.3.1.
  68. (#407, #415, 462779629a0c)
  69. ## API changes (for highlighter authors):
  70. (none)
  71. ## Developer-visible changes:
  72. - tests: Set the `ALIAS_FUNC_DEF` option for zsh 5.4 compatibility.
  73. (9523d6d49cb3)
  74. ## Other changes:
  75. - docs: Added before/after screenshots.
  76. (cd9ec14a65ec..b7e277106b49)
  77. - docs: Link Fedora package.
  78. (3d74aa47e4a7, 5feed23962df)
  79. - docs: Link FreeBSD port.
  80. (626c034c68d7)
  81. - docs: Link OpenSUSE Build Service packages
  82. (#419, dea1fedc7358)
  83. - Prevent user-defined aliases from taking effect in z-sy-h's own code.
  84. (#390, 2dce602727d7, 8d5afe47f774; and #392, #395, b8fa1b9dc954)
  85. - docs: Update zplug installation instructions.
  86. (#399, 4f49c4a35f17)
  87. - Improve "unhandled ZLE widget 'foo'" error message.
  88. (#409, be083d7f3710)
  89. - Fix printing of "failed loading highlighters" error message.
  90. (#426, ad522a091429)
  91. # Changes in version 0.5.0
  92. ## Performance improvements:
  93. We thank Sebastian Gniazdowski and "m0viefreak" for significant contributions
  94. in this area.
  95. - Optimize string operations in the `main` (default) highlighter.
  96. (#372/3cb58fd7d7b9, 02229ebd6328, ef4bfe5bcc14, #372/c6b6513ac0d6, #374/15461e7d21c3)
  97. - Command word highlighting: Use the `zsh/parameter` module to avoid forks.
  98. Memoize (cache) the results.
  99. (#298, 3ce01076b521, 2f18ba64e397, 12b879caf7a6; #320, 3b67e656bff5)
  100. - Avoid forks in the driver and in the `root` highlighter.
  101. (b9112aec798a, 38c8fbea2dd2)
  102. ## Added highlighting of:
  103. - `pkexec` (a precommand).
  104. (#248, 4f3910cbbaa5)
  105. - Aliases that cannot be defined normally nor invoked normally (highlighted as an error).
  106. (#263 (in part), 28932316cca6)
  107. - Path separators (`/`) — the default behaviour remains to highlight path separators
  108. and path components the same way.
  109. (#136, #260, 6cd39e7c70d3, 9a934d291e7c, f3d3aaa00cc4)
  110. - Assignments to individual positional arguments (`42=foo` to assign to `$42`).
  111. (f4036a09cee3)
  112. - Linewise region (the `visual-line-mode` widget, bound to `V` in zsh's `vi` keymap).
  113. (#267, a7a7f8b42280, ee07588cfd9b)
  114. - Command-lines recalled by `isearch` mode; requires zsh≥5.3.
  115. (#261 (in part); #257; 4ad311ec0a68)
  116. - Command-lines whilst the `IGNORE_BRACES` or `IGNORE_CLOSE_BRACES` option is in effect.
  117. (a8a6384356af, 02807f1826a5)
  118. - Mismatched parentheses and braces (in the `main` highlighter).
  119. (51b9d79c3bb6, 2fabf7ca64b7, a4196eda5e6f, and others)
  120. - Mismatched `do`/`done` keywords.
  121. (b2733a64da93)
  122. - Mismatched `foreach`/`end` keywords.
  123. (#96, 2bb8f0703d8f)
  124. - In Bourne-style function definitions, when the `MULTI_FUNC_DEF` option is set
  125. (which is the default), highlight the first word in the function body as
  126. a command word: `f() { g "$@" }`.
  127. (6f91850a01e1)
  128. - `always` blocks.
  129. (#335, e5782e4ddfb6)
  130. - Command substitutions inside double quotes, `"$(echo foo)"`.
  131. (#139 (in part), c3913e0d8ead)
  132. - Non-alphabetic parameters inside double quotes (`"$$"`, `"$#"`, `"$*"`, `"$@"`, `"$?"`, `"$-"`).
  133. (4afe670f7a1b, 44ef6e38e5a7)
  134. - Command words from future versions of zsh (forward compatibly).
  135. This also adds an `arg0` style that all other command word styles fall back to.
  136. (b4537a972eed, bccc3dc26943)
  137. - Escaped history expansions inside double quotes: `: "\!"`
  138. (28d7056a7a06, et seq)
  139. ## Fixed highlighting of:
  140. - Command separator tokens in syntactically-invalid positions.
  141. (09c4114eb980)
  142. - Redirections with a file descriptor number at command word.
  143. (#238 (in part), 73ee7c1f6c4a)
  144. - The `select` prompt, `$PS3`.
  145. (#268, 451665cb2a8b)
  146. - Values of variables in `vared`.
  147. (e500ca246286)
  148. - `!` as an argument (neither a history expansion nor a reserved word).
  149. (4c23a2fd1b90)
  150. - "division by zero" error under the `brackets` highlighter when `$ZSH_HIGHLIGHT_STYLES` is empty.
  151. (f73f3d53d3a6)
  152. - Process substitutions, `<(pwd)` and `>(wc -l)`.
  153. (#302, 6889ff6bd2ad, bfabffbf975c, fc9c892a3f15)
  154. - The non-`SHORT_LOOPS` form of `repeat` loops: `repeat 42; do true; done`.
  155. (#290, 4832f18c50a5, ef68f50c048f, 6362c757b6f7)
  156. - Broken symlinks (are now highlighted as files).
  157. (#342, 95f7206a9373, 53083da8215e)
  158. - Lines accepted from `isearch` mode.
  159. (#284; #257, #259, #288; 5bae6219008b, a8fe22d42251)
  160. - Work around upstream bug that triggered when the command word was a relative
  161. path, that when interpreted relative to a $PATH directory denoted a command;
  162. the effect of that upstream bug was that the relative path was cached as
  163. a "valid external command name".
  164. (#354, #355, 51614ca2c994, fdaeec45146b, 7d38d07255e4;
  165. upstream fix slated to be released in 5.3 (workers/39104))
  166. - After accepting a line with the cursor on a bracket, the matching bracket
  167. of the bracket under the cursor no longer remains highlighted (with the
  168. `brackets` highlighter).
  169. (4c4baede519a)
  170. - The first word on a new line within an array assignment or initialization is no
  171. longer considered a command position.
  172. (8bf423d16d46)
  173. - Subshells that end at command position, `(A=42)`, `(true;)`.
  174. (#231, 7fb6f9979121; #344, 4fc35362ee5a)
  175. - Command word after array assignment, `a=(lorem ipsum) pwd`.
  176. (#330, 7fb6f9979121)
  177. ## API changes (for highlighter authors):
  178. - New interface `_zsh_highlight_add_highlight`.
  179. (341a3ae1f015, c346f6eb6fb6)
  180. - tests: Specify the style key, not its value, in test expectations.
  181. (a830613467af, fd061b5730bf, eaa4335c3441, among others)
  182. - Module author documentation improvements.
  183. (#306 (in part), 217669270418, 0ff354b44b6e, 80148f6c8402, 364f206a547f, and others)
  184. - The driver no longer defines a `_zsh_highlight_${highlighter}_highlighter_cache`
  185. variable, which is in the highlighters' namespace.
  186. (3e59ab41b6b8, 80148f6c8402, f91a7b885e7d)
  187. - Rename highlighter entry points. The old names remain supported for
  188. backwards compatibility.
  189. (a3d5dfcbdae9, c793e0dceab1)
  190. - tests: Add the "NONE" expectation.
  191. (4da9889d1545, 13018f3dd735, d37c55c788cd)
  192. - tests: consider a test that writes to stderr to have failed.
  193. (#291, 1082067f9315)
  194. ## Developer-visible changes:
  195. - Add `make quiet-test`.
  196. (9b64ad750f35)
  197. - test harness: Better quote replaceables in error messages.
  198. (30d8f92df225)
  199. - test harness: Fix exit code for XPASS.
  200. (bb8d325c0cbd)
  201. - Create [HACKING.md](HACKING.md).
  202. (cef49752fd0e)
  203. - tests: Emit a description for PASS test points.
  204. (6aa57d60aa64, f0bae44b76dd)
  205. - tests: Create a script that generates a test file.
  206. (8013dc3b8db6, et seq; `tests/generate.zsh`)
  207. ## Other changes:
  208. - Under zsh≤5.2, widgets whose names start with a `_` are no longer excluded
  209. from highlighting.
  210. (ed33d2cb1388; reverts part of 186d80054a40 which was for #65)
  211. - Under zsh≤5.2, widgets implemented by a function named after the widget are
  212. no longer excluded from highlighting.
  213. (487b122c480d; reverts part of 776453cb5b69)
  214. - Under zsh≤5.2, shell-unsafe widget names can now be wrapped.
  215. (#278, 6a634fac9fb9, et seq)
  216. - Correct some test expectations.
  217. (78290e043bc5)
  218. - `zsh-syntax-highlighting.plugin.zsh`: Convert from symlink to plain file
  219. for msys2 compatibility.
  220. (#292, d4f8edc9f3ad)
  221. - Document installation under some plugin managers.
  222. (e635f766bef9, 9cab566f539b)
  223. - Don't leak the `PATH_DIRS` option.
  224. (7b82b88a7166)
  225. - Don't require the `FUNCTION_ARGZERO` option to be set.
  226. (#338, 750aebc553f2)
  227. - Under zsh≤5.2, support binding incomplete/nonexistent widgets.
  228. (9e569bb0fe04, part of #288)
  229. - Make the driver reentrant, fixing possibility of infinite recursion
  230. under zsh≤5.2 under interaction with theoretical third-party code.
  231. (#305, d711563fe1bf, 295d62ec888d, f3242cbd6aba)
  232. - Fix warnings when `WARN_CREATE_GLOBAL` is set prior to sourcing zsh-syntax-highlighting.
  233. (z-sy-h already sets `WARN_CREATE_GLOBAL` internally.)
  234. (da60234fb236)
  235. - Warn only once, rather than once per keypress, when a highlighter is unavailable.
  236. (0a9b347483ae)
  237. # Changes in version 0.4.1
  238. ## Fixes:
  239. - Arguments to widgets were not properly dash-escaped. Only matters for widgets
  240. that take arguments (i.e., that are invoked as `zle ${widget} -- ${args}`).
  241. (282c7134e8ac, reverts c808d2187a73)
  242. # Changes in version 0.4.0
  243. ## Added highlighting of:
  244. - incomplete sudo commands
  245. (a3047a912100, 2f05620b19ae)
  246. ```zsh
  247. sudo;
  248. sudo -u;
  249. ```
  250. - command words following reserved words
  251. (#207, #222, b397b12ac139 et seq, 6fbd2aa9579b et seq, 8b4adbd991b0)
  252. ```zsh
  253. if ls; then ls; else ls; fi
  254. repeat 10 do ls; done
  255. ```
  256. (The `ls` are now highlighted as a command.)
  257. - comments (when `INTERACTIVE_COMMENTS` is set)
  258. (#163, #167, 693de99a9030)
  259. ```zsh
  260. echo Hello # comment
  261. ```
  262. - closing brackets of arithmetic expansion, subshells, and blocks
  263. (#226, a59f442d2d34, et seq)
  264. ```zsh
  265. (( foo ))
  266. ( foo )
  267. { foo }
  268. ```
  269. - command names enabled by the `PATH_DIRS` option
  270. (#228, 96ee5116b182)
  271. ```zsh
  272. # When ~/bin/foo/bar exists, is executable, ~/bin is in $PATH,
  273. # and 'setopt PATH_DIRS' is in effect
  274. foo/bar
  275. ```
  276. - parameter expansions with braces inside double quotes
  277. (#186, 6e3720f39d84)
  278. ```zsh
  279. echo "${foo}"
  280. ```
  281. - parameter expansions in command word
  282. (#101, 4fcfb15913a2)
  283. ```zsh
  284. x=/bin/ls
  285. $x -l
  286. ```
  287. - the command separators '\|&', '&!', '&\|'
  288. ```zsh
  289. view file.pdf &! ls
  290. ```
  291. ## Fixed highlighting of:
  292. - precommand modifiers at non-command-word position
  293. (#209, 2c9f8c8c95fa)
  294. ```zsh
  295. ls command foo
  296. ```
  297. - sudo commands with infix redirections
  298. (#221, be006aded590, 86e924970911)
  299. ```zsh
  300. sudo -u >/tmp/foo.out user ls
  301. ```
  302. - subshells; anonymous functions
  303. (#166, #194, 0d1bfbcbfa67, 9e178f9f3948)
  304. ```zsh
  305. (true)
  306. () { true }
  307. ```
  308. - parameter assignment statements with no command
  309. (#205, 01d7eeb3c713)
  310. ```zsh
  311. A=1;
  312. ```
  313. (The semicolon used to be highlighted as a mistake)
  314. - cursor highlighter: Remove the cursor highlighting when accepting a line.
  315. (#109, 4f0c293fdef0)
  316. ## Removed features:
  317. - Removed highlighting of approximate paths (`path_approx`).
  318. (#187, 98aee7f8b9a3)
  319. ## Other changes:
  320. - main highlighter refactored to use states rather than booleans.
  321. (2080a441ac49, et seq)
  322. - Fix initialization when sourcing `zsh-syntax-highlighting.zsh` via a symlink
  323. (083c47b00707)
  324. - docs: Add screenshot.
  325. (57624bb9f64b)
  326. - widgets wrapping: Don't add '--' when invoking widgets.
  327. (c808d2187a73) [_reverted in 0.4.1_]
  328. - Refresh highlighting upon `accept-*` widgets (`accept-line` et al).
  329. (59fbdda64c21)
  330. - Stop leaking match/mbegin/mend to global scope (thanks to upstream
  331. `WARN_CREATE_GLOBAL` improvements).
  332. (d3deffbf46a4)
  333. - 'make install': Permit setting `$(SHARE_DIR)` from the environment.
  334. (e1078a8b4cf1)
  335. - driver: Tolerate KSH_ARRAYS being set in the calling context.
  336. (#162, 8f19af6b319d)
  337. - 'make install': Install documentation fully and properly.
  338. (#219, b1619c001390, et seq)
  339. - docs: Improve 'main' highlighter's documentation.
  340. (00de155063f5, 7d4252f5f596)
  341. - docs: Moved to a new docs/ tree; assorted minor updates
  342. (c575f8f37567, 5b34c23cfad5, et seq)
  343. - docs: Split README.md into INSTALL.md
  344. (0b3183f6cb9a)
  345. - driver: Report `$ZSH_HIGHLIGHT_REVISION` when running from git
  346. (84734ba95026)
  347. ## Developer-visible changes:
  348. - Test harness converted to [TAP](http://testanything.org/tap-specification.html) format
  349. (d99aa58aaaef, et seq)
  350. - Run each test in a separate subprocess, isolating them from each other
  351. (d99aa58aaaef, et seq)
  352. - Fix test failure with nonexisting $HOME
  353. (#216, b2ac98b98150)
  354. - Test output is now colorized.
  355. (4d3da30f8b72, 6fe07c096109)
  356. - Document `make install`
  357. (a18a7427fd2c)
  358. - tests: Allow specifying the zsh binary to use.
  359. (557bb7e0c6a0)
  360. - tests: Add 'make perf' target
  361. (4513eaea71d7)
  362. - tests: Run each test in a sandbox directory
  363. (c01533920245)
  364. # Changes in version 0.3.0
  365. ## Added highlighting of:
  366. - suffix aliases (requires zsh 5.1.1 or newer):
  367. ```zsh
  368. alias -s png=display
  369. foo.png
  370. ```
  371. - prefix redirections:
  372. ```zsh
  373. <foo.txt cat
  374. ```
  375. - redirection operators:
  376. ```zsh
  377. echo > foo.txt
  378. ```
  379. - arithmetic evaluations:
  380. ```zsh
  381. (( 42 ))
  382. ```
  383. - $'' strings, including \x/\octal/\u/\U escapes
  384. ```zsh
  385. : $'foo\u0040bar'
  386. ```
  387. - multiline strings:
  388. ```zsh
  389. % echo "line 1
  390. line 2"
  391. ```
  392. - string literals that haven't been finished:
  393. ```zsh
  394. % echo "Hello, world
  395. ```
  396. - command words that involve tilde expansion:
  397. ```zsh
  398. % ~/bin/foo
  399. ```
  400. ## Fixed highlighting of:
  401. - quoted command words:
  402. ```zsh
  403. % \ls
  404. ```
  405. - backslash escapes in "" strings:
  406. ```zsh
  407. % echo "\x41"
  408. ```
  409. - noglob after command separator:
  410. ```zsh
  411. % :; noglob echo *
  412. ```
  413. - glob after command separator, when the first command starts with 'noglob':
  414. ```zsh
  415. % noglob true; echo *
  416. ```
  417. - the region (vi visual mode / set-mark-command) (issue #165)
  418. - redirection and command separators that would be highlighted as `path_approx`
  419. ```zsh
  420. % echo foo;‸
  421. % echo <
  422. ```
  423. (where `‸` represents the cursor location)
  424. - escaped globbing (outside quotes)
  425. ```zsh
  426. % echo \*
  427. ```
  428. ## Other changes:
  429. - implemented compatibility with zsh's paste highlighting (issue #175)
  430. - `$?` propagated correctly to wrapped widgets
  431. - don't leak $REPLY into global scope
  432. ## Developer-visible changes:
  433. - added makefile with `install` and `test` targets
  434. - set `warn_create_global` internally
  435. - document release process
  436. # Version 0.2.1
  437. (Start of changelog.)