Re: [code] [textadept]

From: Robert Gieseke <rob.g.att.web.de>
Date: Sat, 24 Oct 2015 10:17:43 +0200

Hi Jay,

I think you need to add to the editing.api_files table for your language
module.

http://foicica.com/textadept/api.html#textadept.editing.api_files

For example in the built-in "ansi_c" module there is

textadept.editing.api_files.ansi_c = {
  _HOME..'/modules/ansi_c/api', _HOME..'/modules/ansi_c/lua_api',
  _USERHOME..'/modules/ansi_c/api'
}

If you wanted to add to this table you would need to do this in a
"post_init.lua" file, search for "Language Module Preferences" in the
manual.

I think (untested), something like

events.connect(events.LEXER_LOADED, function(lang)
  if lang == 'ansi_c' then
    local api_files = textadept.editing.api_files.ansi_c
    api_files[#api_files + 1] = _USERHOME..'/modules/ansi_c/jay_api'
  end
end)

in ansi_c's "post_init.lua" should work.

Let us know if you get stuck or find something in the docs that could be
clarified.

Cheers,
Robert

Am 24/10/15 um 08:58 schrieb Jae-woo Kim:
> Hi, I'm a lua beginner, and I like textadept :)
> Sorry for my poor English. Call me Jay.
>
> I've used textadept on Windows for three days, and I'm impressed by its
> superb flexibility.
> I read almost all of the official manual, API documents, wiki so on.
> And I understand that I can customize its settings by manipulating files in
> ~/.textadept directory with its API.
>
> So far, there is just one thing that I can't customize.
> I want to "add some private comment to language's API documents".
> details:
> As you know, pressing Ctrl+H shows documentation on the current symbol.
> What I want is, adding some additional comment line to that document's last
> line.
> I "don't" want to "replacing" original document API file with my own API
> file.
>
> With my understanding, it looks like that I can't do this kind of task with
> current textadept's API.
> I wonder whether I am wrong or not.
>
> what I've studied about...:
> .../modules textadept/editing.lua
> M.api_files
> M.show_documentation()
> .../modules/lua/api
> .../modules/ansi_c/api
>
>
> p.s. Keep going, Textadept!
>

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 24 Oct 2015 - 04:17:43 EDT

This archive was generated by hypermail 2.2.0 : Sat 24 Oct 2015 - 06:29:41 EDT