Misc
This commit is contained in:
@@ -449,11 +449,13 @@ Range EncloseScope(Buffer *buffer, Int pos, wchar_t open, wchar_t close) {
|
|||||||
for (Int i = pos; i >= 0; i -= 1) {
|
for (Int i = pos; i >= 0; i -= 1) {
|
||||||
if (buffer->str[i] == open) {
|
if (buffer->str[i] == open) {
|
||||||
result.min = i;
|
result.min = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Int i = pos; i < buffer->len; i += 1) {
|
for (Int i = pos; i < buffer->len; i += 1) {
|
||||||
if (buffer->str[i] == close) {
|
if (buffer->str[i] == close) {
|
||||||
result.max = i + 1;
|
result.max = i + 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ void WindowCommand(Event event, Window *window, View *view) {
|
|||||||
search = true;
|
search = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Ctrl(SDLK_W)) {
|
if (Ctrl(SDLK_T)) {
|
||||||
Int pos = view->carets[0].range.min;
|
Int pos = view->carets[0].range.min;
|
||||||
Range range = EncloseScope(buffer, pos, L'{', L'}');
|
Range range = EncloseScope(buffer, pos, L'{', L'}');
|
||||||
view->carets[0] = MakeCaret(range.max, range.min);
|
view->carets[0] = MakeCaret(range.max, range.min);
|
||||||
@@ -833,6 +833,8 @@ void WindowCommand(Event event, Window *window, View *view) {
|
|||||||
Vec2I mouse = MouseVec2I();
|
Vec2I mouse = MouseVec2I();
|
||||||
Int p = ScreenSpaceToBufferPos(window, view, buffer, mouse);
|
Int p = ScreenSpaceToBufferPos(window, view, buffer, mouse);
|
||||||
Insert(&view->carets, MakeCaret(p, p), 0);
|
Insert(&view->carets, MakeCaret(p, p), 0);
|
||||||
|
|
||||||
|
// @todo: hold - create a rectangle selection with multiple cursors on each line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ void ReplaceDebugData() {
|
|||||||
float xmouse, ymouse;
|
float xmouse, ymouse;
|
||||||
SDL_GetMouseState(&xmouse, &ymouse);
|
SDL_GetMouseState(&xmouse, &ymouse);
|
||||||
Appendf(buffer, "mouse: [%f, %f]\n", xmouse, ymouse);
|
Appendf(buffer, "mouse: [%f, %f]\n", xmouse, ymouse);
|
||||||
|
Appendf(buffer, "window count: %d view count: %d buffer count: %d\n", (int)Windows.len, (int)Views.len, (int)Buffers.len);
|
||||||
Appendf(buffer, "C:/Work/text_editor/src/text_editor/text_editor.cpp\n");
|
Appendf(buffer, "C:/Work/text_editor/src/text_editor/text_editor.cpp\n");
|
||||||
|
|
||||||
// String view_list = DebugViewList(scratch);
|
// String view_list = DebugViewList(scratch);
|
||||||
|
|||||||
@@ -1,19 +1,10 @@
|
|||||||
- bugs:
|
- page up and down should also scroll and leave you in exactly same scroll
|
||||||
- page up and down should also scroll and leave you in exactly same scroll
|
- I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection)
|
||||||
- I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection)
|
|
||||||
|
|
||||||
- mouse needs a rewrite
|
- bug: Latin-1 is matched as column for some reason in ApplyRules!!
|
||||||
- hand cursor on hover over underlined word
|
|
||||||
- maybe we don't need multiple cursors on mouse???
|
|
||||||
- ctrl + left mouse to load / ctrl + right mouse to go back
|
|
||||||
- alt + left to exec / alt + right to toggle console or something related
|
|
||||||
- similar mirroring on keyboard with W/Q Ctrl/Alt
|
|
||||||
- mid click to create new cursor?
|
|
||||||
|
|
||||||
- mid click - create new cursor
|
|
||||||
- mid click hold - create a rectangle selection with multiple cursors on each line
|
|
||||||
|
|
||||||
- delete multiple spaces (based on indent size) on delete instead one by one. It should only work at beginning of line, in indent area
|
- select space between parens,braces but make it good
|
||||||
- switch to previous view (ctrl + tab)
|
- switch to previous view (ctrl + tab)
|
||||||
- we could rewrite kill lines with simpler commands - extend selection to encompass lines->replace
|
- we could rewrite kill lines with simpler commands - extend selection to encompass lines->replace
|
||||||
- should be able click on title bar of windows which disappear on losing focus
|
- should be able click on title bar of windows which disappear on losing focus
|
||||||
@@ -21,7 +12,6 @@
|
|||||||
- experiment with using multiple cursors to select command and it's input
|
- experiment with using multiple cursors to select command and it's input
|
||||||
- search as a command to execute which is going to be in the title bar
|
- search as a command to execute which is going to be in the title bar
|
||||||
- Ctrl + G should select the line number in bar
|
- Ctrl + G should select the line number in bar
|
||||||
- auto register commands, but we need to figure out how to properly structure lua stuff
|
|
||||||
- console window should close on esacpe but make it more coherent
|
- console window should close on esacpe but make it more coherent
|
||||||
- make the editor replayable, store events and then replay, be careful about globals
|
- make the editor replayable, store events and then replay, be careful about globals
|
||||||
- I want a way to assign flags to buffers/views/windows from user perspective so that console window concept can be created from user space
|
- I want a way to assign flags to buffers/views/windows from user perspective so that console window concept can be created from user space
|
||||||
@@ -34,8 +24,9 @@
|
|||||||
- Search and replace
|
- Search and replace
|
||||||
- Search result buffer
|
- Search result buffer
|
||||||
- yeet sheet
|
- yeet sheet
|
||||||
- select space between parens,braces
|
|
||||||
- color parens, braces
|
- color parens, braces
|
||||||
|
- auto register commands, but we need to figure out how to properly structure lua stuff
|
||||||
|
|
||||||
- double click - start enclosing word, triple click - start enclosing lines, merge 2 cursor selection - start treating it as anchor
|
- double click - start enclosing word, triple click - start enclosing lines, merge 2 cursor selection - start treating it as anchor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user