diff options
-rw-r--r-- | core/._M.luadoc | 24 | ||||
-rw-r--r-- | core/file_io.lua | 2 | ||||
-rw-r--r-- | doc/06_AdeptEditing.md | 5 | ||||
-rw-r--r-- | modules/textadept/run.lua | 5 |
4 files changed, 32 insertions, 4 deletions
diff --git a/core/._M.luadoc b/core/._M.luadoc index 2afa6a5e..83e853d0 100644 --- a/core/._M.luadoc +++ b/core/._M.luadoc @@ -48,6 +48,30 @@ -- [macros]: textadept.run.html#execute -- [`textadept.run.error_patterns`]: textadept.run.html#error_patterns -- +-- #### Build a Project +-- +-- The `Ctrl+Shift+B` (`⌘⇧B` on Mac OSX | `M-^B` in curses) key bindings build +-- the current project. Textadept can only detect projects under version +-- control, and uses [`io.get_project_root()`][] to do so. The editor looks in +-- the detected project's root directory for some sort of "makefile" (GNU +-- Makefiles, Ruby Rakefiles, etc.) and prompts the user for any additional +-- arguments to pass to that makefile's run command. Textadept references +-- [`textadept.run.build_commands`][] for makefiles and their associated run +-- commands. Per-project build commands may also be defined. For example, the +-- following command builds Textadept after prompting for makefile targets: +-- +-- textadept.run.build_commands[_HOME] = function() +-- local button, target = ui.dialogs.standard_inputbox{ +-- title = _L['Command'], informative_text = 'make -C src' +-- } +-- if button == 1 then return 'make -C src '..target end +-- end +-- +-- As with compile and run commands, any recognized errors are flagged. +-- +-- [`io.get_project_root()`]: io.html#get_project_root +-- [`textadept.run.build_commands`]: textadept.run.html#build_commands +-- -- #### Buffer Properties -- -- By default, Textadept uses 2 spaces as indentation. If your language has diff --git a/core/file_io.lua b/core/file_io.lua index 6e82f66d..3df966c5 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -364,6 +364,8 @@ local vcs = {'.bzr', '.git', '.hg', '.svn', 'CVS'} --- -- Returns the root directory of the project that contains filesystem path -- *path*. +-- In order to be recognized, projects must be under version control. Recognized +-- VCSes are Bazaar, Git, Mercurial, SVN, and CVS. -- @param path Optional filesystem path to a project or a file contained within -- a project. The default value is the buffer's filename or the current -- working directory. diff --git a/doc/06_AdeptEditing.md b/doc/06_AdeptEditing.md index fd59b9d8..deb016bf 100644 --- a/doc/06_AdeptEditing.md +++ b/doc/06_AdeptEditing.md @@ -312,8 +312,9 @@ the command and marks any recognized warnings and errors. Pressing `Ctrl+Alt+E` error and `Ctrl+Alt+Shift+E` (`^⌘⇧E` | `M-S-X`) attempts to jump to the previous one. Double-clicking on warnings and errors also jumps to their sources. If Textadept does not know the correct commands for compiling and/or running your -language's source code, or if it does not detect warning or error messages -properly, you can [make changes][] in your [user-init file][]. +language's source code, if it does not know how to build your project, or if it +does not detect warning or error messages properly, you can [make changes][] in +your [user-init file][].  diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index 3170b5aa..c77a7a0c 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -78,8 +78,9 @@ local function command(commands, event) local lfs_attributes = lfs.attributes for build_file, build_command in pairs(commands) do if lfs_attributes(cwd..'/'..build_file) then - local button, cmd = ui.dialogs.standard_inputbox{ - title = _L['Command'], informative_text = cwd, text = build_command + local button, cmd = ui.dialogs.inputbox{ + title = _L['Command'], informative_text = cwd, text = build_command, + button1 = _L['_OK'], button2 = _L['_Cancel'] } if button == 1 then command = cmd end break |