Auto enclose
This commit is contained in:
@@ -891,6 +891,7 @@ void Command_SelectTitlebarCommand(Window *window, String16 needle) {
|
|||||||
BSet title = GetTitleSet(window);
|
BSet title = GetTitleSet(window);
|
||||||
String16 buffer_string = GetString(title.buffer);
|
String16 buffer_string = GetString(title.buffer);
|
||||||
ActiveWindow = title.window->id;
|
ActiveWindow = title.window->id;
|
||||||
|
title.window->auto_enclose = true;
|
||||||
|
|
||||||
Scratch scratch;
|
Scratch scratch;
|
||||||
String16 quoted16 = {};
|
String16 quoted16 = {};
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ void GlobalCommand(Event event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BSet active = GetActiveSet();
|
BSet active = GetActiveSet();
|
||||||
|
Int buffer_change_id = active.buffer->change_id;
|
||||||
|
|
||||||
if (event.kind == EVENT_DROP_FILE) {
|
if (event.kind == EVENT_DROP_FILE) {
|
||||||
WindowOpenBufferView(active.window, event.text);
|
WindowOpenBufferView(active.window, event.text);
|
||||||
@@ -456,7 +457,8 @@ void GlobalCommand(Event event) {
|
|||||||
GotoBackward(GetActiveMainSet().window);
|
GotoBackward(GetActiveMainSet().window);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CtrlShift(SDLK_Q)) {
|
bool should_enclose = active.window->auto_enclose && (active.buffer->change_id != buffer_change_id);
|
||||||
|
if (should_enclose || CtrlShift(SDLK_Q)) {
|
||||||
Caret caret = active.view->carets[0];
|
Caret caret = active.view->carets[0];
|
||||||
Range range = caret.range;
|
Range range = caret.range;
|
||||||
if (GetSize(caret.range) == 0) range = EncloseExecWord(active.buffer, GetFront(caret));
|
if (GetSize(caret.range) == 0) range = EncloseExecWord(active.buffer, GetFront(caret));
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ struct Window {
|
|||||||
bool is_title_bar : 1;
|
bool is_title_bar : 1;
|
||||||
bool is_column : 1;
|
bool is_column : 1;
|
||||||
|
|
||||||
|
bool auto_enclose : 1;
|
||||||
bool deactivate_on_escape : 1;
|
bool deactivate_on_escape : 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
- group history entries so the you can rollback through multiple ones at once and not waste time on skipping whitespace trimming or deleting every character
|
- group history entries so the you can rollback through multiple ones at once and not waste time on skipping whitespace trimming or deleting every character
|
||||||
|
|
||||||
- Fuzzy search buffer which uses titlebar as query!
|
- Fuzzy search buffer which uses titlebar as query!
|
||||||
- Gotos, jumping between views should preserve cursors, maybe just scroll
|
|
||||||
- ReportWarning should be signaled visibly but you should be able to do things! no focus switching
|
- ReportWarning should be signaled visibly but you should be able to do things! no focus switching
|
||||||
|
|
||||||
- OnWindowCommand allow config user to overwrite the WindowCommand keybinding, introduce his own
|
- OnWindowCommand allow config user to overwrite the WindowCommand keybinding, introduce his own
|
||||||
|
|||||||
Reference in New Issue
Block a user