view runtime/ftplugin/sshconfig.vim @ 33594:e9c70470fe94 v9.0.2041

patch 9.0.2041: trim(): hard to use default mask Commit: https://github.com/vim/vim/commit/8079917447e7436dccc2e4cd4a4a56ae0a4712f2 Author: Illia Bobyr <illia.bobyr@gmail.com> Date: Tue Oct 17 18:00:50 2023 +0200 patch 9.0.2041: trim(): hard to use default mask Problem: trim(): hard to use default mask (partly revert v9.0.2040) Solution: use default mask when it is empty The default 'mask' value is pretty complex, as it includes many characters. Yet, if one needs to specify the trimming direction, the third argument, 'trim()' currently requires the 'mask' value to be provided explicitly. Currently, an empty 'mask' will make 'trim()' call return 'text' value that is passed in unmodified. It is unlikely that someone is using it, so the chances of scripts being broken by this change are low. Also, this reverts commit 9.0.2040 (which uses v:none for the default and requires to use an empty string instead). closes: #13358 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Illia Bobyr <illia.bobyr@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Tue, 17 Oct 2023 18:15:03 +0200
parents c252fbfde41d
children 89b487b08b2a
line wrap: on
line source

" Vim filetype plugin file
" Language:         OpenSSH client configuration file
" Previous Maintainer:       Nikolai Weibull <now@bitwi.se>
" Latest Revision:  2023-10-07

if exists("b:did_ftplugin")
  finish
endif
let b:did_ftplugin = 1

let s:cpo_save = &cpo
set cpo&vim

setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
let b:undo_ftplugin = 'setlocal com< cms< fo<'

if has('unix') && executable('less')
  if !has('gui_running')
    command -buffer -nargs=1 SshconfigKeywordPrg
          \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' |
          \ redraw!
  elseif has('terminal')
    command -buffer -nargs=1 SshconfigKeywordPrg
          \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config'
  endif
  if exists(':SshconfigKeywordPrg') == 2
    setlocal iskeyword+=-
    setlocal keywordprg=:SshconfigKeywordPrg
    let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword< | sil! delc -buffer SshconfigKeywordPrg'
  endif
endif

let &cpo = s:cpo_save
unlet s:cpo_save