Skip to content

Instantly share code, notes, and snippets.

@haxpor
Created August 28, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haxpor/b57fee25bf6a7c7f56be78993f5c3953 to your computer and use it in GitHub Desktop.
Save haxpor/b57fee25bf6a7c7f56be78993f5c3953 to your computer and use it in GitHub Desktop.
patch for vim lightline (at bb0b401) be fix its non-updated col when use vim script to get function name https://vim.fandom.com/wiki/Show_what_function_the_cursor_is_in
diff --git a/autoload/lightline.vim b/autoload/lightline.vim
index 2076a11..6aab48f 100644
--- a/autoload/lightline.vim
+++ b/autoload/lightline.vim
@@ -106,7 +106,7 @@ let s:_lightline = {
\ 'paste': '%{&paste?"PASTE":""}', 'readonly': '%R', 'charvalue': '%b', 'charvaluehex': '%B',
\ 'spell': '%{&spell?&spelllang:""}', 'fileencoding': '%{&fenc!=#""?&fenc:&enc}', 'fileformat': '%{&ff}',
\ 'filetype': '%{&ft!=#""?&ft:"no ft"}', 'percent': '%3p%%', 'percentwin': '%P',
- \ 'lineinfo': '%3l:%-2v', 'line': '%l', 'column': '%c', 'close': '%999X X ', 'winnr': '%{winnr()}'
+ \ 'lineinfo': '%3l:%-2{col(".")}', 'line': '%l', 'column': '%c', 'close': '%999X X ', 'winnr': '%{winnr()}'
\ },
\ 'component_visible_condition': {
\ 'modified': '&modified||!&modifiable', 'readonly': '&readonly', 'paste': '&paste', 'spell': '&spell'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment