summaryrefslogtreecommitdiff
path: root/context/data/textadept/context/modules
diff options
context:
space:
mode:
Diffstat (limited to 'context/data/textadept/context/modules')
-rw-r--r--context/data/textadept/context/modules/textadept-context-files.lua16
-rw-r--r--context/data/textadept/context/modules/textadept-context-settings.lua44
2 files changed, 40 insertions, 20 deletions
diff --git a/context/data/textadept/context/modules/textadept-context-files.lua b/context/data/textadept/context/modules/textadept-context-files.lua
index d3412edc1..28cc794cb 100644
--- a/context/data/textadept/context/modules/textadept-context-files.lua
+++ b/context/data/textadept/context/modules/textadept-context-files.lua
@@ -366,7 +366,7 @@ do
}
- newkeys[OSX and 'mc' or 'cc'] = runner.check
+ -- newkeys[OSX and 'mc' or 'cc'] = runner.check
newkeys[OSX and 'mr' or 'cr'] = runner.process
newkeys[OSX and 'mp' or 'cp'] = runner.preview
-- newkeys[OSX and 'mx' or 'cx'] = runner.quit -- makes no sense
@@ -529,7 +529,7 @@ end
do
- -- It's a pity that we can't have a proper monospaced font here so we try to make the best of it:
+ -- It's a pitt y that we can't have a proper monospaced font here so we try to make the best of it:
local template = "\n\trelease info: %s\t\n\n\tcopyright: %s\t\n\n\tvariant: ConTeXt related editing\t\n\n\tadapted by: Hans Hagen\t"
@@ -697,7 +697,7 @@ local function synchronize(lexer)
end
events.connect(events.FILE_OPENED,function(filename)
- synchronize(buffer.get_lexer(buffer))
+ synchronize(buffer:get_lexer())
end)
events.connect(events.LEXER_LOADED,function(lexer)
@@ -707,23 +707,23 @@ end)
-- obsolete
-- events.connect(events.BUFFER_AFTER_SWITCH,function()
--- synchronize(buffer.get_lexer(buffer))
+-- synchronize(buffer:get_lexer())
-- end)
-- events.connect(events.VIEW_AFTER_SWITCH,function()
--- synchronize(buffer.get_lexer(buffer))
+-- synchronize(buffer:get_lexer())
-- end)
-- events.connect(events.BUFFER_NEW,function()
--- synchronize(buffer.get_lexer(buffer))
+-- synchronize(buffer:get_lexer())
-- end)
-- events.connect(events.VIEW_NEW,function()
--- synchronize(buffer.get_lexer(buffer))
+-- synchronize(buffer:get_lexer())
-- end)
-- events.connect(events.RESET_AFTER,function()
--- synchronize(buffer.get_lexer(buffer))
+-- synchronize(buffer:get_lexer())
-- end)
-- local oldtools = { }
diff --git a/context/data/textadept/context/modules/textadept-context-settings.lua b/context/data/textadept/context/modules/textadept-context-settings.lua
index 53b5c896f..4a5be38da 100644
--- a/context/data/textadept/context/modules/textadept-context-settings.lua
+++ b/context/data/textadept/context/modules/textadept-context-settings.lua
@@ -95,21 +95,41 @@ if context then
buffer.annotation_visible = buffer.ANNOTATION_BOXED
- -- local NUMBER_MARGIN = 0
- -- local MARKER_MARGIN = 1
- -- local FOLD_MARGIN = 2 -- there are more
- --
- -- buffer.margin_type_n [NUMBER_MARGIN] = buffer.MARGIN_NUMBER
- -- buffer.margin_width_n[NUMBER_MARGIN] = (CURSES and 0 or 4)
- -- + 4 * buffer:text_width(buffer.STYLE_LINENUMBER,'9') -- magic
- -- buffer.margin_width_n[MARKER_MARGIN] = CURSES and 1 or 4
- -- buffer.margin_width_n[FOLD_MARGIN] = CURSES and 1 or 12
- --
- -- buffer.margin_mask_n[FOLD_MARGIN] = buffer.MASK_FOLDERS
+ local NUMBER_MARGIN = 0
+ local MARKER_MARGIN = 1
+ local FOLD_MARGIN = 2 -- there are more
+
+ buffer.margin_type_n [NUMBER_MARGIN] = buffer.MARGIN_NUMBER
+ buffer.margin_width_n[NUMBER_MARGIN] = (CURSES and 0 or 6) + 4 * buffer:text_width(buffer.STYLE_LINENUMBER,'9') -- magic
+ buffer.margin_width_n[MARKER_MARGIN] = CURSES and 1 or 18
+ buffer.margin_width_n[FOLD_MARGIN] = CURSES and 1 or 18
+
+ buffer.margin_mask_n[FOLD_MARGIN] = buffer.MASK_FOLDERS -- does something weird: bullets
+
+ buffer:marker_define(buffer.MARKNUM_FOLDEROPEN, buffer.MARK_BOXMINUS)
+ buffer:marker_define(buffer.MARKNUM_FOLDER, buffer.MARK_BOXPLUS)
+ buffer:marker_define(buffer.MARKNUM_FOLDERSUB, buffer.MARK_VLINE)
+ buffer:marker_define(buffer.MARKNUM_FOLDERTAIL, buffer.MARK_LCORNER)
+ buffer:marker_define(buffer.MARKNUM_FOLDEREND, buffer.MARK_BOXPLUSCONNECTED)
+ buffer:marker_define(buffer.MARKNUM_FOLDEROPENMID, buffer.MARK_BOXMINUSCONNECTED)
+ buffer:marker_define(buffer.MARKNUM_FOLDERMIDTAIL, buffer.MARK_TCORNER)
+
+ -- buffer.fold_all = buffer.FOLDACTION_CONTRACT + buffer.FOLDACTION_EXPAND + buffer.FOLDACTION_TOGGLE
+
+ -- somehow the foldeing sumbol sin th emargin cannot be clicked on ... there seems to be some
+ -- interface .. if this needs to be implemented via events i'll then probably make a copy and
+ -- start doing all
+
+ -- buffer.margin_sensitive_n[2] = true
+
+ -- buffer.property['fold'] = "1"
+ -- buffer.automatic_fold = buffer.AUTOMATICFOLD_SHOW + buffer.AUTOMATICFOLD_CLICK + buffer.AUTOMATICFOLD_CHANGE
+ -- buffer.fold_flags = not CURSES and buffer.FOLDFLAG_LINEAFTER_CONTRACTED or 0
+ -- buffer.fold_display_text_style = buffer.FOLDDISPLAYTEXT_BOXED
buffer.wrap_mode = buffer.WRAP_NONE
- buffer.margin_back_n[0] = property_int["color.linenumber"] -- doesn't work
+ buffer.margin_back_n[NUMBER_MARGIN] = property_int["color.linenumber"] -- doesn't work
buffer.property = {
-- ["style.linenumber"] = property["style.linenumber"], -- somehow it fails