Mercurial > vim
view runtime/compiler/pandoc.vim @ 34977:74f789d0adb1 v9.1.0344
patch 9.1.0344: Cursor wrong after using setcellwidth() in terminal
Commit: https://github.com/vim/vim/commit/e20fa59903525e15cecd680a2f32ece8a5d1bc0c
Author: mikoto2000 <mikoto2000@gmail.com>
Date: Wed Apr 17 22:06:54 2024 +0200
patch 9.1.0344: Cursor wrong after using setcellwidth() in terminal
Problem: Cursor wrong after using setcellwidth() in terminal
(mikoto2000)
Solution: output additional spaces, so the behaviour matches the GUI
(mikoto2000)
fixes: #14539
closes: #14540
Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Fix CUI `setcellwidths` characters draw behavior to same GUI behavior.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 17 Apr 2024 22:15:02 +0200 |
parents | 5db8640e391b |
children | b0022c9aff0d |
line wrap: on
line source
" Vim compiler file " Compiler: Pandoc " Maintainer: Konfekt " " Expects output file extension, say `:make html` or `:make pdf`. " Passes additional arguments to pandoc, say `:make html --self-contained`. if exists("current_compiler") finish endif let s:keepcpo = &cpo set cpo&vim let current_compiler = 'pandoc' " As of 2024-04-08 pandoc supports the following text input formats with " an ftplugin on Github: let s:supported_filetypes = \ [ 'bibtex', 'markdown', 'creole', 'json', 'csv', 'tsv', 'docbook', \ 'xml', 'fb2', 'html', 'jira', 'tex', 'mediawiki', 'nroff', 'org', \ 'rtf', 'rst', 't2t', 'textile', 'twiki', 'typst', 'vimwiki' ] " .. and out of those the following are included in Vim's runtime: " 'xml', 'tex', 'html', 'rst', 'json', 'nroff', 'markdown' silent! function s:PandocFiletype(filetype) abort let ft = a:filetype if ft ==# 'pandoc' return 'markdown' elseif ft ==# 'tex' return 'latex' elseif ft ==# 'xml' " Pandoc does not support XML as a generic input format, but it does support " EndNote XML and Jats XML out of which the latter seems more universal. return 'jats' elseif ft ==# 'text' || empty(ft) return 'markdown' elseif index(s:supported_filetypes, &ft) >= 0 return ft else echomsg 'Unsupported filetype: ' . ft . ', falling back to Markdown as input format!' return 'markdown' endif endfunction execute 'CompilerSet makeprg=pandoc\ --standalone' . \ '\ --metadata\ title=%:t:r:S' . \ '\ --metadata\ lang=' . matchstr(&spelllang, '^\a\a') . \ '\ --from=' . s:PandocFiletype(&filetype) . \ '\ ' . escape(get(b:, 'pandoc_compiler_args', get(g:, 'pandoc_compiler_args', '')), ' ') . \ '\ --output\ %:r:S.$*\ %:S' CompilerSet errorformat="%f",\ line\ %l:\ %m let &cpo = s:keepcpo unlet s:keepcpo