Mercurial > vim
annotate runtime/syntax/upstart.vim @ 34485:157cf882799f v9.1.0150
patch 9.1.0150: Several minor 'winfixbuf' issues
Commit: https://github.com/vim/vim/commit/4bb505e28cac0389561fff78d8bbe0319c2bcf2f
Author: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Date: Tue Mar 5 20:39:07 2024 +0100
patch 9.1.0150: Several minor 'winfixbuf' issues
Problem: several minor 'winfixbuf' issues exist, mostly relating to the
quickfix list
Solution: address them and adjust tests. Retab and reflow a few things too.
(Sean Dewar)
Things touched include:
- Replace the semsgs with gettext'd emsgs.
- Handle window switching in ex_listdo properly, so curbuf and curwin
are kept in-sync and trigger autocommands; handle those properly.
- Don't change the list entry index in qf_jump_edit_buffer if we fail
due to 'wfb' (achieved by returning FAIL; QF_ABORT should only be used
if the list was changed).
- Make qf_jump_edit_buffer actually switch to prevwin when using `:cXX`
commands **outside** of the list window if 'wfb' is set in curwin.
Handle autocommands properly in case they mess with the list.
NOTE: previously, it seemed to split if 'wfb' was set, but do nothing
and fail if prevwin is *valid*. This behaviour seemed strange, and maybe
unintentional? Now it aligns more with what's described for the `:cXX`
commands in the original PR description when used outside a list window,
I think.
- In both functions, only consider prevwin if 'wfb' isn't set for it;
fallback to splitting otherwise.
- Use win_split to split. Not sure if there was a specific reason for
using ex_splitview. win_split is simpler and respects modifiers like
:vertical that may have been used. Plus, its return value can be checked
for setting opened_window in qf code (technically win_split_ins autocmds
could immediately close it or change windows, in which the qf code might
close some other window on failure; it's already the case elsewhere,
though).
closes: #14142
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 05 Mar 2024 20:45:04 +0100 |
parents | 43efa4f5a8ea |
children |
rev | line source |
---|---|
2725 | 1 " Vim syntax file |
2 " Language: Upstart job files | |
3 " Maintainer: Michael Biebl <biebl@debian.org> | |
4 " James Hunt <james.hunt@ubuntu.com> | |
3281 | 5 " Last Change: 2012 Jan 16 |
6 " License: The Vim license | |
2725 | 7 " Version: 0.4 |
8 " Remark: Syntax highlighting for Upstart (init(8)) job files. | |
9 " | |
10 " It is inspired by the initng syntax file and includes sh.vim to do the | |
11 " highlighting of script blocks. | |
12 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3281
diff
changeset
|
13 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
3281
diff
changeset
|
14 if exists("b:current_syntax") |
2725 | 15 finish |
16 endif | |
17 | |
18 let is_bash = 1 | |
19 syn include @Shell syntax/sh.vim | |
20 | |
21 syn case match | |
22 | |
23 " avoid need to use 'match' for most events | |
24 setlocal iskeyword+=- | |
25 | |
26 syn match upstartComment /#.*$/ contains=upstartTodo | |
27 syn keyword upstartTodo TODO FIXME contained | |
28 | |
29 syn region upstartString start=/"/ end=/"/ skip=/\\"/ | |
30 | |
31 syn region upstartScript matchgroup=upstartStatement start="script" end="end script" contains=@upstartShellCluster | |
32 | |
33 syn cluster upstartShellCluster contains=@Shell | |
34 | |
35 " one argument | |
36 syn keyword upstartStatement description author version instance expect | |
37 syn keyword upstartStatement pid kill normal console env exit export | |
38 syn keyword upstartStatement umask nice oom chroot chdir exec | |
39 | |
40 " two arguments | |
41 syn keyword upstartStatement limit | |
42 | |
43 " one or more arguments (events) | |
44 syn keyword upstartStatement emits | |
45 | |
46 syn keyword upstartStatement on start stop | |
47 | |
48 " flag, no parameter | |
49 syn keyword upstartStatement respawn service instance manual debug task | |
50 | |
51 " prefix for exec or script | |
52 syn keyword upstartOption pre-start post-start pre-stop post-stop | |
53 | |
54 " option for kill | |
55 syn keyword upstartOption timeout | |
56 " option for oom | |
57 syn keyword upstartOption never | |
58 " options for console | |
59 syn keyword upstartOption output owner | |
60 " options for expect | |
61 syn keyword upstartOption fork daemon | |
62 " options for limit | |
63 syn keyword upstartOption unlimited | |
64 | |
65 " 'options' for start/stop on | |
66 syn keyword upstartOption and or | |
67 | |
68 " Upstart itself and associated utilities | |
69 syn keyword upstartEvent runlevel | |
70 syn keyword upstartEvent started | |
71 syn keyword upstartEvent starting | |
72 syn keyword upstartEvent startup | |
73 syn keyword upstartEvent stopped | |
74 syn keyword upstartEvent stopping | |
75 syn keyword upstartEvent control-alt-delete | |
76 syn keyword upstartEvent keyboard-request | |
77 syn keyword upstartEvent power-status-changed | |
78 | |
79 " D-Bus | |
80 syn keyword upstartEvent dbus-activation | |
81 | |
82 " Display Manager (ie gdm) | |
83 syn keyword upstartEvent desktop-session-start | |
84 syn keyword upstartEvent login-session-start | |
85 | |
86 " mountall | |
87 syn keyword upstartEvent all-swaps | |
88 syn keyword upstartEvent filesystem | |
89 syn keyword upstartEvent mounted | |
90 syn keyword upstartEvent mounting | |
91 syn keyword upstartEvent local-filesystems | |
92 syn keyword upstartEvent remote-filesystems | |
93 syn keyword upstartEvent virtual-filesystems | |
94 | |
95 " SysV umountnfs.sh | |
96 syn keyword upstartEvent mounted-remote-filesystems | |
97 | |
98 " upstart-udev-bridge and ifup/down | |
99 syn match upstartEvent /\<\i\{-1,}-device-\(added\|removed\|up\|down\)/ | |
100 | |
101 " upstart-socket-bridge | |
102 syn keyword upstartEvent socket | |
103 | |
104 hi def link upstartComment Comment | |
105 hi def link upstartTodo Todo | |
106 hi def link upstartString String | |
107 hi def link upstartStatement Statement | |
108 hi def link upstartOption Type | |
109 hi def link upstartEvent Define | |
110 | |
111 let b:current_syntax = "upstart" |