Comments (11)
instead of using a selfmade wordcount function, you can use the builtin wordcount()
function, which has been included in Vim 7.4.1042
from clever-f.vim.
Do you know which line causes the error? I could not find the code related to clever-f.vim in your gist.
At least it looks that you should use normal!
instead of normal
.
from clever-f.vim.
No, I'm not sure where the conflict is! I didn't write the function, I just found the gist. Changing it to normal!
is a good idea but doesn't fix the error.
Here's a simplified version of the function that still conflicts:
function! WordCount()
if line('$') == 1 && getline(1) == ''
return
elseif mode() == "i" || mode() == "n"
let s:old_status = v:statusmsg
exe "silent normal! g\<c-g>"
let b:word_count = str2nr(split(v:statusmsg)[11])
let v:statusmsg = s:old_status
endif
return b:word_count
endfunction
from clever-f.vim.
Thank you for reducing code. But I can still not identify the cause of this bug... Could you show me your status line configuration? I need to reproduce.
from clever-f.vim.
From .vimrc:
let mystatusline = ""
let mystatusline .= "\ %n\ %*" | " buffer number
let mystatusline .= "\ %<%F%*" | " full path
let mystatusline .= "\ %y%*" | " file type
let mystatusline .= " \%M" | " modified flag
let mystatusline .= "\ %#vimWarn#\%{(&key==\"\"?\"\":\"ENCR\")}%*" | " encrypted?
let mystatusline .= "\ \[%{v:register}\]" | " current register
let mystatusline .= "\ %{getcwd()} " " current working dir
let &statusline = mystatusline
autocmd FileType txt if &statusline !~ "WC: " | setlocal statusline+=\ \ WC:\ %{WordCount()}\
from clever-f.vim.
Thanks. I'll try it.
from clever-f.vim.
I could not see the error as below (it seems that it breaks cursor position when entering insert mode, but it looks not related to this issue)
from clever-f.vim.
Here's a longer set of error messages.
Error detected while processing function clever_f#find_with[12]..WordCount:
line 11:
E523: Not allowed here
Error detected while processing function clever_f#find_with[12]..WordCount:
line 17:
E684: list index out of range: 11
Error detected while processing function clever_f#find_with[12]..WordCount:
line 17:
E116: Invalid arguments for function str2nr(s:split_wc[11])
Error detected while processing function clever_f#find_with[12]..WordCount:
line 17:
E15: Invalid expression: str2nr(s:split_wc[11])
Error detected while processing function clever_f#find_with[12]..WordCount:
line 11:
E523: Not allowed here
Error detected while processing function clever_f#find_with[12]..WordCount:
line 17:
E684: list index out of range: 11
Error detected while processing function clever_f#find_with[12]..WordCount:
line 17:
E116: Invalid arguments for function str2nr(s:split_wc[11])
Error detected while processing function clever_f#find_with[12]..WordCount:
line 17:
E15: Invalid expression: str2nr(s:split_wc[11])
from clever-f.vim.
Amazing! Thanks, @chrisbra.
from clever-f.vim.
Thank you @chrisbra. @eater, did it solve this issue?
from clever-f.vim.
It looks it is a problem of implementation of the function WordCount()
. It seems to be called while clever-f.vim's f
is used because of status line update, but not related to this plugin directly. Closing this.
from clever-f.vim.
Related Issues (20)
- unmap T HOT 1
- Breaks lazyredraw HOT 7
- underline target characters without changing its color HOT 2
- Breaks macros HOT 4
- Clear highlights after timeout HOT 3
- `<Plug>(clever-f-reset)` doesn't reset highlight HOT 4
- Breaks macros after second press of t or f HOT 1
- Changing highlight color
- add number of character
- E523 in nvim_buf_set_lines HOT 5
- clever-f triggered by any use of f or t in normal mode HOT 1
- allow mark_direct across multiple lines
- Feature request: Option to fix key direction for `;` and `,`
- Feature Request: Reset highlights when <Esc> key is pressed HOT 2
- Recent commits to clear highlighting break basic functionality of clever-f HOT 2
- Feature request for highlighting available jumps
- Switch modes when appropriate
- support language-mappings
- [long shot feature request] Prefer the character focused by user's eye
- Enhancment: prevent clever-f from jumping outside of current line (typo ...) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clever-f.vim.