aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2016-04-05 20:45:51 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2016-04-05 20:45:51 -0400
commit6e086c1310caa4182e919a9ba6fe35f6c3bf3725 (patch)
treec5cef2a2e66bb50c45d67f4a487e5f2a977300c7 /modules/textadept
parentc2e9e198fbfa1553411f79ff35b8d972dd417658 (diff)
downloadtextadept-6e086c1310caa4182e919a9ba6fe35f6c3bf3725.tar.gz
textadept-6e086c1310caa4182e919a9ba6fe35f6c3bf3725.zip
Only convert filenames from `_CHARSET` to UTF-8, not UTF-8-encoded buffer names.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/bookmarks.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index ded52fa4..24eea717 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -53,13 +53,14 @@ function M.goto_mark(next)
if current_buffer_first and _BUFFERS[i] == buffer or
not current_buffer_first and _BUFFERS[i] ~= buffer then
local buffer = _BUFFERS[i]
- local filename = (buffer.filename or buffer._type or
- _L['Untitled']):match('[^/\\]+$')
+ local basename = (buffer.filename or ''):match('[^/\\]+$') or
+ buffer._type or _L['Untitled']
+ if buffer.filename then
+ basename = basename:iconv('UTF-8', _CHARSET)
+ end
local line = buffer:marker_next(0, 2^M.MARK_BOOKMARK)
while line >= 0 do
- local mark = string.format('%s:%d: %s',
- filename:iconv('UTF-8', _CHARSET),
- line + 1,
+ local mark = string.format('%s:%d: %s', basename, line + 1,
buffer:get_line(line):match('^[^\r\n]*'))
utf8_list[#utf8_list + 1], buffers[#utf8_list + 1] = mark, i
line = buffer:marker_next(line + 1, 2^M.MARK_BOOKMARK)