From 70d0efc33c34dc3cbbc9ea4f54a0d87439e0ac83 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 12 Apr 2016 08:51:36 -0400 Subject: Ouput 'cd' for run/compile commands when necessary; modules/textadept/run.lua --- modules/textadept/run.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua index b782c78c..42710813 100644 --- a/modules/textadept/run.lua +++ b/modules/textadept/run.lua @@ -136,7 +136,10 @@ local function run_command(commands, event) end local function emit_status(status) emit_output('> exit status: '..status) end - if commands == M.build_commands then emit_output('> cd '..M.cwd) end + if commands == M.build_commands or + M.cwd ~= (buffer.filename:match('^(.+)[/\\][^/\\]+$') or '') then + emit_output('> cd '..M.cwd) + end emit_output('> '..command:iconv('UTF-8', _CHARSET), not M.RUN_IN_BACKGROUND) M.proc = assert(spawn(command, M.cwd, emit_output, emit_output, emit_status)) end -- cgit v1.2.3