Introduction
Introduction Statistics Contact Development Disclaimer Help
tMerge remote-tracking branch 'origin/master' - ledit - Text editor (WIP)
git clone git://lumidify.org/ledit.git (fast, but not encrypted)
git clone https://lumidify.org/git/ledit.git (encrypted, but very slow)
Log
Files
Refs
README
LICENSE
---
commit ef274ec6dc1e799a3e33b7dc203cded67160752e
parent 1b405e16faddabd36b26297c27c746aa7788a2d4
Author: lumidify <[email protected]>
Date: Thu, 26 May 2022 22:03:49 +0200
Merge remote-tracking branch 'origin/master'
Diffstat:
M buffer.c | 2 +-
M undo.c | 15 +++++++++++++++
M view.c | 3 +--
3 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/buffer.c b/buffer.c
t@@ -316,7 +316,7 @@ buffer_remove_view(ledit_buffer *buffer, ledit_view *view)…
free(buffer->views);
buffer->views = NULL;
} else {
- buffer->views = ledit_reallocarray(buffer->views, --bu…
+ buffer->views = ledit_reallocarray(buffer->views, buff…
}
}
}
diff --git a/undo.c b/undo.c
t@@ -123,6 +123,17 @@ push_undo(
txtbuf_copy(e->text, text);
else
e->text = txtbuf_dup(text);
+ /*
+ printf("START UNDO STACK\n");
+ for (size_t i = 0; i < undo->len; i++) {
+ undo_elem *e = &undo->stack[i];
+ printf(
+ "type %d, mode %d, group %d, mode_group %d, text '%.*s'\n",
+ e->type, e->mode, e->group, e->mode_group, (int)e->text->l…
+ );
+ }
+ printf("END UNDO STACK\n");
+ */
}
void
t@@ -221,6 +232,8 @@ ledit_undo(undo_stack *undo, ledit_mode mode, void *callba…
*cur_line_ret = cur_line;
*cur_index_ret = cur_index;
*min_line_ret = min_line;
+ if (mode == NORMAL || mode == VISUAL)
+ undo_change_mode_group(undo);
return UNDO_NORMAL;
}
t@@ -289,6 +302,8 @@ ledit_redo(undo_stack *undo, ledit_mode mode, void *callba…
if (undo->cur > 0)
undo->cur--;
*min_line_ret = min_line;
+ if (mode == NORMAL || mode == VISUAL)
+ undo_change_mode_group(undo);
return UNDO_NORMAL;
}
diff --git a/view.c b/view.c
t@@ -1048,9 +1048,8 @@ set_pango_text_and_highlight(ledit_view *view, size_t li…
err_overflow();
pango_layout_set_text(cl->layout, ll->text, (int)ll->len);
set_line_layout_attrs(view, line, cl->layout);
- /* FIXME: is this guard necessary? */
- vl->softlines = ll->len > 0 ? pango_layout_get_line_count(cl->…
pango_layout_set_width(cl->layout, vl->w * PANGO_SCALE);
+ vl->softlines = pango_layout_get_line_count(cl->layout);
int w, h;
pango_layout_get_pixel_size(cl->layout, &w, &h);
if (h != vl->h) {
You are viewing proxied material from lumidify.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.