上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 259 下一页
摘要: 原文 foo [内容] bar ''' 更多 '''更多东西 syntax region specialCommand start='\<foo\s' end='$' skip='&$' \ keepend contains=tripleQuoted syntax region tripleQuot 阅读全文
posted @ 2022-08-13 11:22 zjh6 阅读(23) 评论(0) 推荐(0)
摘要: 原文 auto contextWithException(T, E)(lazy scope T expression, Exception delegate(E) handler) { Exception newException; try { return expression(); } catc 阅读全文
posted @ 2022-08-13 08:50 zjh6 阅读(13) 评论(0) 推荐(0)
摘要: 文本中每个位置的结果高亮显示,是根据该位置嵌套最深的语法匹配设置的.如果这样的匹配缺少背景属性,则就用正常组. 因此,必须独立更改每个"最终"比赛亮点.所以答案是否定的,你不能.至少,不能通过语法匹配机制. 全局变量仍与旧脚本中的相同,因此unlet像以前一样工作.唯一的区别是现在总是需要g:前缀来 阅读全文
posted @ 2022-08-12 17:42 zjh6 阅读(47) 评论(0) 推荐(0)
摘要: 'foo' : 'bar', //<=> foo = 'bar' 但想用.多次运行. function! s:var2dict(...) if a:0 "动作" " let save_cursor = getcurpos()" execute "normal! I'\<ESC>ea'\<ESC>f= 阅读全文
posted @ 2022-08-12 16:12 zjh6 阅读(11) 评论(0) 推荐(0)
摘要: 可以通过g@传递它们来创建可重复映射 function! s:insspace(...) if a:0 execute 'normal' v:count1.'i '."\<esc>".'`[' else " 安装" let &operatorfunc = matchstr(expand('<sfil 阅读全文
posted @ 2022-08-12 15:54 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: 原文 @safe: alias DG = void delegate() @safe; void main() { DG dg = getDg(42); stompStack(); dg(); } DG getDg(int val) { return forwardDg(val); } DG for 阅读全文
posted @ 2022-08-12 15:44 zjh6 阅读(13) 评论(0) 推荐(0)
摘要: 原文 不能在@safe代码中拥有指向栈内存的全局变量 int** global; immutable int imm; static this() { imm = 42; } void main() @safe { f(); /* `global` 现在指向栈.*/ stomp(); /* `*gl 阅读全文
posted @ 2022-08-12 15:25 zjh6 阅读(20) 评论(0) 推荐(0)
摘要: 原文 function! Jump(jumpcommands) let l:location = getcurpos('.') for jumpkey in a:jumpcommands execute "normal! " jumpkey if l:location != getcurpos('. 阅读全文
posted @ 2022-08-12 15:09 zjh6 阅读(17) 评论(0) 推荐(0)
摘要: 原文 添加环境信息到可能无法访问传播异常的抛代码中. 是的,但可再次这样:抓一个,然后抛新的,并把旧的放在后面. 是的.但是,必须在每个可能想要添加环境信息的潜在抽象级别周围插入try/catch语法很痛苦.如果在战略入口点,用可插入的包装器,就更好了.如下? // 幻想的,假设的语法 auto m 阅读全文
posted @ 2022-08-12 11:28 zjh6 阅读(13) 评论(0) 推荐(0)
摘要: 原文 void delegate() test(Object[] objs...) { return { foreach(obj; objs)assert(obj); }; } void delegate() foo() { return test(new Object, new Object); 阅读全文
posted @ 2022-08-12 11:02 zjh6 阅读(17) 评论(0) 推荐(0)
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 259 下一页