diff options
author | 2016-06-15 08:49:28 -0400 | |
---|---|---|
committer | 2016-06-15 08:49:28 -0400 | |
commit | fc20fd1a9b74c1059775446baf921181433801aa (patch) | |
tree | 5383e5cdb7b56fd72decb30915b7f0c0597dabe3 /core | |
parent | d432e17da5cc5ab973e895e9f391c4e2b4def9bc (diff) | |
download | textadept-fc20fd1a9b74c1059775446baf921181433801aa.tar.gz textadept-fc20fd1a9b74c1059775446baf921181433801aa.zip |
Removed explicit detection and use of extinct CR line endings.
It's quite possible some of Textadept's functions didn't handle them properly
anyway.
Diffstat (limited to 'core')
-rw-r--r-- | core/file_io.lua | 4 | ||||
-rw-r--r-- | core/locale.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.ar.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.de.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.es.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.fr.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.it.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.pl.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.ru.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.sv.conf | 2 | ||||
-rw-r--r-- | core/ui.lua | 3 |
11 files changed, 2 insertions, 23 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 9a8a8271..46a537a4 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -83,8 +83,6 @@ io.recent_files = {} -- @name encodings io.encodings = {'UTF-8', 'ASCII', 'ISO-8859-1', 'MacRoman'} -local c = _SCINTILLA.constants -local EOLs = {['\r\n'] = c.EOL_CRLF, ['\r'] = c.EOL_CR, ['\n'] = c.EOL_LF} --- -- Opens *filenames*, a string filename or list of filenames, or the -- user-selected filenames. @@ -133,7 +131,7 @@ function io.open_file(filenames) end buffer.code_page = buffer.encoding and buffer.CP_UTF8 or 0 -- Detect EOL mode. - buffer.eol_mode = EOLs[text:match('\r\n?')] or buffer.EOL_LF + buffer.eol_mode = text:find('\r\n') and buffer.EOL_CRLF or buffer.EOL_LF -- Insert buffer text and set properties. buffer:add_text(text, #text) buffer:goto_pos(0) diff --git a/core/locale.conf b/core/locale.conf index 75006a56..f0dc5a9f 100644 --- a/core/locale.conf +++ b/core/locale.conf @@ -43,7 +43,6 @@ Name = Name Switch Buffers = Switch Buffers theme not found. = theme not found. CRLF = CRLF -CR = CR LF = LF Tabs: = Tabs: Spaces: = Spaces: @@ -218,7 +217,6 @@ _Toggle Use Tabs = _Toggle Use Tabs _Convert Indentation = _Convert Indentation _EOL Mode = _EOL Mode %CRLF = CRLF -%CR = CR %LF = LF E_ncoding = E_ncoding _UTF-8 Encoding = _UTF-8 Encoding diff --git a/core/locales/locale.ar.conf b/core/locales/locale.ar.conf index 5e23194f..ed1ac2e8 100644 --- a/core/locales/locale.ar.conf +++ b/core/locales/locale.ar.conf @@ -44,7 +44,6 @@ Name = اسم Switch Buffers = بدِّل المذكرات theme not found. = النسف غير موجود. CRLF = CRLF -CR = CR LF = LF Tabs: = المسافات العريضة: Spaces: = المسافات: @@ -219,7 +218,6 @@ _Toggle Use Tabs = _بدِّل المسافات العريضة _Convert Indentation = ت_حويل البادئة _EOL Mode = _علامة نهاية السطر(EOL) %CRLF = CRLF -%CR = CR %LF = LF E_ncoding = ال_ترميز _UTF-8 Encoding = ترميز الـUTF-8 diff --git a/core/locales/locale.de.conf b/core/locales/locale.de.conf index a8907684..2f712d6e 100644 --- a/core/locales/locale.de.conf +++ b/core/locales/locale.de.conf @@ -44,7 +44,6 @@ Name = Name Switch Buffers = Wechsle Buffer theme not found = -Theme nicht gefunden CRLF = CRLF -CR = CR LF = LF Tabs: = Tabs: Spaces: = Leerzeichen: @@ -208,7 +207,6 @@ _Toggle Use Tabs = _Tabs verwenden umschalten _Convert Indentation = Verwendeten Einzug ändern _EOL Mode = _EOL-Modus %CRLF = CRLF -%CR = CR %LF = LF E_ncoding = Zeichenkodierung _UTF-8 Encoding = _UTF-8 diff --git a/core/locales/locale.es.conf b/core/locales/locale.es.conf index 77abddb5..ae5eed4b 100644 --- a/core/locales/locale.es.conf +++ b/core/locales/locale.es.conf @@ -44,7 +44,6 @@ Name = Nombre Switch Buffers = Cambiar Buffer theme not found. = tema no encontrado. CRLF = CRLF -CR = CR LF = LF Tabs: = Tabuladores: Spaces: = Espacios: @@ -219,7 +218,6 @@ _Toggle Use Tabs = _Activar/Desactivar tabulaciones _Convert Indentation = _Convertir indentación _EOL Mode = Ca_rácter fin de línea %CRLF = _CRLF -%CR = C_R %LF = _LF E_ncoding = C_odificación _UTF-8 Encoding = Codificación UTF-_8 diff --git a/core/locales/locale.fr.conf b/core/locales/locale.fr.conf index 8ff4c8c6..1709c63d 100644 --- a/core/locales/locale.fr.conf +++ b/core/locales/locale.fr.conf @@ -45,7 +45,6 @@ Name = Nom Switch Buffers = Changer d’onglet theme not found. = thème non trouvé. CRLF = CRLF (Windows) -CR = CR (Mac) LF = LF (Unix) Tabs: = Tabulations: Spaces: = Espaces: @@ -220,7 +219,6 @@ _Toggle Use Tabs = _Commuter l’utilisation des tabulations _Convert Indentation = _Convertir l’indentation _EOL Mode = _Fin de ligne %CRLF = CRLF -%CR = CR %LF = LF E_ncoding = E_ncodage _UTF-8 Encoding = Encodage _UTF-8 diff --git a/core/locales/locale.it.conf b/core/locales/locale.it.conf index f6a4074d..72e37f07 100644 --- a/core/locales/locale.it.conf +++ b/core/locales/locale.it.conf @@ -44,7 +44,6 @@ Name = Nome Switch Buffers = Vai alla scheda theme not found. = tema non trovato. CRLF = CRLF (Windows) -CR = CR (Mac) LF = LF (Unix) Tabs: = Tabulazioni: Spaces: = Spazi: @@ -219,7 +218,6 @@ _Toggle Use Tabs = _Usa le tabulazioni sì/no _Convert Indentation = _Converti il rientro _EOL Mode = _Tipo di fine di linea %CRLF = CRLF -%CR = CR %LF = LF E_ncoding = _Codifica _UTF-8 Encoding = Codifica _UTF-8 diff --git a/core/locales/locale.pl.conf b/core/locales/locale.pl.conf index e5250136..c1228157 100644 --- a/core/locales/locale.pl.conf +++ b/core/locales/locale.pl.conf @@ -44,7 +44,6 @@ Name = Nazwa Switch Buffers = Przełącz bufory theme not found. = nie znaleziony. CRLF = CRLF -CR = CR LF = LF Tabs: = Tabulacje: Spaces: = Spacje: @@ -219,7 +218,6 @@ _Toggle Use Tabs = Włącz/wyłącz _tabulacje _Convert Indentation = _Konwertuj _EOL Mode = _Tryb końca linii %CRLF = C_RLF (Windows) -%CR = _CR (Mac) %LF = _LF (UNIX/Linux) E_ncoding = Ko_dowanie znaków _UTF-8 Encoding = _UTF-8 diff --git a/core/locales/locale.ru.conf b/core/locales/locale.ru.conf index 316c14ff..f4b93276 100644 --- a/core/locales/locale.ru.conf +++ b/core/locales/locale.ru.conf @@ -44,7 +44,6 @@ Name = Название Switch Buffers = Переключение между буферами theme not found. = тема не найдена. CRLF = CRLF -CR = CR LF = LF Tabs: = Табы: Spaces: = Пробелы: @@ -208,7 +207,6 @@ _Toggle Use Tabs = Переключить использование _табул _Convert Indentation = _Преобразовать отступ _EOL Mode = Режим _конца строки %CRLF = CRLF -%CR = CR %LF = LF E_ncoding = _Кодировка _UTF-8 Encoding = Кодировка _UTF-8 diff --git a/core/locales/locale.sv.conf b/core/locales/locale.sv.conf index e8d35be4..93fa64a6 100644 --- a/core/locales/locale.sv.conf +++ b/core/locales/locale.sv.conf @@ -44,7 +44,6 @@ Name = Namn Switch Buffers = Välj buffert theme not found. = tema kunde inte hittas. CRLF = CRLF (Windows) -CR = CR (Mac) LF = LF (Unix) Tabs: = Tabulator: Spaces: = Mellanslag: @@ -220,7 +219,6 @@ _Toggle Use Tabs = _Växla tab-användning _Convert Indentation = _Konvertera indrag _EOL Mode = _Radslutstecken %CRLF = CRLF (Windows) -%CR = CR (Mac) %LF = LF (Unix) E_ncoding = Tecken_kodning _UTF-8 Encoding = _UTF-8 diff --git a/core/ui.lua b/core/ui.lua index 3e9923e6..3c74923e 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -334,7 +334,6 @@ events_connect(events.APPLEEVENT_ODOC, function(uri) return events.emit(events.URI_DROPPED, 'file://'..uri) end) -local EOLs = {_L['CRLF'], _L['CR'], _L['LF']} local GETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[1] -- Sets buffer statusbar text. events_connect(events.UPDATE_UI, function(updated) @@ -343,7 +342,7 @@ events_connect(events.UPDATE_UI, function(updated) local line, max = buffer:line_from_position(pos) + 1, buffer.line_count local col = buffer.column[pos] + 1 local lexer = buffer:private_lexer_call(GETLEXERLANGUAGE):match('^[^/]+') - local eol = EOLs[buffer.eol_mode + 1] + local eol = buffer.eol_mode == buffer.EOL_CRLF and _L['CRLF'] or _L['LF'] local tabs = string.format('%s %d', buffer.use_tabs and _L['Tabs:'] or _L['Spaces:'], buffer.tab_width) local enc = buffer.encoding or '' |