Giter Club home page Giter Club logo

current-func-info.vim's People

Contributors

aereal avatar athom avatar davidosomething avatar goldsteine avatar mnishz avatar satchinjoshi avatar somini avatar tyru avatar uplus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

current-func-info.vim's Issues

Vim died of this plugin

Sometimes this plugin just makes the vim died within my terminal. I was using this plugin on my C sources.

vim --noplugin で起動してファイルを開くとエラーになる

ftpluginの挙動をよく理解していないので見当違いなことを言っているかもしれませんが、
ftplugin/vim/cfi.vim#5などで、
if g:cfi_disable || get(g:, 'loaded_cfi_ftplugin_vim') の判定で !exists('g:loaded_cfi') の判定をしていないため、
gvim --noplugin などで foo.vim などのファイルを開いたときにエラーが表示されてしまいます。

これは~.vimファイルを:editしたときのですが、エラーメッセージは以下のようなものです。

行    6:
E121: 未定義の変数です: g:cfi_disable
E15: 無効な式です: g:cfi_disable || get(g:, 'loaded_cfi_ftplugin_vim')

以下のような修正でエラーが出なくなったことは確認しています。

if !exists('g:loaded_cfi') || g:cfi_disable || get(g:, 'loaded_cfi_ftplugin_vim')
    finish
endif

[C] Function wrongly detected

In a code like this :

#include <stdio.h>                                                                   
#include <stdlib.h>                                                                  

struct ooo {                                                                         
  int a;                                                                             
};                                                                                   

int function()                                                                       
{                                                                                    
  return 0;                                                                          
}                                                                                    

int main(int argc, char **argv)                                                      
{                                                                                    
  struct ooo my_ooo;                                                                 

  my_ooo.a = 1;                                                                      

  return EXIT_SUCCESS;                                                               
}

when I place the cursor on the ";" after struct foo I get for the function name : "function()" which is obviously incorrect.

関数名を変更した場合 cfi#get_func_name() が変更前の関数名を返す

関数名を変更した場合に cfi#get_func_name() が変更前の関数名を返しました。
filetype=vim で再現を確認。

再現手順

  1. 関数内で cfi#get_func_name() を呼ぶ
  2. その関数の名前を変更する
  3. 再度、同じ関数内でcfi#get_func_name() を呼ぶ
  4. 変更前の関数名が返ってくる

備考

  1. の後に別の関数内で cfi#get_func_name() を呼び出した後に 3. を行うと正しい関数名(変更後の関数名)が返ってきます。

cfi#format()をstatuslineに表示した状態で.cファイルをvimdiffで開くとカーソルが動かせなくなってしまう

https://twitter.com/#!/eldesh/status/116697621569089536

@tyru current-func-info.vim を使わせてもらってます。多分バグだと思うんですが、cfi# format をstatuslineに表示した状態で.cファイルをvimdiffで開くとカーソルが動かせなくなってしまいます。

https://twitter.com/#!/eldesh/status/116714444649803776

@tyru Kaoriya.Vim73 で.vimrcをstatusline設定とBundle 'tyru/current-func-info.vim'のみにして確認しました。let line='%{cfi#format("[%s()]","[global]")}'です。

https://twitter.com/#!/eldesh/status/116716639994650624

@tyru 再現したコードですwこれと全く同じファイルをdiffsplitで開くとカーソルが4行目以降に移動できないです ideone.com/6nHcA

関数内で関数を定義しいている場合に正しく関数名が取得できない

次のように関数内で関数を定義しいている場合に正しく関数名が取得できませんでした。

function! s:func()
    " この位置にカーソルがある場合は s:func() 名が取得できる
    let dict = {}
    function! dict.func()

    endfunction
    " この位置にカーソルがある場合は s:func() 名が取得できない
endfunction
function! s:func()
    " この位置にカーソルがある場合は s:func() 名が取得できる
    function! s:func2()

    endfunction
    " この位置にカーソルがある場合は s:func() 名が取得できる
endfunction

Add return type and args

Currently get_func_name() only returns the function name.

It would be great if it also returns "return type" of the function & the arguments, I mainly thinking here for C code.

Implement Negative Cache

When walking buffer where cfi#get_func_name() returns empty string,
and editing huge source code (like src/eval.c in Vim's source code),
it little bit takes a time to move cursor.
To solve this problem, implement negative cache not only positive cache.

Showing wrong function name

Consider the following:

screen shot 2018-10-02 at 16 54 38

cfi#format("%s", "") will return save. It always shows the function above, not exactly the one the cursor is inside.

Is there a way to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.