Fix hyperlinks not present when fetching text from the history buffer
Fixes #5427
This commit is contained in:
parent
e330c38d4a
commit
c856d5c058
@ -108,6 +108,9 @@ Detailed list of changes
|
|||||||
|
|
||||||
- Allow ignoring failure to close windows/tabs via rc commands (:disc:`5406`)
|
- Allow ignoring failure to close windows/tabs via rc commands (:disc:`5406`)
|
||||||
|
|
||||||
|
- Fix hyperlinks not present when fetching text from the history buffer
|
||||||
|
(:iss:`5427`)
|
||||||
|
|
||||||
|
|
||||||
0.25.2 [2022-06-07]
|
0.25.2 [2022-06-07]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -990,9 +990,6 @@ def create_test_font_group(sz: float, dpix: float,
|
|||||||
|
|
||||||
class HistoryBuf:
|
class HistoryBuf:
|
||||||
|
|
||||||
def as_text(self, callback: Callable[[str], None], as_ansi: bool, insert_wrap_markers: bool) -> None:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def pagerhist_as_text(self, upto_output_start: bool = False) -> str:
|
def pagerhist_as_text(self, upto_output_start: bool = False) -> str:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -1143,6 +1140,7 @@ class Screen:
|
|||||||
pass
|
pass
|
||||||
as_text_non_visual = as_text
|
as_text_non_visual = as_text
|
||||||
as_text_alternate = as_text
|
as_text_alternate = as_text
|
||||||
|
as_text_for_history_buf = as_text
|
||||||
|
|
||||||
def cmd_output(self, which: int, callback: Callable[[str], None], as_ansi: bool, insert_wrap_markers: bool) -> bool:
|
def cmd_output(self, which: int, callback: Callable[[str], None], as_ansi: bool, insert_wrap_markers: bool) -> bool:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -480,13 +480,11 @@ get_line_wrapper(void *x, int y) {
|
|||||||
return &glw->line;
|
return &glw->line;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
PyObject*
|
||||||
as_text(HistoryBuf *self, PyObject *args) {
|
as_text_history_buf(HistoryBuf *self, PyObject *args, ANSIBuf *output) {
|
||||||
GetLineWrapper glw = {.self=self};
|
GetLineWrapper glw = {.self=self};
|
||||||
glw.line.xnum = self->xnum;
|
glw.line.xnum = self->xnum;
|
||||||
ANSIBuf output = {0};
|
PyObject *ans = as_text_generic(args, &glw, get_line_wrapper, self->count, output);
|
||||||
PyObject *ans = as_text_generic(args, &glw, get_line_wrapper, self->count, &output);
|
|
||||||
free(output.buf);
|
|
||||||
return ans;
|
return ans;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -523,7 +521,6 @@ static PyMethodDef methods[] = {
|
|||||||
METHODB(pagerhist_rewrap, METH_O),
|
METHODB(pagerhist_rewrap, METH_O),
|
||||||
METHODB(pagerhist_as_text, METH_VARARGS),
|
METHODB(pagerhist_as_text, METH_VARARGS),
|
||||||
METHODB(pagerhist_as_bytes, METH_VARARGS),
|
METHODB(pagerhist_as_bytes, METH_VARARGS),
|
||||||
METHODB(as_text, METH_VARARGS),
|
|
||||||
METHOD(dirty_lines, METH_NOARGS)
|
METHOD(dirty_lines, METH_NOARGS)
|
||||||
METHOD(push, METH_VARARGS)
|
METHOD(push, METH_VARARGS)
|
||||||
METHOD(rewrap, METH_VARARGS)
|
METHOD(rewrap, METH_VARARGS)
|
||||||
|
|||||||
@ -2744,6 +2744,11 @@ as_text_non_visual(Screen *self, PyObject *args) {
|
|||||||
return as_text_generic(args, self, get_range_line, self->lines, &self->as_ansi_buf);
|
return as_text_generic(args, self, get_range_line, self->lines, &self->as_ansi_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject*
|
||||||
|
as_text_for_history_buf(Screen *self, PyObject *args) {
|
||||||
|
return as_text_history_buf(self->historybuf, args, &self->as_ansi_buf);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
as_text_generic_wrapper(Screen *self, PyObject *args, get_line_func get_line) {
|
as_text_generic_wrapper(Screen *self, PyObject *args, get_line_func get_line) {
|
||||||
return as_text_generic(args, self, get_line, self->lines, &self->as_ansi_buf);
|
return as_text_generic(args, self, get_line, self->lines, &self->as_ansi_buf);
|
||||||
@ -3975,6 +3980,7 @@ static PyMethodDef methods[] = {
|
|||||||
MND(set_pending_timeout, METH_O)
|
MND(set_pending_timeout, METH_O)
|
||||||
MND(as_text, METH_VARARGS)
|
MND(as_text, METH_VARARGS)
|
||||||
MND(as_text_non_visual, METH_VARARGS)
|
MND(as_text_non_visual, METH_VARARGS)
|
||||||
|
MND(as_text_for_history_buf, METH_VARARGS)
|
||||||
MND(as_text_alternate, METH_VARARGS)
|
MND(as_text_alternate, METH_VARARGS)
|
||||||
MND(cmd_output, METH_VARARGS)
|
MND(cmd_output, METH_VARARGS)
|
||||||
MND(tab, METH_NOARGS)
|
MND(tab, METH_NOARGS)
|
||||||
|
|||||||
@ -241,6 +241,7 @@ typedef struct SelectionUpdate {
|
|||||||
} SelectionUpdate;
|
} SelectionUpdate;
|
||||||
void screen_update_selection(Screen *self, index_type x, index_type y, bool in_left_half, SelectionUpdate upd);
|
void screen_update_selection(Screen *self, index_type x, index_type y, bool in_left_half, SelectionUpdate upd);
|
||||||
bool screen_history_scroll(Screen *self, int amt, bool upwards);
|
bool screen_history_scroll(Screen *self, int amt, bool upwards);
|
||||||
|
PyObject* as_text_history_buf(HistoryBuf *self, PyObject *args, ANSIBuf *output);
|
||||||
Line* screen_visual_line(Screen *self, index_type y);
|
Line* screen_visual_line(Screen *self, index_type y);
|
||||||
unsigned long screen_current_char_width(Screen *self);
|
unsigned long screen_current_char_width(Screen *self);
|
||||||
void screen_mark_url(Screen *self, index_type start_x, index_type start_y, index_type end_x, index_type end_y);
|
void screen_mark_url(Screen *self, index_type start_x, index_type start_y, index_type end_x, index_type end_y);
|
||||||
|
|||||||
@ -270,7 +270,7 @@ def as_text(
|
|||||||
if add_history:
|
if add_history:
|
||||||
pht = pagerhist(screen, as_ansi, add_wrap_markers)
|
pht = pagerhist(screen, as_ansi, add_wrap_markers)
|
||||||
h: List[str] = [pht] if pht else []
|
h: List[str] = [pht] if pht else []
|
||||||
screen.historybuf.as_text(h.append, as_ansi, add_wrap_markers)
|
screen.as_text_for_history_buf(h.append, as_ansi, add_wrap_markers)
|
||||||
if h:
|
if h:
|
||||||
if not screen.linebuf.is_continued(0):
|
if not screen.linebuf.is_continued(0):
|
||||||
h[-1] += '\n'
|
h[-1] += '\n'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user