mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-19 17:31:44 +03:00
support register access through ctrl-r in ncurses_prompt
This commit is contained in:
parent
1ef476ed4d
commit
9304e41326
11
src/main.cc
11
src/main.cc
@ -27,6 +27,8 @@
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#define CTRL(x) x - 'a' + 1
|
||||
|
||||
using namespace Kakoune;
|
||||
using namespace std::placeholders;
|
||||
|
||||
@ -292,6 +294,15 @@ std::string ncurses_prompt(const std::string& text, Completer completer = comple
|
||||
|
||||
current_completion = -1;
|
||||
break;
|
||||
case CTRL('r'):
|
||||
{
|
||||
c = getch();
|
||||
std::string reg = RegisterManager::instance()[c].get();
|
||||
current_completion = -1;
|
||||
result = result.substr(0, cursor_pos) + reg + result.substr(cursor_pos, std::string::npos);
|
||||
cursor_pos += reg.length();
|
||||
}
|
||||
break;
|
||||
case 27:
|
||||
throw prompt_aborted();
|
||||
case '\t':
|
||||
|
Loading…
Reference in New Issue
Block a user