diff options
author | 2020-06-09 14:41:28 -0400 | |
---|---|---|
committer | 2020-06-09 14:41:28 -0400 | |
commit | 1702ce40cbcbfe53d9b57f3e9cde8ecfc441800a (patch) | |
tree | 98d3045b5e163a3755d9b48e16b3f4b63b1e04e1 /modules | |
parent | ada6a867c87be0ed746cdb94c28ff24f8288280c (diff) | |
download | textadept-1702ce40cbcbfe53d9b57f3e9cde8ecfc441800a.tar.gz textadept-1702ce40cbcbfe53d9b57f3e9cde8ecfc441800a.zip |
Prefer `view.call_tip_*` instead of `buffer.call_tip_*`.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/lua/ta_api | 14 | ||||
-rw-r--r-- | modules/lua/ta_tags | 10 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 6 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 2 |
4 files changed, 16 insertions, 16 deletions
diff --git a/modules/lua/ta_api b/modules/lua/ta_api index 6e352683..1f58a847 100644 --- a/modules/lua/ta_api +++ b/modules/lua/ta_api @@ -52,7 +52,7 @@ DEBUGGER_BREAKPOINT_ADDED events.DEBUGGER_BREAKPOINT_ADDED (string)\nEmitted whe DEBUGGER_BREAKPOINT_REMOVED events.DEBUGGER_BREAKPOINT_REMOVED (string)\nEmitted when a breakpoint is removed.\nThis is only emitted when the debugger is running and paused (e.g. at a\nbreakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`filename`_: The filename to remove a breakpoint from.\n* _`line`_: The 1-based line number to stop breaking on. DEBUGGER_COMMAND events.DEBUGGER_COMMAND (string)\nEmitted when a debugger command should be run.\nThis is only emitted when the debugger is running and paused (e.g. at a\nbreakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`text`_: The text of the command to run. DEBUGGER_CONTINUE events.DEBUGGER_CONTINUE (string)\nEmitted when a execution should be continued.\nThis is only emitted when the debugger is running and paused (e.g. at a\nbreakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`...`_: Any arguments passed to `debugger.continue()`. -DEBUGGER_INSPECT events.DEBUGGER_INSPECT (string)\nEmitted when a symbol should be inspected.\nDebuggers typically show a symbol's value in a calltip via\n`buffer:call_tip_show()`.\nThis is only emitted when the debugger is running and paused (e.g. at a\nbreakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`position`_: The buffer position of the symbol to inspect. The debugger\n responsible for identifying the symbol's name, as symbol characters vary\n from language to language. +DEBUGGER_INSPECT events.DEBUGGER_INSPECT (string)\nEmitted when a symbol should be inspected.\nDebuggers typically show a symbol's value in a calltip via\n`view:call_tip_show()`.\nThis is only emitted when the debugger is running and paused (e.g. at a\nbreakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`position`_: The buffer position of the symbol to inspect. The debugger\n responsible for identifying the symbol's name, as symbol characters vary\n from language to language. DEBUGGER_PAUSE events.DEBUGGER_PAUSE (string)\nEmitted when execution should be paused.\nThis is only emitted when the debugger is running and executing (e.g. not\nat a breakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`...`_: Any arguments passed to `debugger.pause()`. DEBUGGER_RESTART events.DEBUGGER_RESTART (string)\nEmitted when execution should restart from the beginning.\nThis is only emitted when the debugger is running.\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`...`_: Any arguments passed to `debugger.restart()`. DEBUGGER_SET_FRAME events.DEBUGGER_SET_FRAME (string)\nEmitted when a stack frame should be switched to.\nThis is only emitted when the debugger is running and paused (e.g. at a\nbreakpoint).\nArguments:\n\n* _`lexer`_: The lexer name of the language being debugged.\n* _`level`_: The 1-based stack level number to switch to. This value\n depends on the stack levels given to `debugger.update_state()`. @@ -266,7 +266,7 @@ STYLE_BRACEBAD lexer.STYLE_BRACEBAD (string)\nThe style used for unmatched brace STYLE_BRACEBAD view.STYLE_BRACEBAD (number, Read-only)\n STYLE_BRACELIGHT lexer.STYLE_BRACELIGHT (string)\nThe style used for highlighted brace characters. STYLE_BRACELIGHT view.STYLE_BRACELIGHT (number, Read-only)\n -STYLE_CALLTIP lexer.STYLE_CALLTIP (string)\nThe style used by call tips if `buffer.call_tip_use_style` is set.\nOnly the font name, size, and color attributes are used. +STYLE_CALLTIP lexer.STYLE_CALLTIP (string)\nThe style used by call tips if `view.call_tip_use_style` is set.\nOnly the font name, size, and color attributes are used. STYLE_CALLTIP view.STYLE_CALLTIP (number, Read-only)\n STYLE_CLASS lexer.STYLE_CLASS (string)\nThe style typically used for class definitions. STYLE_COMMENT lexer.STYLE_COMMENT (string)\nThe style typically used for code comments. @@ -441,14 +441,14 @@ buffer view.buffer (table)\nThe buffer the view contains. (Read-only) bufstatusbar_text ui.bufstatusbar_text (string, Write-only)\nThe text displayed in the buffer statusbar. build textadept.run.build(root_directory)\nBuilds the project whose root path is *root_directory* or the current project\nusing the shell command from the `build_commands` table.\nIf a "makefile" type of build file is found, prompts the user for the full\nbuild command.\nThe current project is determined by either the buffer's filename or the\ncurrent working directory.\nEmits `BUILD_OUTPUT` events.\n@param root_directory The path to the project to build. The default value is\n the current project.\n@see build_commands\n@see _G.events build_commands textadept.run.build_commands (table)\nMap of project root paths and "makefiles" to their associated "build" shell\ncommand line strings or functions that return such strings.\nFunctions may also return a working directory to operate in. By default, it\nis the project's root directory. -call_tip_active buffer.call_tip_active(buffer)\nReturns whether or not a call tip is visible.\n@param buffer A buffer.\n@return bool -call_tip_cancel buffer.call_tip_cancel(buffer)\nRemoves a call tip from view.\n@param buffer A buffer. +call_tip_active view.call_tip_active(view)\nReturns whether or not a call tip is visible.\n@param view A view.\n@return bool +call_tip_cancel view.call_tip_cancel(view)\nRemoves a call tip from view.\n@param view A view. call_tip_fore_hlt view.call_tip_fore_hlt (number, Write-only)\nA call tip's highlighted text foreground color, in "0xBBGGRR" format. -call_tip_pos_start buffer.call_tip_pos_start (number, Write-only)\nThe position in which backspacing beyond it hides a visible call tip. -call_tip_pos_start buffer.call_tip_pos_start(buffer)\nReturns a call tip's display position.\n@param buffer A buffer.\n@return number +call_tip_pos_start view.call_tip_pos_start (number, Write-only)\nThe position in which backspacing beyond it hides a visible call tip. +call_tip_pos_start view.call_tip_pos_start(view)\nReturns a call tip's display position.\n@param view A view.\n@return number call_tip_position view.call_tip_position (boolean)\nDisplay a call tip above the current line instead of below it.\nThe default value is `false`. call_tip_set_hlt view.call_tip_set_hlt(view, start_pos, end_pos)\nHighlights a call tip's text between positions *start_pos* to *end_pos* with\nthe color `view.call_tip_fore_hlt`.\n@param view A view.\n@param start_pos The start position in a call tip text to highlight.\n@param end_pos The end position in a call tip text to highlight. -call_tip_show buffer.call_tip_show(buffer, pos, text)\nDisplays a call tip at position *pos* with string *text* as the call tip's\ncontents.\nAny "\001" or "\002" bytes in *text* are replaced by clickable up or down\narrow visuals, respectively. These may be used to indicate that a symbol has\nmore than one call tip, for example.\n@param buffer A buffer.\n@param pos The position in *buffer* to show a call tip at.\n@param text The call tip text to show. +call_tip_show view.call_tip_show(view, pos, text)\nDisplays a call tip at position *pos* with string *text* as the call tip's\ncontents.\nAny "\001" or "\002" bytes in *text* are replaced by clickable up or down\narrow visuals, respectively. These may be used to indicate that a symbol has\nmore than one call tip, for example.\n@param view A view.\n@param pos The position in *view*'s buffer to show a call tip at.\n@param text The call tip text to show. call_tip_use_style view.call_tip_use_style (number)\nThe pixel width of tab characters in call tips.\nWhen non-zero, also enables the use of style number `view.STYLE_CALLTIP`\ninstead of `view.STYLE_DEFAULT` for call tip styles.\nThe default value is `0`. can_redo buffer.can_redo(buffer)\nReturns whether or not there is an action to be redone.\n@param buffer A buffer.\n@return bool can_undo buffer.can_undo(buffer)\nReturns whether or not there is an action to be undone.\n@param buffer A buffer.\n@return bool diff --git a/modules/lua/ta_tags b/modules/lua/ta_tags index 212f034b..85a63c22 100644 --- a/modules/lua/ta_tags +++ b/modules/lua/ta_tags @@ -449,14 +449,14 @@ buffer _HOME/core/init.lua /^local buffer$/;" t bufstatusbar_text _HOME/core/ui.lua /^module('ui')]]$/;" F class:ui build _HOME/modules/textadept/run.lua /^function M.build(root_directory)$/;" f class:textadept.run build_commands _HOME/modules/textadept/run.lua /^M.build_commands = {--[[Ant]]['build.xml']='ant',--[[Dockerfile]]Dockerfile='docker build .',--[[Make]]Makefile='make',GNUmakefile='make',makefile='make',--[[Maven]]['pom.xml']='mvn',--[[Ruby]]Rakefile='rake'}$/;" t class:textadept.run -call_tip_active _HOME/core/.buffer.luadoc /^function call_tip_active(buffer) end$/;" f class:buffer -call_tip_cancel _HOME/core/.buffer.luadoc /^function call_tip_cancel(buffer) end$/;" f class:buffer +call_tip_active _HOME/core/.view.luadoc /^function call_tip_active(view) end$/;" f class:view +call_tip_cancel _HOME/core/.view.luadoc /^function call_tip_cancel(view) end$/;" f class:view call_tip_fore_hlt _HOME/core/.view.luadoc /^module('view')$/;" F class:view -call_tip_pos_start _HOME/core/.buffer.luadoc /^function call_tip_pos_start(buffer) end$/;" f class:buffer -call_tip_pos_start _HOME/core/.buffer.luadoc /^module('buffer')$/;" F class:buffer +call_tip_pos_start _HOME/core/.view.luadoc /^function call_tip_pos_start(view) end$/;" f class:view +call_tip_pos_start _HOME/core/.view.luadoc /^module('view')$/;" F class:view call_tip_position _HOME/core/.view.luadoc /^module('view')$/;" F class:view call_tip_set_hlt _HOME/core/.view.luadoc /^function call_tip_set_hlt(view, start_pos, end_pos) end$/;" f class:view -call_tip_show _HOME/core/.buffer.luadoc /^function call_tip_show(buffer, pos, text) end$/;" f class:buffer +call_tip_show _HOME/core/.view.luadoc /^function call_tip_show(view, pos, text) end$/;" f class:view call_tip_use_style _HOME/core/.view.luadoc /^module('view')$/;" F class:view can_redo _HOME/core/.buffer.luadoc /^function can_redo(buffer) end$/;" f class:buffer can_undo _HOME/core/.buffer.luadoc /^function can_undo(buffer) end$/;" f class:buffer diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index d0331965..45b6e7d2 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -688,7 +688,7 @@ local api_docs -- @see api_files -- @see buffer.word_chars function M.show_documentation(pos, case_insensitive) - if buffer:call_tip_active() then events.emit(events.CALL_TIP_CLICK) return end + if view:call_tip_active() then events.emit(events.CALL_TIP_CLICK) return end local api_files = M.api_files[buffer:get_lexer(true)] if not api_files then return end if not assert_type(pos, 'number/nil', 1) then pos = buffer.current_pos end @@ -738,7 +738,7 @@ function M.show_documentation(pos, case_insensitive) end api_docs[i] = doc end - buffer:call_tip_show(pos, api_docs[api_docs.i]) + view:call_tip_show(pos, api_docs[api_docs.i]) end -- Cycle through apidoc calltips. events.connect(events.CALL_TIP_CLICK, function(position) @@ -749,7 +749,7 @@ events.connect(events.CALL_TIP_CLICK, function(position) elseif api_docs.i < 1 then api_docs.i = #api_docs end - buffer:call_tip_show(api_docs.pos, api_docs[api_docs.i]) + view:call_tip_show(api_docs.pos, api_docs[api_docs.i]) end) return M diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index c998ade6..19262ca6 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -257,7 +257,7 @@ local default_menubar = { "'%s' (U+%04X:%s)\n%s %s\n%s %s (%d)", char, utf8.codepoint(char), bytes, _L['Lexer'], buffer:get_lexer(true), _L['Style'], buffer:name_of_style(style), style) - buffer:call_tip_show(buffer.current_pos, text) + view:call_tip_show(buffer.current_pos, text) end} }, { |