3
3
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
4
4
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts
5
5
6
- -- luacheck: globals clink
6
+ -- luacheck: globals CMDER_SESSION
7
+ -- luacheck: globals uah_color cwd_color lamb_color clean_color dirty_color conflict_color unknown_color
8
+ -- luacheck: globals prompt_homeSymbol prompt_lambSymbol prompt_type prompt_useHomeSymbol prompt_useUserAtHost
9
+ -- luacheck: globals prompt_singleLine prompt_includeVersionControl
10
+ -- luacheck: globals prompt_overrideGitStatusOptIn prompt_overrideSvnStatusOptIn
11
+ -- luacheck: globals clink io.popenyield os.isdir settings.get
7
12
8
13
-- At first, load the original clink.lua file
9
14
-- this is needed as we set the script path to this dir and therefore the original
191
196
local function get_dir_contains (path , dirname )
192
197
193
198
-- return parent path for specified entry (either file or directory)
194
- local function pathname (path )
199
+ local function pathname (path ) -- luacheck: ignore 432
195
200
local prefix = " "
196
201
local i = path :find (" [\\ /:][^\\ /:]*$" )
197
202
if i then
@@ -201,14 +206,14 @@ local function get_dir_contains(path, dirname)
201
206
end
202
207
203
208
-- Navigates up one level
204
- local function up_one_level (path )
209
+ local function up_one_level (path ) -- luacheck: ignore 432
205
210
if path == nil then path = ' .' end
206
211
if path == ' .' then path = clink .get_cwd () end
207
212
return pathname (path )
208
213
end
209
214
210
215
-- Checks if provided directory contains git directory
211
- local function has_specified_dir (path , specified_dir )
216
+ local function has_specified_dir (path , specified_dir ) -- luacheck: ignore 432
212
217
if path == nil then path = ' .' end
213
218
local found_dirs = clink .find_dirs (path .. ' /' .. specified_dir )
214
219
if # found_dirs > 0 then return true end
236
241
local function get_git_dir (path )
237
242
238
243
-- return parent path for specified entry (either file or directory)
239
- local function pathname (path )
244
+ local function pathname (path ) -- luacheck: ignore 432
240
245
local prefix = " "
241
246
local i = path :find (" [\\ /:][^\\ /:]*$" )
242
247
if i then
346
351
-- Find out current branch
347
352
-- @return {false|svn branch name}
348
353
---
349
- local function get_svn_branch (svn_dir )
354
+ local function get_svn_branch ()
350
355
local file = io_popenyield (" svn info 2>nul" )
351
356
if not file then
352
357
return false
@@ -379,7 +384,7 @@ local function get_git_status()
379
384
for line in file :lines () do
380
385
local code = line :sub (1 , 2 )
381
386
-- print (string.format("code: %s, line: %s", code, line))
382
- if code == " DD" or code == " AU" or code == " UD" or code == " UA" or code == " DU" or code == " AA" or code == " UU" then
387
+ if code == " DD" or code == " AU" or code == " UD" or code == " UA" or code == " DU" or code == " AA" or code == " UU" then -- luacheck: no max line length
383
388
is_status = false
384
389
conflict_found = true
385
390
break
@@ -608,7 +613,7 @@ local function svn_prompt_filter()
608
613
end
609
614
-- Get the svn status using coroutine if available and option is enabled. Otherwise use a blocking call
610
615
local svnStatus
611
- if clink .promptcoroutine and io .popenyield and settings .get (" prompt.async" ) and prompt_overrideSvnStatusOptIn then
616
+ if clink .promptcoroutine and io .popenyield and settings .get (" prompt.async" ) and prompt_overrideSvnStatusOptIn then -- luacheck: no max line length
612
617
svnStatus = clink_promptcoroutine (function ()
613
618
return get_svn_status ()
614
619
end )
0 commit comments