diff options
author | 2010-03-30 20:34:32 -0400 | |
---|---|---|
committer | 2010-03-30 20:34:32 -0400 | |
commit | 42f0f1427871c3533a797296d36ba481ee98975b (patch) | |
tree | 7e2d0716112ede1e2044f8d25033c376067bd79e /modules | |
parent | 07e233209961e5e557e50b379133161cde000c02 (diff) | |
download | textadept-42f0f1427871c3533a797296d36ba481ee98975b.tar.gz textadept-42f0f1427871c3533a797296d36ba481ee98975b.zip |
Removed support for api files.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/cpp/api | 135 | ||||
-rw-r--r-- | modules/cpp/commands.lua | 4 | ||||
-rw-r--r-- | modules/cpp/init.lua | 2 | ||||
-rw-r--r-- | modules/lua/api | 164 | ||||
-rw-r--r-- | modules/lua/commands.lua | 9 | ||||
-rw-r--r-- | modules/lua/init.lua | 2 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 56 |
7 files changed, 0 insertions, 372 deletions
diff --git a/modules/cpp/api b/modules/cpp/api deleted file mode 100644 index e5a54201..00000000 --- a/modules/cpp/api +++ /dev/null @@ -1,135 +0,0 @@ -abort() -abs(int n) -acos(double x) -asctime(const struct tm* tp) -asin(double x) -assert(int expression) -atan(double x) -atan2(double y, double x) -atexit(void (*fcm)(void)) -atof(const char* s) -atoi(const char* s) -atol(const char* s) -bsearch(const void* key, const void* base, size_t n, size_t size, int (*cmp)(const void* keyval, const void* datum)) -calloc(size_t nobj, size_t size) -ceil(double x) -clearerr(FILE* stream) -clock(void) -cos(double x) -cosh(double x) -ctime(const time_t* tp) -difftime(time_t time2, time_t time1) -div(int num, int denom) -exit(int status) -exp(double x) -fabs(double x) -fclose(FILE* stream) -feof(FILE* stream) -ferror(FILE* stream) -fflush(FILE* stream) -fgetc(FILE* stream) -fgetpos(FILE* stream, fpos_t* ptr) -fgets(char* s, int n, FILE* stream) -floor(double x) -fmod(double x, double y) -fopen(const char* filename, const char* mode) -fprintf(FILE* stream, const char* format, ...) -fputc(int c, FILE* stream) -fputs(const char* s, FILE* stream) -fread(void* ptr, size_t size, size_t nobj, FILE* stream) -free(void* p) -freopen(const char* filename, const char* mode, FILE* stream) -frexp(double x, int* exp) -fscanf(FILE* stream, const char* format, ...) -fseek(FILE* stream, long offset, int origin) -fsetpos(FILE* stream, const fpos_t* ptr) -ftell(FILE* stream) -fwrite(const void* ptr, size_t size, size_t nobj, FILE* stream) -getc(FILE* stream) -getchar(void) -getenv(const char* name) -gets(char* s) -gmtime(const time_t* tp) -isalnum(int c) -isalpha(int c) -iscntrl(int c) -isdigit(int c) -isgraph(int c) -islower(int c) -isprint(int c) -ispunct(int c) -isspace(int c) -isupper(int c) -isxdigit(int c) -labs(long n) -ldexp(double x, int n) -ldiv(long num, long denom) -localtime(const time_t* tp) -log(double x) -log10(double x) -malloc(size_t size) -memchr(const void* cs, int c, size_t n) -memcmp(const void* cs, const void* ct, size_t n) -memcpy(void* s, const void* ct, size_t n) -memmove(void* s, const void* ct, size_t n) -memset(void* s, int c, size_t n) -mktime(struct tm* tp) -modf(double x, double* ip) -perror(const char* s) -pow(double x, double y) -printf(const char* format, ...) -putc(int c, FILE* stream) -putchar(int c) -puts(const char* s) -qsort(void* base, size_t n, size_t size, int (*cmp)(const void*, const void*)) -raise(int sig) -rand(void) -realloc(void* p, size_t size) -remove(const char* filename) -rename(const char* oldname, const char* newname) -rewind(FILE* stream) -scanf(const char* format, ...) -setbuf(FILE* stream, char* buf) -setvbuf(FILE* stream, char* buf, int mode, size_t size) -sin(double x) -sinh(double x) -sprintf(char* s, const char* format, ...) -sqrt(double x) -srand(unsigned int seed) -sscanf(char* s, const char* format, ...) -strcat(char* s, const char* ct) -strchr(const char* cs, int c) -strcspn(const char* cs, const char* ct) -strcmp(const char* cs, const char* ct) -strcoll(const char* cs, const char* ct) -strcpy(char* s, const char* ct) -strerror(int n) -strftime(char* s, size_t smax, const char* fmt, const struct tm* tp) -strlen(const char* cs) -strncat(char* s, const char* ct, size_t n) -strncmp(const char* cs, const char* ct, size_t n) -strncpy(char* s, const char* ct, size_t n) -strpbrk(const char* cs, const char* ct) -strrchr(const char* cs, int c) -strspn(const char* cs, const char* ct) -strstr(const char* cs, const char* ct) -strtod(const char* s, char** endp) -strtok(char* s, const char* t) -strtol(const char* s, char** endp, int base) -strtoul(const char* s, char** endp, int base) -strxfrm(char* s, const char* ct, size_t n) -system(const char* s) -tan(double x) -tanh(double x) -time(time_t* tp) -tmpfile() -tmpname(char s[L_tmpnam]) -tolower(int c) -toupper(int c) -ungetc(int c, FILE* stream) -va_arg(va_list ap, type) -va_end(va_list ap) -va_start(va_list ap, lastarg) -vfprintf(FILE* stream, const char* format, va_list arg) -vprintf(const char* format, va_list arg) -vsprintf(char* s, const char* format, va_list arg) diff --git a/modules/cpp/commands.lua b/modules/cpp/commands.lua index 1ec6e94a..07ce0cac 100644 --- a/modules/cpp/commands.lua +++ b/modules/cpp/commands.lua @@ -21,9 +21,5 @@ if type(keys) == 'table' then buffer:add_text(';') buffer:new_line() end }, - ['('] = { function() - m_editing.show_call_tip(_m.cpp.api, true) - return false - end }, } end diff --git a/modules/cpp/init.lua b/modules/cpp/init.lua index 1937f930..5357712f 100644 --- a/modules/cpp/init.lua +++ b/modules/cpp/init.lua @@ -27,5 +27,3 @@ require 'cpp.snippets' function set_buffer_properties() end - -api = textadept.io.read_api_file(_HOME..'/modules/cpp/api', '%w_') diff --git a/modules/lua/api b/modules/lua/api deleted file mode 100644 index f26e0b16..00000000 --- a/modules/lua/api +++ /dev/null @@ -1,164 +0,0 @@ -_G () holds global environment, setfenv changes environments -_VERSION () current interpreter version "Lua 5.0" -assert (v [, message]) error if v nil or false, otherwise returns v -collectgarbage ([limit]) [Lua 5.0] set threshold to limit KBytes, default 0, may run GC -collectgarbage (opt [, arg]) [Lua 5.1] opts: stop, restart, collect, count, step, setpause, setstepmul -coroutine.create (f) creates coroutine from function f, returns coroutine -coroutine.resume (co, val1, ...) continues execution of co, returns bool status plus any values -coroutine.status (co) returns co status: "running", "suspended" or "dead" -coroutine.wrap (f) creates coroutine with body f, returns function that resumes co -coroutine.yield (val1, ...) suspend execution of calling coroutine -debug.debug () enters interactive debug mode, line with only "cont" terminates -debug.gethook () returns current hook function, hook mask, hook count -debug.getinfo (function [, what]) returns table with information about a function -debug.getlocal (level, local) returns name and value of local variable with index local at stack level -debug.getupvalue (func, up) returns name and value of upvalue with index up of function func -debug.sethook (hook, mask [, count]) sets given function as a hook, mask="[crl]" -debug.setlocal (level, local, value) sets local variable with index local at stack level with value -debug.setupvalue (func, up, value) sets upvalue with index up of function func with value -debug.traceback ([message]) returns a string with a traceback of the call stack -dofile (filename) executes as Lua chunk, default stdin, returns value -error (message [, level]) terminates protected func, never returns, level 1 (default), 2=parent -file:close () closes file -file:flush () saves any written data to file -file:lines () returns iterator function to return lines, nil ends -file:read (format1, ...) reads file according to given formats, returns read values or nil -file:seek ([whence] [, offset]) sets file pos, whence="set"|"cur"|"end", defaults "curr",0, returns file pos -file:write (value1, ...) writes strings or numbers to file -gcinfo () [Lua 5.0] returns dynamic mem in use (KB), and current GC threshold (KB) -getfenv (f) gets env, f can be a function or number (stack level, default=1), 0=global env -getmetatable (object) returns metatable of given object, otherwise nil -io.close ([file]) closes file, or the default output file -io.flush () flushes the default output file -io.input ([file]) opens file in text mode, sets as default input file, or returns current default input file -io.lines ([filename]) open file in read mode, returns iterator function to return lines, nil ends -io.open (filename [, mode]) opens file in specified mode "[rawb+]", returns handle or nil -io.output ([file]) opens file in text mode, sets as default output file, or returns current default output file -io.read (format1, ...) reads file according to given formats, returns read values or nil -io.stderr -io.stdin -io.stdout -io.tmpfile () returns a handle for a temporary file, opened in update mode -io.type (obj) returns "file" if obj is an open file handle, "close file" if closed, or nil if not a file handle -io.write (value1, ...) writes strings or numbers to file -ipairs (t) returns an iterator function, table t and 0 -loadfile (filename) loads chunk without execution, returns chunk as function, else nil plus error -loadlib (libname, funcname) [Lua 5.0] links to dynamic library libname, returns funcname as a C function -loadstring (string [, chunkname]) loads string as chunk, returns chunk as function, else nil plus error -math.abs (v) returns absolute value of v -math.acos (v) returns arc cosine value of v in radians -math.asin (v) returns arc sine value of v in radians -math.atan (v) returns arc tangent value of v in radians -math.atan2 (v1, v2) returns arc tangent value of v1/v2 in radians -math.ceil (v) returns smallest integer >= v -math.cos (rad) returns cosine value of angle rad -math.deg (rad) returns angle in degrees of radians rad -math.exp (v) returns e^v -math.floor (v) returns largest integer <= v -math.frexp (v) returns mantissa [0.5,1) and exponent values of v -math.ldexp (v1, v2) returns v1*2^v2 -math.log (v) returns natural logarithm of v -math.log10 (v) returns logarithm 10 of v -math.max (v1, ...) returns maximum in a list of one or more values -math.min (v1, ...) returns minimum in a list of one or more values -math.mod (v1, v2) [Lua 5.0] returns remainder of v1/v2 which is v1 - iV2 for some integer i -math.fmod (v1, v2) [Lua 5.1] returns remainder of v1/v2 which is v1 - iV2 for some integer i -math.pow (v1, v2) returns v1 raised to the power of v2 -math.rad (deg) returns angle in radians of degrees deg -math.random ([n [, u]]) returns random real [0,1), integer [1,n] or real [1,u] (with n=1) -math.randomseed (seed) sets seed for pseudo-random number generator -math.sin (rad) returns sine value of angle rad -math.sqrt (v) returns square root of v -math.tan (rad) returns tangent value of angle rad -next (table [, index]) returns next index,value pair, if index=nil (default), returns first index -package.cpath -package.loaded -package.loadlib(libname, funcname) [Lua 5.1] -package.path -package.preload -package.seeall(module) [Lua 5.1] -os.clock () returns CPU time used by program in seconds -os.date ([format [, time]]) returns a string or table containing date and time, "*t" returns a table -os.difftime (t2, t1) returns number of seconds from time t1 to time t2 -os.execute (command) executes command using C function system, returns status code -os.exit ([code]) terminates host program with optional code, default is success code -os.getenv (varname) returns value of environment variable varname. nil if not defined -os.remove (filename) deletes file with given name, nil if fails -os.rename (oldname, newname) renames file oldname to newname, nil if fails -os.setlocale (locale [, category]) set current locale of program, returns name of new locate or nil -os.time ([table]) returns current time (usually seconds) or time as represented by table -os.tmpname () returns a string with a filename for a temporary file (dangerous! tmpfile is better) -pairs (t) returns the next function and table t plus a nil, iterates over all key-value pairs -pcall (f, arg1, arg2, ...) protected mode call, catches errors, returns status code first (true=success) -print (e1, e2, ...) prints values to stdout using tostring -rawequal (v1, v2) non-metamethod v1==v2, returns boolean -rawget (table, index) non-metamethod get value of table[index], index != nil -rawset (table, index, value) non-metamethod set value of table[index], index != nil -require (packagename) loads package, updates _LOADED, returns boolean -setfenv (f, table) sets env, f can be a function or number (stack level, default=1), 0=global env -setmetatable (table, metatable) sets metatable, nil to remove metatable -string.byte (s [, i]) returns numerical code, nil if index out of range, default i=1 -string.char (i1, i2, ...) returns a string built from 0 or more integers -string.dump (function) returns binary representation of function, used with loadstring -string.find (s, pattern [, init [, plain]]) matches pattern in s, returns start,end indices, else nil -string.format (formatstring, e1, e2, ...) returns formatted string, printf-style -string.gfind (s, pat) [Lua 5.0] returns iterator function that returns next captures from pattern pat on s -string.gmatch (s, pat) [Lua 5.1] returns iterator function that returns next captures from pattern pat on s -string.gsub (s, pat, repl [, n]) returns copy of s with pat replaced by repl, and substitutions made -string.len (s) returns string length -string.lower (s) returns string with letters in lower case -string.rep (s, n) returns string with n copies of string s -string.sub (s, i [, j]) returns substring from index i to j of s, default j=-1 (string length) -string.upper (s) returns string with letters in upper case -table.concat (table [, sep [, i [, j]]]) returns concatenated table elements i to j separated by sep -table.foreach (table, f) [Lua 5.0] executes f(index,value) over all elements of table, returns first non-nil of f -table.foreachi (table, f) [Lua 5.0] executes f(index,value) in sequential order 1 to n, returns first non-nil of f -table.getn (table) returns size of table, or n field, or table.setn value, or 1 less first index with nil value\n [Deprecated in Lua 5.1, use # operator] -table.insert (table, [pos,] value) insert value at location pos in table, default pos=n+1 -table.remove (table [, pos]) removes element at pos from table, default pos=n -table.setn (table, n) [Lua 5.0] sets size of table, n field of table if it exists -table.sort (table [, comp]) sorts in-place elements 1 to n, comp(v1,v2) true if v1<v2, default < -tonumber (e [, base]) convert to number, returns number, nil if non-convertible, 2<=base<=36 -tostring (e) convert to string, returns string -type (v) returns type of v as a string -unpack (list) returns all elements from list -xpcall (f, err) pcall function f with new error handler err - -# lunit -lunit.assert (assertion, [msg]) Fails, if 'assertion' is false or nil. -lunit.assert_fail ([msg]) Always fails. -lunit.assert_true (actual, [msg]) Fails, if 'actual' isn't true. -lunit.assert_false (actual, [msg]) Fails, if 'actual' isn't false. (Even fails if 'actual' is a nil value!) -lunit.assert_equal (expected, actual, [msg]) Fails, if 'actual' is different from 'expected'. -lunit.assert_not_equal (unexpected, actual, [msg]) Fails, if 'actual' and 'unexpected' are equal. -lunit.assert_match (pattern, actual, [msg]) Fails, if the string 'actual' doesn't match 'pattern'. -lunit.assert_not_match (pattern, actual, [msg]) Fails, if the string 'actual' match 'pattern'. -lunit.assert_nil (actual, [msg]) Fails, if 'actual' isn't a nil value. -lunit.assert_not_nil (actual, [msg]) Fails, if 'actual' is a nil value. -lunit.assert_boolean (actual, [msg]) Fails, if 'actual' isn't true or false. -lunit.assert_not_boolean (actual, [msg]) Fails, if 'actual' is true or false. -lunit.assert_number (actual, [msg]) Fails, if 'actual' isn't a number. -lunit.assert_not_number (actual, [msg]) Fails, if 'actual' is a number. -lunit.assert_string (actual, [msg]) Fails, if 'actual' isn't a string. -lunit.assert_not_string (actual, [msg]) Fails, if 'actual' is a string. -lunit.assert_table (actual, [msg]) Fails, if 'actual' isn't a table. -lunit.assert_not_table (actual, [msg]) Fails, if 'actual' is a table. -lunit.assert_function (actual, [msg]) Fails, if 'actual' isn't a function. -lunit.assert_not_function (actual, [msg]) Fails, if 'actual' is a function. -lunit.assert_thread (actual, [msg]) Fails, if 'actual' isn't a thread (created by coroutine.create or coroutine.wrap). -lunit.assert_not_thread (actual, [msg]) Fails, if 'actual' is a thread. -lunit.assert_userdata (actual, [msg]) Fails, if 'actual' isn't userdata. -lunit.assert_not_userdata (actual, [msg]) Fails, if 'actual' is userdata. -lunit.assert_error ([msg], func) Fails, if 'func' doesn't raises an error (using error ()). -lunit.assert_pass ([msg], func) Fails, if 'func' raises an error. -lunit.is_nil (actual) -lunit.is_boolean (actual) -lunit.is_number (actual) -lunit.is_string (actual) -lunit.is_table (actual) -lunit.is_function (actual) -lunit.is_thread (actual) -lunit.is_userdata (actual) -lunit.run () Run all testcases -lunit.wrap (func) Wrap a single function to form a independent testcase -lunit.TestCase (description) Group related tests into a testcase object diff --git a/modules/lua/commands.lua b/modules/lua/commands.lua index 56fb7d81..ee6cbbe5 100644 --- a/modules/lua/commands.lua +++ b/modules/lua/commands.lua @@ -77,14 +77,5 @@ if type(keys) == 'table' then g = { goto_required }, }, ['s\n'] = { try_to_autocomplete_end }, - ['('] = { - function() - buffer.word_chars = - '_.:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' - m_editing.show_call_tip(_m.lua.api, true) - buffer:set_chars_default() - return false - end - }, } end diff --git a/modules/lua/init.lua b/modules/lua/init.lua index a744fba8..b52d41f7 100644 --- a/modules/lua/init.lua +++ b/modules/lua/init.lua @@ -27,5 +27,3 @@ require 'lua.snippets' function set_buffer_properties() end - -api = textadept.io.read_api_file(_HOME..'/modules/lua/api', '%w_.:') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 2f9a7f3b..553bc824 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -189,62 +189,6 @@ function autocomplete_word(word_chars) end --- --- Displays a call tip based on the word to the left of the cursor and a given --- API table. --- @param api Table of functions call tips can be displayed for. Each key is a --- function name, and each value is a table of tables. Each of those tables --- represents a function. It has 2 indexes: parameters and a description. --- This enables call tips for 'overloaded' functions. Even if there is just --- one function, it must be enclosed in a table. You can get an API table --- from a file via textadept.io.read_api_file(). --- @param start Flag indicating whether or not to start a call tip. If the user --- clicks an arrow, you should call show_call_tip again with this value being --- false to display the next function. --- @see textadept.io.read_api_file -function show_call_tip(api, start) - local buffer = buffer - local funcs - local call_tip = '' - if start then - local s = buffer:word_start_position(buffer.current_pos - 1, true) - local word = buffer:text_range(s, buffer.current_pos) - funcs = api[word] - if not funcs then return end - if #funcs > 1 then call_tip = call_tip..'\001' end - current_call_tip = { - name = word, - num = 1, - max = #funcs, - start_pos = buffer.current_pos, - ['api'] = api - } - elseif buffer:call_tip_active() and current_call_tip.max > 1 then - call_tip = call_tip..'\001' - funcs = api[current_call_tip.name] - else - return - end - local func = funcs[current_call_tip.num] - local name = current_call_tip.name - local params = func[1] - local desc = #funcs == 1 and func[2] or '\002'..func[2] - call_tip = call_tip..name..params..'\n'..desc:gsub('\\n', '\n') - buffer:call_tip_show(current_call_tip.start_pos, call_tip) -end - -textadept.events.add_handler('call_tip_click', - function(position) -- display the next or previous call tip - if not buffer:call_tip_active() then return end - if position == 1 and current_call_tip.num > 1 then - current_call_tip.num = current_call_tip.num - 1 - show_call_tip(current_call_tip.api, false) - elseif position == 2 and current_call_tip.num < current_call_tip.max then - current_call_tip.num = current_call_tip.num + 1 - show_call_tip(current_call_tip.api, false) - end - end) - ---- -- Block comments or uncomments code with a given comment string. -- @param comment The comment string inserted or removed from the beginning of -- each line in the selection. |