About: Display the name of the function you are editing   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

I implemented another way to look for the name of the current function in c_stl.vim (http://hermitte.free.fr/vim/ressources/vimfiles/ftplugin/c/). However the search is very slow and time consuming when we try to guess the current function when there is no current function. I guess using :normal [[ could have been more effective. Using the preview windows instead of the statusline could be an option to think about (see previousWord.vim in the same place). I have modified the code from above to cater for test case below. Test case: Try place at "hihi" and "hoho" and call the function

AttributesValues
rdfs:label
  • Display the name of the function you are editing
rdfs:comment
  • I implemented another way to look for the name of the current function in c_stl.vim (http://hermitte.free.fr/vim/ressources/vimfiles/ftplugin/c/). However the search is very slow and time consuming when we try to guess the current function when there is no current function. I guess using :normal [[ could have been more effective. Using the preview windows instead of the statusline could be an option to think about (see previousWord.vim in the same place). I have modified the code from above to cater for test case below. Test case: Try place at "hihi" and "hoho" and call the function
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 1295(xsd:integer)
Category
  • C
Author
  • Alex Esplin
Complexity
  • intermediate
Created
  • 2006(xsd:integer)
ID
  • 1296(xsd:integer)
NEXT
  • 1297(xsd:integer)
Rating
  • 11(xsd:integer)
abstract
  • I implemented another way to look for the name of the current function in c_stl.vim (http://hermitte.free.fr/vim/ressources/vimfiles/ftplugin/c/). However the search is very slow and time consuming when we try to guess the current function when there is no current function. I guess using :normal [[ could have been more effective. Using the preview windows instead of the statusline could be an option to think about (see previousWord.vim in the same place). I have modified the code from above to cater for test case below. function! FunctionName() "set a mark at our current position normal mz "while foundcontrol == 1, keep looking up the line to find something that "isn't a control statement "find the previous '{' and get the line above it "if the line matches a control statement, set found control to 1 so "we can look farther back in the file for the beginning of the "actual function we are in let foundstr = "" let strArrow = "" let strList = ["while", "for", "if", "else", "try", "catch", "case"] let foundcontrol = 1 while (foundcontrol) "find the { in this {...} normal [{ normal k0 let tempstring = getline(".") let foundcontrol = 0 for item in strList let foundstridx=match(tempstring,item) if(foundstridx >= 0) let foundstr = strpart(tempstring, foundstridx, 30) . strArrow . foundstr let tempstring = "" let strArrow = " @@@ " let foundcontrol = 1 break endif endfor if (foundcontrol == 0) let foundstridx = match(tempstring, "(") if(foundstridx >= 0) "we may found a function "go back to where our original cursor located normal `z let tempstring = tempstring . strArrow . foundstr return tempstring else "may not be a function, just a inner block here let foundcontrol=1 endif endif endwhile return tempstring endfunction Test case: Try place at "hihi" and "hoho" and call the function function() { haha { hoho } case huhu: { hihi } }
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software