aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-04-03 16:56:14 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-04-03 16:56:14 -0400
commit679e188ec027978b37eb36a5f2d52bc2cf04ef77 (patch)
tree61da33e31c8f6f02fcc5fd53e406368635d5df43 /core
parent00153ab1c0f7307a8589c7d0cc0a3908cb7f0c34 (diff)
downloadtextadept-679e188ec027978b37eb36a5f2d52bc2cf04ef77.tar.gz
textadept-679e188ec027978b37eb36a5f2d52bc2cf04ef77.zip
Textadept should support multiple curses platforms; remove ncurses references.
Requires Scintilla r4436 and Scinterm r45.
Diffstat (limited to 'core')
-rw-r--r--core/._M.luadoc8
-rw-r--r--core/args.lua2
-rw-r--r--core/file_io.lua4
-rw-r--r--core/gui.lua12
-rw-r--r--core/init.lua6
-rw-r--r--core/keys.lua18
-rw-r--r--core/locale.conf2
-rw-r--r--core/locale.lua2
-rw-r--r--core/locales/locale.es.conf2
-rw-r--r--core/locales/locale.fr.conf2
10 files changed, 29 insertions, 29 deletions
diff --git a/core/._M.luadoc b/core/._M.luadoc
index a5bce5f1..f2e02abe 100644
--- a/core/._M.luadoc
+++ b/core/._M.luadoc
@@ -27,7 +27,7 @@
--
-- #### Block Comment
--
--- The `Ctrl+/` (`⌘/` on Mac OSX | `M-/` in ncurses) key binding toggles code
+-- The `Ctrl+/` (`⌘/` on Mac OSX | `M-/` in curses) key binding toggles code
-- comments. In order for this to work for your language, the
-- [`_M.textadept.editing.comment_string`][] table must have a key with the
-- language's lexer name assigned to a comment prefix string. For Lua, it would
@@ -40,7 +40,7 @@
-- #### Compile and Run
--
-- The `Ctrl+Shift+R` and `Ctrl+R` (`⌘⇧R` and `⌘R` on Mac OSX | `M-^R` and `^R`
--- in ncurses) key bindings compile and run code, respectively. In order for
+-- in curses) key bindings compile and run code, respectively. In order for
-- these to work for your language, the [`_M.textadept.run.compile_command`][]
-- and [`_M.textadept.run.run_command`][] tables must have keys with the
-- language's lexer name assigned to compile and run shell commands,
@@ -81,7 +81,7 @@
-- #### Adeptsense
--
-- The `Ctrl+Space` and `Ctrl+H` (`⌥⎋` and `^H` on Mac OSX | `^Space` and `M-H`
--- or `M-S-H` in ncurses) key bindings autocomplete symbols and show API
+-- or `M-S-H` in curses) key bindings autocomplete symbols and show API
-- documentation, respectively, when editing code. In order for these to work
-- for your language, you must create an [Adeptsense][].
--
@@ -107,7 +107,7 @@
-- [Lua][] module has a feature to autocomplete the `end` keyword in a control
-- structure and the [C/C++][] module has a feature to add a ';' to the end of
-- the current line and insert a new line. Both are bound to the `Shift+Enter`
--- (`⇧↩` on Mac OSX | `S-Enter` in ncurses) key for easy access.
+-- (`⇧↩` on Mac OSX | `S-Enter` in curses) key for easy access.
--
-- function M.try_to_autocomplete_end()
-- ...
diff --git a/core/args.lua b/core/args.lua
index b94cc645..dedfc22e 100644
--- a/core/args.lua
+++ b/core/args.lua
@@ -77,7 +77,7 @@ local function show_help()
for k, v in pairs(switches) do print(line:format(k, table.unpack(v, 2))) end
os.exit()
end
-if not NCURSES then M.register('-h', '--help', 0, show_help, 'Shows this') end
+if not CURSES then M.register('-h', '--help', 0, show_help, 'Shows this') end
-- For Windows, create arg table from single command line string (arg[0]).
if WIN32 and #arg[0] > 0 then
diff --git a/core/file_io.lua b/core/file_io.lua
index 878188ed..7ccf7605 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -396,7 +396,7 @@ end)
-- @name open_recent_file
function io.open_recent_file()
local i = gui.filteredlist(_L['Open'], _L['File'], io.recent_files, true,
- NCURSES and {'--width', gui.size[1] - 2} or '')
+ CURSES and {'--width', gui.size[1] - 2} or '')
if i then io.open_file(io.recent_files[i + 1]) end
end
@@ -445,7 +445,7 @@ function io.snapopen(utf8_paths, filter, exclude_FILTER, ...)
io.SNAPOPEN_MAX),
'--button1', _L['_OK'])
end
- local width = NCURSES and {'--width', gui.size[1] - 2} or ''
+ local width = CURSES and {'--width', gui.size[1] - 2} or ''
io.open_file(gui.filteredlist(_L['Open'], _L['File'], list, false,
'--select-multiple', width, ...) or '')
end
diff --git a/core/gui.lua b/core/gui.lua
index f61a45b3..e9aa763b 100644
--- a/core/gui.lua
+++ b/core/gui.lua
@@ -116,7 +116,7 @@ function gui.switch_buffer()
items[#items + 1] = filename
end
local i = gui.filteredlist(_L['Switch Buffers'], columns, items, true,
- NCURSES and {'--width', gui.size[1] - 2} or '--')
+ CURSES and {'--width', gui.size[1] - 2} or '--')
if i then view:goto_buffer(i + 1) end
end
@@ -160,7 +160,7 @@ function gui.goto_file(filename, split, preferred_view, sloppy)
io.open_file(filename)
end
-local theme_file = not NCURSES and 'theme' or 'theme_term'
+local theme_file = not CURSES and 'theme' or 'theme_term'
local THEME
---
-- Sets the editor theme name to *name* or the default platform theme.
@@ -176,13 +176,13 @@ local THEME
function gui.set_theme(name)
if not name then
-- Read theme from ~/.textadept/theme or ~/.textadept/theme_term depending
- -- on NCURSES platform, defaulting to 'light' or 'term' respectively.
+ -- on CURSES platform, defaulting to 'light' or 'term' respectively.
local f = io.open(_USERHOME..'/'..theme_file, 'rb')
if f then
name = f:read('*line'):match('[^\r\n]+')
f:close()
end
- if not name or name == '' then name = not NCURSES and 'light' or 'term' end
+ if not name or name == '' then name = not CURSES and 'light' or 'term' end
end
-- Get the path of the theme.
@@ -363,8 +363,8 @@ events_connect(events.UPDATE_UI, function()
local tabs = string_format('%s %d', buffer.use_tabs and _L['Tabs:'] or
_L['Spaces:'], buffer.tab_width)
local enc = buffer.encoding or ''
- local text = not NCURSES and '%s %d/%d %s %d %s %s %s %s' or
- '%s %d/%d %s %d %s %s %s %s'
+ local text = not CURSES and '%s %d/%d %s %d %s %s %s %s' or
+ '%s %d/%d %s %d %s %s %s %s'
gui.docstatusbar_text = string_format(text, _L['Line:'], line, max,
_L['Col:'], col, lexer, eol, tabs, enc)
end)
diff --git a/core/init.lua b/core/init.lua
index cc94e618..ea7efb81 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -49,11 +49,11 @@ _M = {} -- modules table
-- If Textadept is running on Windows, this flag is `true`.
-- @field OSX (bool)
-- If Textadept is running on Mac OSX, this flag is `true`.
--- @field NCURSES (bool)
+-- @field CURSES (bool)
-- If Textadept is running in the terminal, this flag is `true`.
--- ncurses feature incompatibilities are listed in the [Appendix][].
+-- Curses feature incompatibilities are listed in the [Appendix][].
--
--- [Appendix]: ../14_Appendix.html#Ncurses.Compatibility
+-- [Appendix]: ../14_Appendix.html#Curses.Compatibility
module('_G')]]
--[[ The tables below were defined in C.
diff --git a/core/keys.lua b/core/keys.lua
index 5894acfa..5d599482 100644
--- a/core/keys.lua
+++ b/core/keys.lua
@@ -26,7 +26,7 @@ local M = {}
--
-- Key sequences are strings built from a combination of modifier keys and the
-- key itself. Modifier keys are "Control", "Shift", and "Alt" on Windows,
--- Linux, BSD, and in ncurses. On Mac OSX they are "Command" (`⌘`), "Alt/Option"
+-- Linux, BSD, and in curses. On Mac OSX they are "Command" (`⌘`), "Alt/Option"
-- (`⌥`), "Control" (`^`), and "Shift" (`⇧`). These modifiers have the following
-- string representations:
--
@@ -69,7 +69,7 @@ local M = {}
-- Key chains are a powerful concept. They allow multiple key bindings to be
-- assigned to one key sequence. Language-specific modules
-- [use key chains](#LANGUAGE_MODULE_PREFIX) for their functions. By default,
--- the `Esc` (`⎋` on Mac OSX | `Esc` in ncurses) key cancels a key chain, but it
+-- the `Esc` (`⎋` on Mac OSX | `Esc` in curses) key cancels a key chain, but it
-- can be redefined via [`CLEAR`](#CLEAR). An example key chain looks like:
--
-- keys['aa'] = {
@@ -81,18 +81,18 @@ local M = {}
-- The string representing the key sequence that clears the current key chain.
-- It cannot be part of a key chain.
-- The default value is `'esc'` for the `Esc` (`⎋` on Mac OSX | `Esc` in
--- ncurses) key.
+-- curses) key.
-- @field LANGUAGE_MODULE_PREFIX (string)
-- The starting key of the key chain reserved for language-specific modules.
-- The default value is `'cl'` on platforms other than Mac OSX, `'ml'`
--- otherwise. Equivalent to `Ctrl+L` (`⌘L` on Mac OSX | `M-L` in ncurses).
+-- otherwise. Equivalent to `Ctrl+L` (`⌘L` on Mac OSX | `M-L` in curses).
module('keys')]]
local ADD = ''
local CTRL, ALT, META, SHIFT = 'c'..ADD, 'a'..ADD, 'm'..ADD, 's'..ADD
-if NCURSES then ALT = META end
+if CURSES then ALT = META end
M.CLEAR = 'esc'
-M.LANGUAGE_MODULE_PREFIX = (not OSX and not NCURSES and CTRL or META)..'l'
+M.LANGUAGE_MODULE_PREFIX = (not OSX and not CURSES and CTRL or META)..'l'
-- Optimize for speed.
local OSX = OSX
@@ -113,7 +113,7 @@ local error = function(e) events.emit(events.ERROR, e) end
M.KEYSYMS = {
-- From Scintilla.h and cdk/curdefs.h.
[7] = 'esc', [8] = '\b', [9] = '\t', [13] = '\n', [27] = 'esc',
- -- From ncurses.h.
+ -- From curses.h.
[263] = '\b',
-- From Scintilla.h.
[300] = 'down', [301] = 'up', [302] = 'left', [303] = 'right',
@@ -226,7 +226,7 @@ local function keypress(code, shift, control, alt, meta)
local key
--print(code, M.KEYSYMS[code], shift, control, alt, meta)
if code < 256 then
- key = (not NCURSES or code ~= 7) and string_char(code) or M.KEYSYMS[code]
+ key = (not CURSES or code ~= 7) and string_char(code) or M.KEYSYMS[code]
shift = shift and code < 32 -- for printable characters, key is upper case
else
key = M.KEYSYMS[code]
@@ -237,7 +237,7 @@ local function keypress(code, shift, control, alt, meta)
--print(key_seq)
gui.statusbar_text = ''
- --if NCURSES then gui.statusbar_text = '"'..key_seq..'"' end
+ --if CURSES then gui.statusbar_text = '"'..key_seq..'"' end
if #keychain > 0 and key_seq == M.CLEAR then
clear_key_sequence()
return true
diff --git a/core/locale.conf b/core/locale.conf
index f694e806..ac7aa15f 100644
--- a/core/locale.conf
+++ b/core/locale.conf
@@ -90,7 +90,7 @@ An error occured: = An error occured:
%_OK = _OK
%_Cancel = _Cancel
replacement(s) made = replacement(s) made
-% For ncurses:
+% For curses:
%Find: = Find:
Replace: = Replace:
[Next] = [Next]
diff --git a/core/locale.lua b/core/locale.lua
index e888df22..a42b15f7 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -29,7 +29,7 @@ if not f then error('"core/locale.conf" not found.') end
for line in f:lines() do
if not line:find('^%s*%%') then
local id, str = line:match('^(.-)%s*=%s*(.+)$')
- if id and str then M[id] = not NCURSES and str or str:gsub('_', '') end
+ if id and str then M[id] = not CURSES and str or str:gsub('_', '') end
end
end
f:close()
diff --git a/core/locales/locale.es.conf b/core/locales/locale.es.conf
index 4ebf1152..3fcad09f 100644
--- a/core/locales/locale.es.conf
+++ b/core/locales/locale.es.conf
@@ -91,7 +91,7 @@ An error occured: = Ha ocurrido un error:
%_OK = _Aceptar
%_Cancel = _Cancelar
replacement(s) made = cambios(s) hecho(s)
-% For ncurses:
+% For curses:
%Find: = Buscar:
Replace: = Reemplazar:
[Next] = [Siguiente]
diff --git a/core/locales/locale.fr.conf b/core/locales/locale.fr.conf
index 907cf735..b93d6eaa 100644
--- a/core/locales/locale.fr.conf
+++ b/core/locales/locale.fr.conf
@@ -91,7 +91,7 @@ An error occured: = Une erreur est survenue:
%_OK = _OK
%_Cancel = _Annuler
replacement(s) made = remplacement(s) effectués
-% For ncurses:
+% For curses:
%Find: = Rechercher:
Replace: = Remplacer:
[Next] = [Suivant]