mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 00:05:46 +01:00
Add standard 'mark' completer. Fix x/y transposition in :delm completion
This commit is contained in:
@@ -1653,18 +1653,7 @@ function Marks() //{{{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
bang: true,
|
bang: true,
|
||||||
completer: function (context)
|
completer: function (context) completion.mark(context)
|
||||||
{
|
|
||||||
let marks = getSortedMarks();
|
|
||||||
|
|
||||||
function markinfo( m )
|
|
||||||
{
|
|
||||||
return Math.round(m.position.x * 100) + "% " + Math.round(m.position.y * 100) + "% " + m.location;
|
|
||||||
}
|
|
||||||
|
|
||||||
context.title = ["Mark", "Line/Column/File"];
|
|
||||||
context.completions = [[mark[0], markinfo(mark[1])] for each (mark in marks)];
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
commands.add(["ma[rk]"],
|
commands.add(["ma[rk]"],
|
||||||
@@ -1710,6 +1699,8 @@ function Marks() //{{{
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
|
get all() getSortedMarks(),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a named mark for the current buffer, at its current position.
|
* Add a named mark for the current buffer, at its current position.
|
||||||
* If mark matches [A-Z], it's considered a URL mark, and will jump to
|
* If mark matches [A-Z], it's considered a URL mark, and will jump to
|
||||||
|
|||||||
@@ -1608,6 +1608,19 @@ function Completion() //{{{
|
|||||||
context.completions = [item for (item in events.getMacros())];
|
context.completions = [item for (item in events.getMacros())];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mark: function mark(context)
|
||||||
|
{
|
||||||
|
function percent(i) Math.round(i * 100);
|
||||||
|
|
||||||
|
// FIXME: Line/Column doesn't make sense with %
|
||||||
|
context.title = ["Mark", "Line Column File"];
|
||||||
|
context.keys = {
|
||||||
|
text: 0,
|
||||||
|
description: function ([,m]) percent(m.position.y) + "% " + percent(m.position.x) + "% " + m.location
|
||||||
|
};
|
||||||
|
context.completions = marks.all;
|
||||||
|
},
|
||||||
|
|
||||||
menuItem: function menuItem(filter) commands.get("emenu").completer(filter), // XXX
|
menuItem: function menuItem(filter) commands.get("emenu").completer(filter), // XXX
|
||||||
|
|
||||||
option: function option(context, scope)
|
option: function option(context, scope)
|
||||||
|
|||||||
@@ -967,7 +967,7 @@ function QuickMarks() //{{{
|
|||||||
completer: function (context)
|
completer: function (context)
|
||||||
{
|
{
|
||||||
context.title = ["QuickMark", "URL"];
|
context.title = ["QuickMark", "URL"];
|
||||||
context.completions = [[key, val] for ([key, val] in qmarks)];
|
context.completions = qmarks;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user