@@ -13,9 +13,6 @@ let g:workspace_autosave_untrailspaces = get(g:, 'workspace_autosave_untrailspac
13
13
let g: workspace_autosave_au_updatetime = get (g: , ' workspace_autosave_au_updatetime' , 4 )
14
14
let g: workspace_sensible_settings = get (g: , ' workspace_sensible_settings' , 0 )
15
15
let g: workspace_autocreate = get (g: , ' workspace_autocreate' , 0 )
16
- let g: workspace_indentguides = get (g: , ' workspace_indentguides' , 0 )
17
- let g: workspace_indentguides_firstlevel = get (g: , ' workspace_indentguides_firstlevel' , 0 )
18
- let g: workspace_indentguides_ignore = get (g: , ' workspace_indentguides_ignore' , [])
19
16
20
17
21
18
function ! s: SetSensibleSettings ()
@@ -217,66 +214,11 @@ function! s:SetUndoDir()
217
214
endif
218
215
endfunction
219
216
220
- function ! s: SetIndentGuideHighlights (user_initiated)
221
- if (g: workspace_indentguides && index (g: workspace_indentguides_ignore , &filetype ) == -1 ) || a: user_initiated
222
- if ! a: user_initiated
223
- silent ! syntax clear IndentGuideSpaces
224
- silent ! syntax clear IndentGuideDraw
225
- endif
226
- execute " highlight Conceal ctermfg=238 ctermbg=NONE guifg=Grey27 guibg=NONE"
227
- execute " highlight SpecialKey ctermfg=238 ctermbg=NONE guifg=Grey27 guibg=NONE"
228
-
229
- if g: workspace_indentguides_firstlevel
230
- execute printf (' syntax match IndentGuideDraw /^\zs\ \ze\ \{%i}/ containedin=ALL conceal cchar=┆' , &l: shiftwidth - 1 )
231
- endif
232
- execute ' syntax match IndentGuideSpaces /^\ \+/ containedin=ALL contains=IndentGuideDraw keepend'
233
- execute printf (' syntax match IndentGuideDraw /\ \{%i}\zs \ze/ contained conceal cchar=┆' , &l: shiftwidth - 1 )
234
- endif
235
- endfunction
236
-
237
- function ! s: ToggleIndentGuides (user_initiated)
238
- let b: toggle_indentguides = get (b: , ' toggle_indentguides' , 1 )
239
-
240
- if ! a: user_initiated
241
- if ! g: workspace_indentguides || index (g: workspace_indentguides_ignore , &filetype ) != -1 || ! b: toggle_indentguides
242
- " skip if not user initiated, and is either disabled, an ignored filetype, or already toggled on
243
- return
244
- endif
245
- endif
246
-
247
- if b: toggle_indentguides
248
- call s: SetIndentGuideHighlights (a: user_initiated )
249
-
250
- " TODO-TK: local and global listchars are the same, and s: variables are failing (??)
251
- let g: original_listchars = get (g: , ' original_listchars' , &g: listchars )
252
-
253
- let listchar_guides = ' ,tab:| ,trail:·'
254
- if &g: listchars !~ listchar_guides
255
- let &g: listchars = &g: listchars . listchar_guides
256
- endif
257
- setlocal concealcursor= inc
258
- setlocal conceallevel= 2
259
- setlocal list
260
- let b: toggle_indentguides = 0
261
- else
262
- syntax clear IndentGuideSpaces
263
- syntax clear IndentGuideDraw
264
-
265
- let &l: conceallevel = &g: conceallevel
266
- let &l: concealcursor = &g: concealcursor
267
- let &g: listchars = g: original_listchars
268
- setlocal nolist
269
- let b: toggle_indentguides = 1
270
- endif
271
- endfunction
272
-
273
217
function ! s: PostLoadCleanup ()
274
218
if line (" '\" " ) > 1 && line (" '\" " ) <= line (" $" ) | exe " normal! g'\" " | endif
275
219
endfunction
276
220
277
221
augroup Workspace
278
- au ! BufRead ,ColorScheme * call s: SetIndentGuideHighlights (0 )
279
- au ! BufWinEnter * call s: ToggleIndentGuides (0 )
280
222
au ! VimEnter * nested call s: LoadWorkspace ()
281
223
au ! VimLeave * call s: MakeWorkspace (0 )
282
224
au ! InsertLeave * if pumvisible () == 0 |pclose |endif
@@ -288,7 +230,6 @@ augroup WorkspaceAutosave
288
230
augroup END
289
231
290
232
command ! ToggleAutosave call s: ToggleAutosave ()
291
- command ! ToggleIndentGuides call s: ToggleIndentGuides (1 )
292
233
command ! ToggleWorkspace call s: ToggleWorkspace ()
293
234
command ! CloseHiddenBuffers call s: CloseHiddenBuffers ()
294
235
0 commit comments