Mercurial > vim
comparison runtime/autoload/dist/man.vim @ 32836:f0854888250f
man.vim: Uniformly place cursor at the same column with `Ctrl-t` (#12608)
Commit: https://github.com/vim/vim/commit/6e5ab2b994c3356fe91e8f9b701df52146fc0985
Author: goweol <goweol@gmail.com>
Date: Fri Aug 18 06:12:42 2023 +0900
man.vim: Uniformly place cursor at the same column with `Ctrl-t` (https://github.com/vim/vim/issues/12608)
Functions col and cursor count each tab (0x9) as a byte, and
are complementary. On the other hand, the | command motion
takes into consideration how many screen columns a tab does
occupy and may move cursor to a column closer to the start
of line than col would report at that position.
The provided changes prefer the cursor function to the | command.
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Aug 2023 23:15:05 +0200 |
parents | 0eef32b4ebbc |
children | 050794aa4ef2 |
comparison
equal
deleted
inserted
replaced
32835:0462178b7bf2 | 32836:f0854888250f |
---|---|
1 " Vim filetype plugin autoload file | 1 " Vim filetype plugin autoload file |
2 " Language: man | 2 " Language: man |
3 " Maintainer: Jason Franklin <vim@justemail.net> | 3 " Maintainer: Jason Franklin <vim@justemail.net> |
4 " Maintainer: SungHyun Nam <goweol@gmail.com> | 4 " Maintainer: SungHyun Nam <goweol@gmail.com> |
5 " Autoload Split: Bram Moolenaar | 5 " Autoload Split: Bram Moolenaar |
6 " Last Change: 2022 Jun 18 | 6 " Last Change: 2023 Jun 28 |
7 | 7 |
8 let s:cpo_save = &cpo | 8 let s:cpo_save = &cpo |
9 set cpo-=C | 9 set cpo-=C |
10 | 10 |
11 let s:man_tag_depth = 0 | 11 let s:man_tag_depth = 0 |
178 if s:man_tag_depth > 0 | 178 if s:man_tag_depth > 0 |
179 let s:man_tag_depth = s:man_tag_depth - 1 | 179 let s:man_tag_depth = s:man_tag_depth - 1 |
180 exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth | 180 exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth |
181 exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth | 181 exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth |
182 exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth | 182 exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth |
183 | |
183 exec s:man_tag_buf."b" | 184 exec s:man_tag_buf."b" |
184 exec s:man_tag_lin | 185 call cursor(s:man_tag_lin, s:man_tag_col) |
185 exec "norm! ".s:man_tag_col."|" | 186 |
186 exec "unlet s:man_tag_buf_".s:man_tag_depth | 187 exec "unlet s:man_tag_buf_".s:man_tag_depth |
187 exec "unlet s:man_tag_lin_".s:man_tag_depth | 188 exec "unlet s:man_tag_lin_".s:man_tag_depth |
188 exec "unlet s:man_tag_col_".s:man_tag_depth | 189 exec "unlet s:man_tag_col_".s:man_tag_depth |
189 unlet s:man_tag_buf s:man_tag_lin s:man_tag_col | 190 unlet s:man_tag_buf s:man_tag_lin s:man_tag_col |
190 endif | 191 endif |