diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | core/.buffer.luadoc | 30 | ||||
-rw-r--r-- | core/.view.luadoc | 30 | ||||
-rw-r--r-- | doc/manual.md | 2 | ||||
-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 | ||||
-rw-r--r-- | test/test.lua | 24 |
9 files changed, 60 insertions, 61 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d334783f..a59d9f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2444,7 +2444,7 @@ Changes: * Updated LaTeX and Go lexers. * Scintilla: added [`buffer:drop_selection_n()`][] for dropping a multiple selection. -* Scintilla: added [`buffer.call_tip_pos_start`][] for altering call tip +* Scintilla: added `buffer.call_tip_pos_start` for altering call tip backspace behavior. * Scintilla: added `buffer.MARK_BOOKMARK` marker symbol. * Scintilla: better marker drawing. @@ -2462,7 +2462,6 @@ Changes: [PGP -- 7.2 beta Modules]: download/textadept_7.2_beta.modules.zip.asc [inputdialogs]: api.html#ui.dialogs.inputbox [`buffer:drop_selection_n()`]: api.html#buffer.drop_selection_n -[`buffer.call_tip_pos_start`]: api.html#buffer.call_tip_pos_start [Scintilla]: http://scintilla.org ## 7.2 alpha (01 Jan 2014) diff --git a/core/.buffer.luadoc b/core/.buffer.luadoc index 74b65f56..2fc44a69 100644 --- a/core/.buffer.luadoc +++ b/core/.buffer.luadoc @@ -100,8 +100,6 @@ -- @field back_space_un_indents (bool) -- Un-indent text when backspacing within indentation. -- The default value is `false`. --- @field call_tip_pos_start (number, Write-only) --- The position in which backspacing beyond it hides a visible call tip. -- @field caret_sticky (number) -- The caret's preferred horizontal position when moving between lines. -- @@ -547,34 +545,6 @@ function begin_undo_action(buffer) end function brace_match(buffer, pos, max_re_style) end --- --- Returns whether or not a call tip is visible. --- @param buffer A buffer. --- @return bool -function call_tip_active(buffer) end - ---- --- Removes a call tip from view. --- @param buffer A buffer. -function call_tip_cancel(buffer) end - ---- --- Returns a call tip's display position. --- @param buffer A buffer. --- @return number -function call_tip_pos_start(buffer) end - ---- --- Displays a call tip at position *pos* with string *text* as the call tip's --- contents. --- Any "\001" or "\002" bytes in *text* are replaced by clickable up or down --- arrow visuals, respectively. These may be used to indicate that a symbol has --- more than one call tip, for example. --- @param buffer A buffer. --- @param pos The position in *buffer* to show a call tip at. --- @param text The call tip text to show. -function call_tip_show(buffer, pos, text) end - ---- -- Returns whether or not there is an action to be redone. -- @param buffer A buffer. -- @return bool diff --git a/core/.view.luadoc b/core/.view.luadoc index 29c902c2..4d0cceb3 100644 --- a/core/.view.luadoc +++ b/core/.view.luadoc @@ -58,6 +58,8 @@ -- longest item. -- @field call_tip_fore_hlt (number, Write-only) -- A call tip's highlighted text foreground color, in "0xBBGGRR" format. +-- @field call_tip_pos_start (number, Write-only) +-- The position in which backspacing beyond it hides a visible call tip. -- @field call_tip_position (boolean) -- Display a call tip above the current line instead of below it. -- The default value is `false`. @@ -967,6 +969,23 @@ function brace_highlight(view, pos1, pos2) end function brace_highlight_indicator(view, use_indicator, indicator) end --- +-- Returns whether or not a call tip is visible. +-- @param view A view. +-- @return bool +function call_tip_active(view) end + +--- +-- Removes a call tip from view. +-- @param view A view. +function call_tip_cancel(view) end + +--- +-- Returns a call tip's display position. +-- @param view A view. +-- @return number +function call_tip_pos_start(view) end + +--- -- Highlights a call tip's text between positions *start_pos* to *end_pos* with -- the color `view.call_tip_fore_hlt`. -- @param view A view. @@ -975,6 +994,17 @@ function brace_highlight_indicator(view, use_indicator, indicator) end function call_tip_set_hlt(view, start_pos, end_pos) end --- +-- Displays a call tip at position *pos* with string *text* as the call tip's +-- contents. +-- Any "\001" or "\002" bytes in *text* are replaced by clickable up or down +-- arrow visuals, respectively. These may be used to indicate that a symbol has +-- more than one call tip, for example. +-- @param view A view. +-- @param pos The position in *view*'s buffer to show a call tip at. +-- @param text The call tip text to show. +function call_tip_show(view, pos, text) end + +--- -- Clears all images registered using `view.register_image()` and -- `view.register_rgba_image()`. -- @param view A view. diff --git a/doc/manual.md b/doc/manual.md index c5cc71ed..0021e971 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -2117,7 +2117,7 @@ need to be updated and will continue to function normally_. The following "Find" regex can be used to help convert `buffer.*` functionality to `view.*`: <pre style="word-wrap: break-word;"> -<code>(\w+)([.:])\b(additional_caret_fore|additional_carets_blink|additional_carets_visible|additional_sel_alpha|additional_sel_back|additional_sel_fore|all_lines_visible|annotation_visible|auto_c_max_height|auto_c_max_width|call_tip_fore_hlt|call_tip_position|call_tip_use_style|caret_fore|caret_line_back|caret_line_back_alpha|caret_line_frame|caret_line_visible|caret_line_visible_always|caret_period|caret_style|caret_width|cursor|edge_colour|edge_column|edge_mode|end_at_last_line|extra_ascent|extra_descent|first_visible_line|fold_display_text_style|fold_expanded|fold_flags|h_scroll_bar|highlight_guide|idle_styling|indentation_guides|indic_alpha|indic_fore|indic_hover_fore|indic_hover_style|indic_outline_alpha|indic_style|indic_under|line_visible|lines_on_screen|margins|margin_back_n|margin_cursor_n|margin_left|margin_mask_n|margin_options|margin_right|margin_sensitive_n|margin_type_n|margin_width_n|marker_alpha|marker_back|marker_back_selected|marker_fore|mouse_dwell_time|mouse_selection_rectangular_switch|property|property_expanded|property_int|rectangular_selection_modifier|representation|rgba_image_height|rgba_image_scale|rgba_image_width|scroll_width|scroll_width_tracking|sel_alpha|sel_eol_filled|size|style_back|style_bold|style_case|style_changeable|style_eol_filled|style_font|style_fore|style_italic|style_size|style_underline|style_visible|tab_draw_mode|v_scroll_bar|view_eol|view_ws|whitespace_size|wrap_indent_mode|wrap_mode|wrap_start_indent|wrap_visual_flags|wrap_visual_flags_location|x_offset|zoom|ANNOTATION_BOXED|ANNOTATION_HIDDEN|ANNOTATION_STANDARD|ANNOTATION_INDENTED|CARETSTYLE_BLOCK|CARETSTYLE_INVISIBLE|CARETSTYLE_LINE|CARET_EVEN|CARET_JUMPS|CARET_SLOP|CARET_STRICT|EDGE_BACKGROUND|EDGE_LINE|EDGE_MULTILINE|EDGE_NONE|FOLDACTION_CONTRACT|FOLDACTION_EXPAND|FOLDACTION_TOGGLE|FOLDDISPLAYTEXT_HIDDEN|FOLDDISPLAYTEXT_STANDARD|FOLDDISPLAYTEXT_BOXED|INDIC_BOX|INDIC_COMPOSITIONTHICK|INDIC_COMPOSITIONTHIN|INDIC_DASH|INDIC_DIAGONAL|INDIC_DOTBOX|INDIC_DOTS|INDIC_FULLBOX|INDIC_GRADIENT|INDIC_GRADIENTCENTRE|INDIC_HIDDEN|INDIC_PLAIN|INDIC_POINT|INDIC_POINTCHARACTER|INDIC_ROUNDBOX|INDIC_SQUIGGLE|INDIC_SQUIGGLELOW|INDIC_SQUIGGLEPIXMAP|INDIC_STRAIGHTBOX|INDIC_STRIKE|INDIC_TEXTFORE|INDIC_TT|MOD_ALT|MOD_CTRL|MOD_META|MOD_SHIFT|MOD_SUPER|MOUSE_DRAG|MOUSE_PRESS|MOUSE_RELEASE|WS_INVISIBLE|WS_VISIBLEAFTERINDENT|WS_VISIBLEALWAYS|WS_VISIBLEONLYININDENT|ALPHA_NOALPHA|ALPHA_OPAQUE|ALPHA_TRANSPARENT|CASE_CAMEL|CASE_LOWER|CASE_MIXED|CASE_UPPER|CURSORARROW|CURSORNORMAL|CURSORREVERSEARROW|CURSORWAIT|FOLDFLAG_LEVELNUMBERS|FOLDFLAG_LINEAFTER_CONTRACTED|FOLDFLAG_LINEAFTER_EXPANDED|FOLDFLAG_LINEBEFORE_CONTRACTED|FOLDFLAG_LINEBEFORE_EXPANDED|FOLDFLAG_LINESTATE|IV_LOOKBOTH|IV_LOOKFORWARD|IV_NONE|IV_REAL|MARGINOPTION_NONE|MARGINOPTION_SUBLINESELECT|MARGIN_BACK|MARGIN_COLOUR|MARGIN_FORE|MARGIN_NUMBER|MARGIN_RTEXT|MARGIN_SYMBOL|MARGIN_TEXT|MARK_ARROW|MARK_ARROWDOWN|MARK_ARROWS|MARK_BACKGROUND|MARK_BOOKMARK|MARK_BOXMINUS|MARK_BOXMINUSCONNECTED|MARK_BOXPLUS|MARK_BOXPLUSCONNECTED|MARK_CHARACTER|MARK_CIRCLE|MARK_CIRCLEMINUS|MARK_CIRCLEMINUSCONNECTED|MARK_CIRCLEPLUS|MARK_CIRCLEPLUSCONNECTED|MARK_DOTDOTDOT|MARK_EMPTY|MARK_FULLRECT|MARK_LCORNER|MARK_LCORNERCURVE|MARK_LEFTRECT|MARK_MINUS|MARK_PIXMAP|MARK_PLUS|MARK_RGBAIMAGE|MARK_ROUNDRECT|MARK_SHORTARROW|MARK_SMALLRECT|MARK_TCORNER|MARK_TCORNERCURVE|MARK_UNDERLINE|MARK_VERTICALBOOKMARK|MARK_VLINE|MASK_FOLDERS|TD_LONGARROW|TD_STRIKEOUT|TIME_FOREVER|WRAPINDENT_DEEPINDENT|WRAPINDENT_FIXED|WRAPINDENT_INDENT|WRAPINDENT_SAME|WRAPVISUALFLAGLOC_DEFAULT|WRAPVISUALFLAGLOC_END_BY_TEXT|WRAPVISUALFLAGLOC_START_BY_TEXT|WRAPVISUALFLAG_END|WRAPVISUALFLAG_MARGIN|WRAPVISUALFLAG_NONE|WRAPVISUALFLAG_START|WRAP_CHAR|WRAP_NONE|WRAP_WHITESPACE|WRAP_WORD|STYLE_BRACEBAD|STYLE_BRACELIGHT|STYLE_CALLTIP|STYLE_CONTROLCHAR|STYLE_DEFAULT|STYLE_FOLDDISPLAYTEXT|STYLE_INDENTGUIDE|STYLE_LINENUMBER|STYLE_MAX|UPDATE_H_SCROLL|UPDATE_V_SCROLL|VISIBLE_SLOP|VISIBLE_STRICT|brace_bad_light|brace_bad_light_indicator|brace_highlight|brace_highlight_indicator|call_tip_set_hlt|clear_registered_images|clear_representation|contracted_fold_next|doc_line_from_visible|ensure_visible|ensure_visible_enforce_policy|fold_all|fold_children|fold_line|get_default_fold_display_text|hide_lines|line_scroll|line_scroll_down|line_scroll_up|marker_define|marker_define_pixmap|marker_define_rgba_image|marker_enable_highlight|marker_symbol_defined|multi_edge_add_line|multi_edge_clear_all|register_image|register_rgba_image|scroll_caret|scroll_to_end|scroll_to_start|scroll_range|set_default_fold_display_text|set_fold_margin_colour|set_fold_margin_hi_colour|set_sel_back|set_sel_fore|set_visible_policy|set_whitespace_back|set_whitespace_fore|set_x_caret_policy|set_y_caret_policy|show_lines|style_clear_all|style_reset_default|text_height|text_width|toggle_fold|toggle_fold_show_text|vertical_centre_caret|visible_from_doc_line|wrap_count|zoom_in|zoom_out|split|unsplit|goto_buffer)\b</code> +<code>(\w+)([.:])\b(additional_caret_fore|additional_carets_blink|additional_carets_visible|additional_sel_alpha|additional_sel_back|additional_sel_fore|all_lines_visible|annotation_visible|auto_c_max_height|auto_c_max_width|call_tip_fore_hlt|call_tip_pos_start|call_tip_position|call_tip_use_style|caret_fore|caret_line_back|caret_line_back_alpha|caret_line_frame|caret_line_visible|caret_line_visible_always|caret_period|caret_style|caret_width|cursor|edge_colour|edge_column|edge_mode|end_at_last_line|extra_ascent|extra_descent|first_visible_line|fold_display_text_style|fold_expanded|fold_flags|h_scroll_bar|highlight_guide|idle_styling|indentation_guides|indic_alpha|indic_fore|indic_hover_fore|indic_hover_style|indic_outline_alpha|indic_style|indic_under|line_visible|lines_on_screen|margins|margin_back_n|margin_cursor_n|margin_left|margin_mask_n|margin_options|margin_right|margin_sensitive_n|margin_type_n|margin_width_n|marker_alpha|marker_back|marker_back_selected|marker_fore|mouse_dwell_time|mouse_selection_rectangular_switch|property|property_expanded|property_int|rectangular_selection_modifier|representation|rgba_image_height|rgba_image_scale|rgba_image_width|scroll_width|scroll_width_tracking|sel_alpha|sel_eol_filled|size|style_back|style_bold|style_case|style_changeable|style_eol_filled|style_font|style_fore|style_italic|style_size|style_underline|style_visible|tab_draw_mode|v_scroll_bar|view_eol|view_ws|whitespace_size|wrap_indent_mode|wrap_mode|wrap_start_indent|wrap_visual_flags|wrap_visual_flags_location|x_offset|zoom|ANNOTATION_BOXED|ANNOTATION_HIDDEN|ANNOTATION_STANDARD|ANNOTATION_INDENTED|CARETSTYLE_BLOCK|CARETSTYLE_INVISIBLE|CARETSTYLE_LINE|CARET_EVEN|CARET_JUMPS|CARET_SLOP|CARET_STRICT|EDGE_BACKGROUND|EDGE_LINE|EDGE_MULTILINE|EDGE_NONE|FOLDACTION_CONTRACT|FOLDACTION_EXPAND|FOLDACTION_TOGGLE|FOLDDISPLAYTEXT_HIDDEN|FOLDDISPLAYTEXT_STANDARD|FOLDDISPLAYTEXT_BOXED|INDIC_BOX|INDIC_COMPOSITIONTHICK|INDIC_COMPOSITIONTHIN|INDIC_DASH|INDIC_DIAGONAL|INDIC_DOTBOX|INDIC_DOTS|INDIC_FULLBOX|INDIC_GRADIENT|INDIC_GRADIENTCENTRE|INDIC_HIDDEN|INDIC_PLAIN|INDIC_POINT|INDIC_POINTCHARACTER|INDIC_ROUNDBOX|INDIC_SQUIGGLE|INDIC_SQUIGGLELOW|INDIC_SQUIGGLEPIXMAP|INDIC_STRAIGHTBOX|INDIC_STRIKE|INDIC_TEXTFORE|INDIC_TT|MOD_ALT|MOD_CTRL|MOD_META|MOD_SHIFT|MOD_SUPER|MOUSE_DRAG|MOUSE_PRESS|MOUSE_RELEASE|WS_INVISIBLE|WS_VISIBLEAFTERINDENT|WS_VISIBLEALWAYS|WS_VISIBLEONLYININDENT|ALPHA_NOALPHA|ALPHA_OPAQUE|ALPHA_TRANSPARENT|CASE_CAMEL|CASE_LOWER|CASE_MIXED|CASE_UPPER|CURSORARROW|CURSORNORMAL|CURSORREVERSEARROW|CURSORWAIT|FOLDFLAG_LEVELNUMBERS|FOLDFLAG_LINEAFTER_CONTRACTED|FOLDFLAG_LINEAFTER_EXPANDED|FOLDFLAG_LINEBEFORE_CONTRACTED|FOLDFLAG_LINEBEFORE_EXPANDED|FOLDFLAG_LINESTATE|IV_LOOKBOTH|IV_LOOKFORWARD|IV_NONE|IV_REAL|MARGINOPTION_NONE|MARGINOPTION_SUBLINESELECT|MARGIN_BACK|MARGIN_COLOUR|MARGIN_FORE|MARGIN_NUMBER|MARGIN_RTEXT|MARGIN_SYMBOL|MARGIN_TEXT|MARK_ARROW|MARK_ARROWDOWN|MARK_ARROWS|MARK_BACKGROUND|MARK_BOOKMARK|MARK_BOXMINUS|MARK_BOXMINUSCONNECTED|MARK_BOXPLUS|MARK_BOXPLUSCONNECTED|MARK_CHARACTER|MARK_CIRCLE|MARK_CIRCLEMINUS|MARK_CIRCLEMINUSCONNECTED|MARK_CIRCLEPLUS|MARK_CIRCLEPLUSCONNECTED|MARK_DOTDOTDOT|MARK_EMPTY|MARK_FULLRECT|MARK_LCORNER|MARK_LCORNERCURVE|MARK_LEFTRECT|MARK_MINUS|MARK_PIXMAP|MARK_PLUS|MARK_RGBAIMAGE|MARK_ROUNDRECT|MARK_SHORTARROW|MARK_SMALLRECT|MARK_TCORNER|MARK_TCORNERCURVE|MARK_UNDERLINE|MARK_VERTICALBOOKMARK|MARK_VLINE|MASK_FOLDERS|TD_LONGARROW|TD_STRIKEOUT|TIME_FOREVER|WRAPINDENT_DEEPINDENT|WRAPINDENT_FIXED|WRAPINDENT_INDENT|WRAPINDENT_SAME|WRAPVISUALFLAGLOC_DEFAULT|WRAPVISUALFLAGLOC_END_BY_TEXT|WRAPVISUALFLAGLOC_START_BY_TEXT|WRAPVISUALFLAG_END|WRAPVISUALFLAG_MARGIN|WRAPVISUALFLAG_NONE|WRAPVISUALFLAG_START|WRAP_CHAR|WRAP_NONE|WRAP_WHITESPACE|WRAP_WORD|STYLE_BRACEBAD|STYLE_BRACELIGHT|STYLE_CALLTIP|STYLE_CONTROLCHAR|STYLE_DEFAULT|STYLE_FOLDDISPLAYTEXT|STYLE_INDENTGUIDE|STYLE_LINENUMBER|STYLE_MAX|UPDATE_H_SCROLL|UPDATE_V_SCROLL|VISIBLE_SLOP|VISIBLE_STRICT|brace_bad_light|brace_bad_light_indicator|brace_highlight|brace_highlight_indicator|call_tip_active|call_tip_cancel|call_tip_pos_start|call_tip_set_hlt|call_tip_show|clear_registered_images|clear_representation|contracted_fold_next|doc_line_from_visible|ensure_visible|ensure_visible_enforce_policy|fold_all|fold_children|fold_line|get_default_fold_display_text|hide_lines|line_scroll|line_scroll_down|line_scroll_up|marker_define|marker_define_pixmap|marker_define_rgba_image|marker_enable_highlight|marker_symbol_defined|multi_edge_add_line|multi_edge_clear_all|register_image|register_rgba_image|scroll_caret|scroll_to_end|scroll_to_start|scroll_range|set_default_fold_display_text|set_fold_margin_colour|set_fold_margin_hi_colour|set_sel_back|set_sel_fore|set_visible_policy|set_whitespace_back|set_whitespace_fore|set_x_caret_policy|set_y_caret_policy|show_lines|style_clear_all|style_reset_default|text_height|text_width|toggle_fold|toggle_fold_show_text|vertical_centre_caret|visible_from_doc_line|wrap_count|zoom_in|zoom_out|split|unsplit|goto_buffer)\b</code> </pre> "Replace" with 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} }, { diff --git a/test/test.lua b/test/test.lua index 650b092b..2874c415 100644 --- a/test/test.lua +++ b/test/test.lua @@ -1845,27 +1845,27 @@ function test_editing_show_documentation() } buffer:add_text('foo') textadept.editing.show_documentation() - assert(buffer:call_tip_active(), 'documentation not found') - buffer:call_tip_cancel() + assert(view:call_tip_active(), 'documentation not found') + view:call_tip_cancel() buffer:add_text('2') textadept.editing.show_documentation() - assert(buffer:call_tip_active(), 'documentation not found') - buffer:call_tip_cancel() + assert(view:call_tip_active(), 'documentation not found') + view:call_tip_cancel() buffer:add_text('bar') textadept.editing.show_documentation() - assert(not buffer:call_tip_active(), 'documentation found') + assert(not view:call_tip_active(), 'documentation found') buffer:clear_all() buffer:add_text('FOO') textadept.editing.show_documentation(nil, true) - assert(buffer:call_tip_active(), 'documentation not found') - buffer:call_tip_cancel() + assert(view:call_tip_active(), 'documentation not found') + view:call_tip_cancel() buffer:add_text('(') textadept.editing.show_documentation(nil, true) - assert(buffer:call_tip_active(), 'documentation not found') - buffer:call_tip_cancel() + assert(view:call_tip_active(), 'documentation not found') + view:call_tip_cancel() buffer:add_text('bar') textadept.editing.show_documentation(nil, true) - assert(buffer:call_tip_active(), 'documentation not found') + assert(view:call_tip_active(), 'documentation not found') events.emit(events.CALL_TIP_CLICK, 1) -- TODO: test calltip cycling. buffer:close(true) @@ -2282,8 +2282,8 @@ function test_menu_menu_functions() buffer:auto_c_cancel() buffer:char_left() textadept.menu.menubar[_L['Tools']][_L['Show Style']][2]() - assert(buffer:call_tip_active(), 'style not shown') - buffer:call_tip_cancel() + assert(view:call_tip_active(), 'style not shown') + view:call_tip_cancel() local use_tabs = buffer.use_tabs textadept.menu.menubar[_L['Buffer']][_L['Indentation']][_L['Toggle Use Tabs']][2]() assert(buffer.use_tabs ~= use_tabs, 'use tabs not toggled') |