• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンcb615394967242bfade75197de95fd14c07f2aed (tree)
日時2023-02-27 01:41:38
作者badcoff33 <none@none>
コミッターbadcoff33

ログメッセージ

updates

変更サマリ

差分

--- a/autoload/run.vim
+++ b/autoload/run.vim
@@ -44,9 +44,13 @@ export def CloseCb(ch: channel)
4444 for d in g:run_dict
4545 if d.channel == ch_nr
4646
47- timer_stop(d.timer)
47+ if has_key(d, "timer")
48+ timer_stop(d.timer)
49+ endif
4850 g:run_2_tid = timer_start(500, (_) => {
49- popup_close(d.winid)
51+ if has_key(d, "winid")
52+ popup_close(d.winid)
53+ endif
5054 RemoveChannelFromDict(d.channel)
5155 }, {repeat: 1})
5256
@@ -86,7 +90,9 @@ export def HiddenErrorCb(ch: channel, msg: string)
8690 for d in g:run_dict
8791 if d.channel == ch_nr
8892 timer_stop(d.timer)
89- popup_close(d.winid)
93+ if has_key(d, "winid")
94+ popup_close(d.winid)
95+ endif
9096 echohl ErrorMsg
9197 echo "error reported by channel" ch_info(ch)["id"] "-->" msg
9298 echohl None
@@ -110,21 +116,23 @@ def ConditionalWriteAll(dict: dict<any>)
110116 enddef
111117
112118 def RunTimerCb(tid: number)
113- var max_width = 30
119+ var max_width = 20
114120 var popup_text: string
115121
116122 for d in g:run_dict
117- if d.timer == tid
123+ if has_key(d, "timer") && d.timer == tid
118124 if len(d.cmd) > max_width
119- popup_text = "Running " .. d.cmd[0 : max_width]
120- .. "..."
125+ popup_text = job_status(d.job) .. " "
121126 .. (localtime() - d.started)
122- .. "sec"
127+ .. "sec ("
128+ .. d.cmd[0 : max_width]
129+ .. "...)"
123130 else
124- popup_text = "Running " .. d.cmd
125- .. " "
131+ popup_text = job_status(d.job) .. " "
126132 .. (localtime() - d.started)
127- .. "sec"
133+ .. "sec ("
134+ .. d.cmd
135+ .. ")"
128136 endif
129137 popup_settext(d.winid, popup_text)
130138 break
@@ -133,11 +141,12 @@ def RunTimerCb(tid: number)
133141 enddef
134142
135143 export def Run(dict: dict<any>): job
136- var job: job
144+ var v_job: job
137145 var v_bufnr: number
138146 var v_winid: number
139147 var v_bufname: string
140148 var v_regexp: string
149+ var save_winid = win_getid(winnr())
141150
142151 var job_opts = {}
143152
@@ -156,7 +165,7 @@ export def Run(dict: dict<any>): job
156165 if has_key(dict, "hidden") && (dict.hidden == true)
157166 job_opts.cwd = has_key(dict, "cwd") ? dict.cwd : getcwd()
158167 job_opts.err_cb = function("run#HiddenErrorCb")
159- job = job_start('cmd /C ' .. escape(dict.cmd, '\'), job_opts)
168+ v_job = job_start('cmd /C ' .. escape(dict.cmd, '\'), job_opts)
160169 else
161170 if v_bufname == ""
162171 v_bufnr = bufadd(dict.cmd)
@@ -171,7 +180,7 @@ export def Run(dict: dict<any>): job
171180 v_bufnr = bufadd(v_bufname)
172181 setbufvar(v_bufnr, "&buftype", "nofile")
173182 endif
174- execute "buffer" v_bufnr
183+
175184 nnoremap <buffer> <Esc> <Cmd>bw!<CR>
176185 appendbufline(v_bufnr, "$", "-----" .. strftime("%X") .. "------" .. dict.cmd .. "-----")
177186 normal G
@@ -184,30 +193,52 @@ export def Run(dict: dict<any>): job
184193 job_opts.out_io = "buffer"
185194 job_opts.close_cb = function("run#CloseCb")
186195
187- job = job_start('cmd /C ' .. escape(dict.cmd, ''), job_opts)
188- var v_channel = split(string(job_getchannel(job)), " ")[1]
196+ v_job = job_start('cmd /C ' .. escape(dict.cmd, ''), job_opts)
197+ var v_channel = split(string(job_getchannel(v_job)), " ")[1]
189198 var popup_text: string
190199
191- if len(dict.cmd) > 40
192- popup_text = dict.cmd[0 : 40] .. "..."
200+
201+ if !has_key(dict, "no_popup") || (dict.no_popup == false)
202+ # split
203+ # execute "buffer" v_bufnr
204+ # wincmd J
205+
206+ if len(dict.cmd) > 40
207+ popup_text = "Started (" .. dict.cmd[0 : 40] .. "...)"
208+ else
209+ popup_text = "Started (" .. dict.cmd .. ")"
210+ endif
211+ v_winid = popup_create(popup_text, g:Winopts())
212+ execute "buffer" v_bufnr
213+ add(g:run_dict, {
214+ winid: v_winid,
215+ timer: timer_start(1000, RunTimerCb, {repeat: -1}),
216+ job: v_job,
217+ channel: v_channel,
218+ cmd: dict.cmd,
219+ regexp: v_regexp,
220+ bufname: v_bufname,
221+ bufnr: v_bufnr,
222+ started: localtime()
223+ })
193224 else
194- popup_text = dict.cmd
225+ add(g:run_dict, {
226+ job: v_job,
227+ channel: v_channel,
228+ cmd: dict.cmd,
229+ regexp: v_regexp,
230+ bufname: v_bufname,
231+ bufnr: v_bufnr,
232+ started: localtime()
233+ })
195234 endif
196- v_winid = popup_create("Started " .. popup_text, g:Winopts())
197-
198- add(g:run_dict, {
199- channel: v_channel,
200- winid: v_winid,
201- cmd: dict.cmd,
202- regexp: v_regexp,
203- bufname: v_bufname,
204- bufnr: v_bufnr,
205- timer: timer_start(1000, RunTimerCb, {repeat: -1}),
206- started: localtime()
207- })
235+
236+
208237 endif
209238
210- return job
239+ win_gotoid(save_winid)
240+
241+ return v_job
211242 enddef
212243
213244 augroup GroupRun
--- a/autoload/torchlight.vim
+++ b/autoload/torchlight.vim
@@ -13,6 +13,9 @@ export def TorchlightClearAll()
1313 endfor
1414 enddef
1515
16+# Clear properties on current line
17+# This might work for you
18+# `autocmd TextChanged * torchlight.TorchlightChanged()`
1619 export def TorchlightChanged()
1720 prop_clear(line("."))
1821 enddef
--- a/plugin/hg.vim
+++ b/plugin/hg.vim
@@ -33,7 +33,9 @@ enddef
3333
3434 command! -complete=custom,CompleteHg -nargs=+ Hg run.Run({cmd: 'hg <args>', name: "HG-OUTPUT"})
3535
36-nnoremap <Leader>v :<C-u>Hg<Space>
36+nnoremap <Leader>vv :<C-u>Hg<Space>
37+nnoremap <Leader>vs <Cmd>Hg status<CR>
38+nnoremap <Leader>vl <Cmd>Hg sl<CR>
3739
3840 # Uncomment when testing
3941 defcompile
--- a/plugin/ripgrep.vim
+++ b/plugin/ripgrep.vim
@@ -44,8 +44,8 @@ set grepprg=rg\ --vimgrep\ $*
4444 set grepformat=%f:%l:%c:%m
4545
4646 command! -complete=file -nargs=* RgFiles run.Run({cmd: "rg --files" .. g:RgGlobSwitch() .. join(split(<q-args>, " "), g:RgGlobSwitch() ), name: "RG-OUTPUT"})
47-command! -complete=file -nargs=* Rg run.Run({cmd: 'rg --vimgrep ' .. ' <args> ' .. join(g:rg_paths, " "), regexp: &grepformat})
48-command! -complete=file -nargs=* RgNoDir run.Run({cmd: 'rg --vimgrep ' .. ' <args> ', regexp: &grepformat})
47+command! -complete=file -nargs=* Rg run.Run({cmd: 'rg --vimgrep ' .. ' <args> ' .. join(g:rg_paths, " "), regexp: &grepformat, no_popup: true})
48+command! -complete=file -nargs=* RgNoDir run.Run({cmd: 'rg --vimgrep ' .. ' <args> ', regexp: &grepformat, no_popup: true})
4949
5050 nnoremap <Leader>F :RgFiles<C-r>=g:RgExcludes()<CR><C-r>=g:RgGlobSwitch()<CR> **<Left>
5151 nnoremap <Leader>R :Rg <C-r>=g:RgExcludes()<CR> <C-r>=RgIncludes(&ft)<CR> <C-r>=RgPattern()<CR>
--- a/plugin/torchlight.vim
+++ b/plugin/torchlight.vim
@@ -3,7 +3,7 @@ import autoload "torchlight.vim"
33
44 augroup GroupTorchlight
55 autocmd!
6- autocmd TextChanged * torchlight.TorchlightChanged()
6+ # autocmd TextChanged * torchlight.TorchlightChanged()
77 autocmd QuickFixCmdPre make torchlight.TorchlightClearAll()
88 autocmd QuickFixCmdPost make torchlight.TorchlightUpdate()
99 augroup END
--- a/templates/local_vimrc
+++ b/templates/local_vimrc
@@ -19,6 +19,10 @@ set tagcase=match
1919 compiler gcc
2020 set makeprg=make
2121
22-" Markdown, please
23-autocmd BufRead *.txt setfiletype markdown
24-
22+augroup GroupLocal
23+ au!
24+ " Markdown, please
25+ au BufRead *.txt setfiletype markdown
26+ " Remember last state of work
27+ autocmd VimLeave * mksession! .session
28+augroup END
--- a/vimrc
+++ b/vimrc
@@ -139,8 +139,6 @@ inoremap <C-x><C-CR> <C-x><C-]>
139139
140140 " Switching modes
141141 inoremap <k0> <Esc>
142-imap <Char-252> <Esc>
143-nmap <Char-252> :
144142
145143 " Consistent cursor movement
146144 noremap! <A-Left> <Home>
@@ -205,10 +203,9 @@ iabbrev {} { }<Left><Left>
205203
206204 " }}}
207205
208-
209206 let FilePath = { -> expand("%:h") == "" ? "" : expand("%:h") .. g:slash }
210-cnoremap <expr> <A-.> (FilePath() == ".") ? "." : FilePath()
211-cnoremap <expr> <A-,> $HOME .. g:slash .. 'vimfiles' .. g:slash
207+cnoremap <expr> <C-r>. (FilePath() == ".") ? "." : FilePath()
208+cnoremap <expr> <C-r>, $HOME .. g:slash .. 'vimfiles' .. g:slash
212209 cmap <C-BS> <C-w>
213210 cmap <C-Del> <C-Right><C-w>
214211
@@ -268,7 +265,6 @@ nnoremap <Leader>e :edit <C-r>=(FilePath() == ".") ? "." : FilePath()<CR>
268265 nnoremap <Leader>f :find<Space>
269266 nnoremap <Leader>b :buffer<Space>
270267 nnoremap <Leader>d <cmd>bdelete<CR>
271-nnoremap <Leader>. :tjump /
272268
273269 " Leader-t space
274270 nnoremap <Leader>tt <Cmd>tab split<CR>