aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-07-14 18:22:13 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-07-14 18:22:13 -0400
commit13bd039c243ef4e44bd037d1c3506d350f682c09 (patch)
tree57d8d1a0b78df2622c1789b13e4da00aaf188f3a /modules
parentb821d05d828aec6ac6c070f00c9115f27f62f9c0 (diff)
Renamed `textadept.editing.block_comment()` to `toggle_comment()`.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/editing.lua8
-rw-r--r--modules/textadept/keys.lua2
-rw-r--r--modules/textadept/menu.lua2
3 files changed, 6 insertions, 6 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 20b0c0bd..96e4e351 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -57,12 +57,12 @@ for _ = 1, #M.XPM_IMAGES do _SCINTILLA.next_image_type() end -- sync
---
-- Map of lexer names to line comment strings for programming languages, used by
--- the `block_comment()` function.
+-- the `toggle_comment()` function.
-- Keys are lexer names and values are either the language's line comment
-- prefixes or block comment delimiters separated by a '|' character.
-- @class table
-- @name comment_string
--- @see block_comment
+-- @see toggle_comment
M.comment_string = {actionscript='//',ada='--',apdl='!',ansi_c='/*|*/',antlr='//',apl='#',applescript='--',asp='\'',autoit=';',awk='#',b_lang='//',bash='#',batch=':',bibtex='%',boo='#',chuck='//',cmake='#',coffeescript='#',context='%',cpp='//',crystal='#',csharp='//',css='/*|*/',cuda='//',desktop='#',django='{#|#}',dmd='//',dockerfile='#',dot='//',eiffel='--',elixir='#',erlang='%',faust='//',fennel=';',fish='#',forth='|\\',fortran='!',fsharp='//',gap='#',gettext='#',gherkin='#',glsl='//',gnuplot='#',go='//',groovy='//',gtkrc='#',haskell='--',html='<!--|-->',icon='#',idl='//',inform='!',ini='#',Io='#',java='//',javascript='//',json='/*|*/',jsp='//',latex='%',ledger='#',less='//',lilypond='%',lisp=';',logtalk='%',lua='--',makefile='#',matlab='#',moonscript='--',myrddin='//',nemerle='//',nim='#',nsis='#',objective_c='//',pascal='//',perl='#',php='//',pico8='//',pike='//',pkgbuild='#',prolog='%',props='#',protobuf='//',ps='%',pure='//',python='#',rails='#',rc='#',rebol=';',rest='.. ',rexx='--',rhtml='<!--|-->',rstats='#',ruby='#',rust='//',sass='//',scala='//',scheme=';',smalltalk='"|"',sml='(*)',snobol4='#',sql='--',tcl='#',tex='%',text='',toml='#',vala='//',vb='\'',vbscript='\'',verilog='//',vhdl='--',wsf='<!--|-->',xml='<!--|-->',yaml='#'}
---
@@ -305,8 +305,8 @@ end
-- As long as any part of a line is selected, the entire line is eligible for
-- commenting/uncommenting.
-- @see comment_string
--- @name block_comment
-function M.block_comment()
+-- @name toggle_comment
+function M.toggle_comment()
local comment = M.comment_string[buffer:get_lexer(true)] or ''
local prefix, suffix = comment:match('^([^|]+)|?([^|]*)$')
if not prefix then return end
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index f70a7027..90cb2000 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -312,7 +312,7 @@ local bindings = {
[m_edit[_L['Match Brace']][2]] = {'ctrl+m', 'ctrl+m', 'meta+m'},
[m_edit[_L['Complete Word']][2]] =
{'ctrl+\n', 'ctrl+esc', {'ctrl+meta+j', 'ctrl+\n'}},
- [textadept.editing.block_comment] = {'ctrl+/', 'ctrl+/', 'meta+/'},
+ [textadept.editing.toggle_comment] = {'ctrl+/', 'ctrl+/', 'meta+/'},
[textadept.editing.transpose_chars] = {'ctrl+t', 'ctrl+t', 'ctrl+t'},
[textadept.editing.join_lines] = {'ctrl+J', 'ctrl+j', 'meta+j'},
[m_edit[_L['Filter Through']][2]] = {'ctrl+|', 'cmd+|', 'ctrl+\\'},
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 4d461abb..98f0f1cc 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -97,7 +97,7 @@ local default_menubar = {
{_L['Complete Word'], function()
textadept.editing.autocomplete('word')
end},
- {_L['Toggle Block Comment'], textadept.editing.block_comment},
+ {_L['Toggle Block Comment'], textadept.editing.toggle_comment},
{_L['Transpose Characters'], textadept.editing.transpose_chars},
{_L['Join Lines'], textadept.editing.join_lines},
{_L['Filter Through'], function()