summaryrefslogtreecommitdiff
path: root/src/normal.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-04-07 23:39:12 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-04-07 23:47:50 +0100
commit33de42610dc08dd7bfd65f49a70ec68a478dee2d (patch)
tree82b0b94accd9dd30bfde6a0674adbbb260b0fbb2 /src/normal.cc
parenta387e7a4c61d3392bbb37190521c03e6676af3eb (diff)
Add g. command to go to the last buffer modification position
Diffstat (limited to 'src/normal.cc')
-rw-r--r--src/normal.cc30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/normal.cc b/src/normal.cc
index b0794e8f..8b691190 100644
--- a/src/normal.cc
+++ b/src/normal.cc
@@ -315,18 +315,28 @@ void goto_commands(Context& context, int line)
CommandManager::instance().execute("edit '" + path + "'", context);
break;
}
+ case '.':
+ {
+ context.push_jump();
+ auto pos = buffer.last_modification_coord();
+ if (buffer[pos.line].length() == pos.column + 1)
+ pos = BufferCoord{ pos.line+1, 0 };
+ select_coord<mode>(buffer, pos, context.selections());
+ break;
+ }
}
}, "goto",
- "g,k: buffer top \n"
- "l: line end \n"
- "h: line begin \n"
- "j: buffer bottom\n"
- "e: buffer end \n"
- "t: window top \n"
- "b: window bottom\n"
- "c: window center\n"
- "a: last buffer \n"
- "f: file \n");
+ "g,k: buffer top \n"
+ "l: line end \n"
+ "h: line begin \n"
+ "j: buffer bottom \n"
+ "e: buffer end \n"
+ "t: window top \n"
+ "b: window bottom \n"
+ "c: window center \n"
+ "a: last buffer \n"
+ "f: file \n"
+ ".: last buffer change\n");
}
}