annotate runtime/syntax/zir.vim @ 32888:b1162ad29d73 v9.0.1753

patch 9.0.1753: can't move to last non-blank char Commit: https://github.com/vim/vim/commit/b5f6fe9ca2661d06bc0be839447ce1995450b9de Author: Christian Brabandt <cb@256bit.org> Date: Sat Aug 19 15:53:16 2023 +0200 patch 9.0.1753: can't move to last non-blank char Problem: can't move to last non-blank char Solution: Make g<end> behave like that Make it possible to move to last non-blank char on a line We can distinguish between g0 and g^ to move to the very first character and the first non-blank char. And while we can move to the last screen char, we cannot go to the last non-blank screen char. Since I think g$ is the more widely used and known movement command (and g<end> is synonymous to it) change the behaviour of g<end> to move to last non-screen char instead and don't have this be the same command as the g$ command anymore. If you want to keep the old behaviour, you can use: ``` nnoremap g<end> g$ ``` Add a test to verify the behaviour. closes: #12593 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Aug 2023 16:00:08 +0200
parents 15c80d8bc515
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
31383
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: Zir
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Upstream: https://github.com/ziglang/zig.vim
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5 if exists("b:current_syntax")
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 finish
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 endif
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 let b:current_syntax = "zir"
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 syn region zirCommentLine start=";" end="$" contains=zirTodo,@Spell
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 syn region zirBlock start="{" end="}" transparent fold
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14 syn keyword zirKeyword primitive fntype int str as ptrtoint fieldptr deref asm unreachable export ref fn
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16 syn keyword zirTodo contained TODO
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 syn region zirString start=+c\?"+ skip=+\\\\\|\\"+ end=+"+ oneline contains=zirEscape,zirEscapeUnicode,zirEscapeError,@Spell
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 syn match zirEscapeError display contained /\\./
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 syn match zirEscape display contained /\\\([nrt\\'"]\|x\x\{2}\)/
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 syn match zirEscapeUnicode display contained /\\\(u\x\{4}\|U\x\{6}\)/
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 syn match zirDecNumber display "\<[0-9]\+\%(.[0-9]\+\)\=\%([eE][+-]\?[0-9]\+\)\="
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 syn match zirHexNumber display "\<0x[a-fA-F0-9]\+\%([a-fA-F0-9]\+\%([pP][+-]\?[0-9]\+\)\?\)\="
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 syn match zirOctNumber display "\<0o[0-7]\+"
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 syn match zirBinNumber display "\<0b[01]\+\%(.[01]\+\%([eE][+-]\?[0-9]\+\)\?\)\="
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 syn match zirGlobal display "[^a-zA-Z0-9_]\?\zs@[a-zA-Z0-9_]\+"
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 syn match zirLocal display "[^a-zA-Z0-9_]\?\zs%[a-zA-Z0-9_]\+"
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 hi def link zirCommentLine Comment
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 hi def link zirTodo Todo
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 hi def link zirKeyword Keyword
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 hi def link zirString Constant
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
39 hi def link zirEscape Special
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 hi def link zirEscapeUnicode zirEscape
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 hi def link zirEscapeError Error
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 hi def link zirDecNumber Constant
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 hi def link zirHexNumber Constant
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 hi def link zirOctNumber Constant
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
46 hi def link zirBinNumber Constant
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
47
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
48 hi def link zirGlobal Identifier
15c80d8bc515 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
49 hi def link zirLocal Identifier