Ctrl-f fills with currently selected
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
- What precise workflow do I need for me to be viable to use this?
|
||||
- From a user (novice) point of view, how does it look like?
|
||||
|
||||
|
||||
- Open with seek string (open at pattern) filename:32 filename:/^Window$/
|
||||
- ctrl+f should insert selected text into search
|
||||
- Do we need constrained jump history????? So that we can finally collect garbage buffers at some point. Or maybe only constrained to garbage buffers
|
||||
- build console window
|
||||
- Show what process/coroutines are running and allow to kill (active process buffer?)
|
||||
- Database idea: use special buffers to store information
|
||||
|
||||
@@ -103,6 +103,10 @@ API Int GetMin(Caret caret) {
|
||||
return result;
|
||||
}
|
||||
|
||||
API Int GetSize(Caret caret) {
|
||||
return GetSize(caret.range);
|
||||
}
|
||||
|
||||
API Caret MakeCaret(Int pos) {
|
||||
Caret result = {};
|
||||
result.range.min = result.range.max = pos;
|
||||
|
||||
@@ -35,8 +35,7 @@ String GetMainDir() {
|
||||
void JumpGarbageBuffer(BSet *set, String buffer_name = "") {
|
||||
CheckpointBeforeGoto(set->window);
|
||||
if (buffer_name.len == 0) {
|
||||
String current_dir = ChopLastSlash(set->buffer->name);
|
||||
buffer_name = GetUniqueBufferName(current_dir, "temp");
|
||||
buffer_name = GetUniqueBufferName(GetDir(set->buffer), "temp");
|
||||
}
|
||||
set->view = WindowOpenBufferView(set->window, buffer_name);
|
||||
set->buffer = GetBuffer(set->view->active_buffer);
|
||||
|
||||
@@ -160,7 +160,7 @@ void Command_ShowBufferList() {
|
||||
ActiveWindowID = command_bar.window->id;
|
||||
ResetBuffer(command_bar.buffer);
|
||||
For (Buffers) {
|
||||
if (it->special) {
|
||||
if (it->special || it->garbage) {
|
||||
continue;
|
||||
}
|
||||
RawAppendf(command_bar.buffer, "\n%S", it->name);
|
||||
|
||||
@@ -33,10 +33,19 @@ void SearchWindowLayout(Rect2I *rect, Int wx, Int wy) {
|
||||
}
|
||||
|
||||
void Command_Search() {
|
||||
BSet main = GetBSet(ActiveWindowID);
|
||||
String16 string = {};
|
||||
if (main.view->carets.len == 1 && GetSize(main.view->carets[0]) > 0) {
|
||||
string = GetString(main.buffer, main.view->carets[0].range);
|
||||
}
|
||||
BSet set = GetBSet(SearchWindowID);
|
||||
set.window->visible = true;
|
||||
ActiveWindowID = SearchWindowID;
|
||||
SelectEntireBuffer(set.view);
|
||||
if (string.len > 0) {
|
||||
Replace(set.view, string);
|
||||
SelectEntireBuffer(set.view);
|
||||
}
|
||||
} RegisterCommand(Command_Search, "ctrl-f");
|
||||
|
||||
void SearchWindowFindNext(bool forward = true) {
|
||||
|
||||
Reference in New Issue
Block a user