annotate runtime/indent/sshconfig.vim @ 31932:19648eb383d9 v9.0.1298

patch 9.0.1298: inserting register on the cmdline does not trigger incsearch Commit: https://github.com/vim/vim/commit/c4b7dec38292fe1cfad7aa5f244031fc6f7c7a09 Author: K.Takata <kentkt@csc.jp> Date: Fri Feb 10 21:38:44 2023 +0000 patch 9.0.1298: inserting register on the cmdline does not trigger incsearch Problem: Inserting a register on the command line does not trigger incsearch or update hlsearch. Solution: Have cmdline_insert_reg() return CMDLINE_CHANGED when appropriate and handle it correctly. (Ken Takata, closes #11960)
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Feb 2023 22:45:03 +0100
parents 74e3316c1d5a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20552
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Vim indent file
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 " Language: ssh config file
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " Maintainer: JasonKim <git@jasonk.me>
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " Last Change: 2020 May 16
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
6 if exists("b:did_indent")
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
7 finish
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 endif
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 let b:did_indent = 1
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
11 setlocal autoindent
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 setlocal indentexpr=GetSshconfigIndent(v:lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13 setlocal indentkeys=o,O,*<Return>,0=~host\ ,0=~match\ ,0#,!^F
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
14
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 let b:undo_indent = "setlocal autoindent< indentexpr< indentkeys<"
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
16
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 if exists("*GetSshconfigIndent")
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 finish
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 endif
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 function GetSshconfigIndent(lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
22 let sw = shiftwidth()
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
23 let prev_lnum = prevnonblank(a:lnum - 1)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24 let curr_lnum = a:lnum
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
25 let prev_line = getline(prev_lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 let curr_line = getline(curr_lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 if curr_line =~? '^\s*\(host\|match\)\s'
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 return 0
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 elseif prev_line =~? '^\s*\(host\|match\)\s'
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30 return sw
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
31 else
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 return indent(prev_lnum)
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 endif
74e3316c1d5a Update runtime files
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 endfunction