aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/file_io.lua4
-rw-r--r--core/lfs_ext.lua6
-rw-r--r--core/ui.lua3
3 files changed, 5 insertions, 8 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index 88db6907..aca5af2b 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -99,8 +99,8 @@ function io.open_file(filenames, encodings)
if not assert_type(filenames, 'string/table/nil', 1) then
filenames = ui.dialogs.fileselect{
title = _L['Open File'], select_multiple = true,
- with_directory =
- (buffer.filename or ''):match('^.+[/\\]') or lfs.currentdir(),
+ with_directory = (buffer.filename or ''):match('^.+[/\\]') or
+ lfs.currentdir(),
width = CURSES and ui.size[1] - 2 or nil
}
if not filenames then return end
diff --git a/core/lfs_ext.lua b/core/lfs_ext.lua
index ada0431e..59318da8 100644
--- a/core/lfs_ext.lua
+++ b/core/lfs_ext.lua
@@ -81,8 +81,7 @@ function lfs.dir_foreach(dir, f, filter, n, include_dirs, level)
end
for basename in lfs.dir(dir) do
if basename:find('^%.%.?$') then goto continue end -- ignore . and ..
- local filename = string.format(
- '%s%s%s', dir, dir ~= '/' and '/' or '', basename)
+ local filename = dir .. (dir ~= '/' and '/' or '') .. basename
local mode = lfs.attributes(filename, 'mode')
if mode ~= 'directory' and mode ~= 'file' then goto continue end
local include
@@ -129,8 +128,7 @@ function lfs.abspath(filename, prefix)
if not filename:find(not WIN32 and '^/' or '^%a:[/\\]') and
not (WIN32 and filename:find('^\\\\')) then
if not prefix then prefix = lfs.currentdir() end
- filename = string.format(
- '%s%s%s', prefix, not WIN32 and '/' or '\\', filename)
+ filename = prefix .. (not WIN32 and '/' or '\\') .. filename
end
filename = filename:gsub('%f[^/\\]%.[/\\]', '') -- clean up './'
while filename:find('[^/\\]+[/\\]%.%.[/\\]') do
diff --git a/core/ui.lua b/core/ui.lua
index a90bd9b6..43101a96 100644
--- a/core/ui.lua
+++ b/core/ui.lua
@@ -320,8 +320,7 @@ end)
-- Sets buffer statusbar text.
events_connect(events.UPDATE_UI, function(updated)
if updated and updated & 3 == 0 then return end -- ignore scrolling
- local text =
- not CURSES and '%s %d/%d %s %d %s %s %s %s' or
+ local text = not CURSES and '%s %d/%d %s %d %s %s %s %s' or
'%s %d/%d %s %d %s %s %s %s'
local pos = buffer.selection_n_caret[buffer.main_selection]
local line, max = buffer:line_from_position(pos) + 1, buffer.line_count