aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/document.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-22 21:18:14 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-22 21:18:14 +0100
commit1b636e3cc7326e9139ff107b2818703181c6e7f7 (patch)
tree21f7f1e35f9898638c85a533e13b3bf813fd4992 /src/document.h
parent99f6da572f455b0ba17c341ec1a63c5826de3ecf (diff)
downloadsciteco-1b636e3cc7326e9139ff107b2818703181c6e7f7.tar.gz
save/restore anchor position along with dot (current position) when editing documents
* fixes search-replace commands when function keys are used since they rely on selections not being disturbed * will also be useful later when there may be other selections
Diffstat (limited to 'src/document.h')
-rw-r--r--src/document.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/document.h b/src/document.h
index 2ef71ba..0f02a9e 100644
--- a/src/document.h
+++ b/src/document.h
@@ -41,9 +41,8 @@ class TECODocument {
SciDoc doc;
/* updated/restored only when required */
- gint dot;
- gint first_line;
- gint xoffset;
+ gint anchor, dot;
+ gint first_line, xoffset;
public:
TECODocument() : doc(NULL)
@@ -69,6 +68,7 @@ public:
inline void
update(const TECODocument &from)
{
+ anchor = from.anchor;
dot = from.dot;
first_line = from.first_line;
xoffset = from.xoffset;
@@ -77,11 +77,13 @@ public:
inline void
reset(void)
{
- dot = first_line = xoffset = 0;
+ anchor = dot = 0;
+ first_line = xoffset = 0;
}
inline void
undo_reset(void)
{
+ undo.push_var(anchor);
undo.push_var(dot);
undo.push_var(first_line);
undo.push_var(xoffset);