diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-21 01:07:31 +0100 | 
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-21 01:07:31 +0100 | 
| commit | fddab16ebc89386e4311e195361e611a2eee4b96 (patch) | |
| tree | 94a3a266fe827e11c000fac82a0eab4a1e18db78 /qbuffers.cpp | |
| parent | cefca2396003bdc69c0fd0eb90258e56148bf256 (diff) | |
Gq command to insert Q-Register at current DOT
Diffstat (limited to 'qbuffers.cpp')
| -rw-r--r-- | qbuffers.cpp | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/qbuffers.cpp b/qbuffers.cpp index a3b4651..26034f2 100644 --- a/qbuffers.cpp +++ b/qbuffers.cpp @@ -31,6 +31,7 @@ namespace States {  	StateLoadQReg		loadqreg;  	StateCtlUCommand	ctlucommand;  	StateSetQRegString	setqregstring; +	StateGetQRegString	getqregstring;  	StateGetQRegInteger	getqreginteger;  	StateSetQRegInteger	setqreginteger;  	StateIncreaseQReg	increaseqreg; @@ -834,6 +835,28 @@ StateSetQRegString::done(const gchar *str) throw (Error)  }  State * +StateGetQRegString::got_register(QRegister *reg) throw (Error) +{ +	gchar *str; + +	BEGIN_EXEC(&States::start); + +	str = reg->get_string(); +	if (*str) { +		interface.ssm(SCI_BEGINUNDOACTION); +		interface.ssm(SCI_ADDTEXT, strlen(str), (sptr_t)str); +		interface.ssm(SCI_SCROLLCARET); +		interface.ssm(SCI_ENDUNDOACTION); +		ring.dirtify(); + +		undo.push_msg(SCI_UNDO); +	} +	g_free(str); + +	return &States::start; +} + +State *  StateGetQRegInteger::got_register(QRegister *reg) throw (Error)  {  	BEGIN_EXEC(&States::start);  | 
