Compare commits

..

3 Commits

Author SHA1 Message Date
Krzosa Karol
bbab59fa0a NonCodePatterns_EndsWith 2026-01-01 14:29:33 +01:00
Krzosa Karol
6cf9731959 Wheel scrolling 2026-01-01 13:48:21 +01:00
Krzosa Karol
c4b4460cbd List the build buffer 2026-01-01 13:31:38 +01:00
5 changed files with 33 additions and 4 deletions

View File

@@ -2,8 +2,11 @@
! From a user (novice) point of view, how does it look like?
- Make a fuzzy command !> grep and fuzzy over it??? (doesn't seem very useful for grep)
- OpenCode :Set CodeExcludePatterns ".git/|mk
- ClangFormatOnCCode variable
- CleanTrailingWhitespace
- Make all the keybinding / hook parsing initialize at the start to reduce runtime problems
- Initialize all keybindings at the start and refer using global variables?
- RegisterCommand should_appear_in_listing variable
- Maybe one list for all variables including the commands etc?
- Problem generating configs don't know which quotation marks would be good ....

View File

@@ -690,13 +690,13 @@ String CodeSkipPatterns[] = {".git/", ".obj", ".o", ".pdb", ".exe", "SDL/", ".il
String Coro_OpenCodeDir;
void Coro_OpenCode(mco_coro *co) {
Array<String> patterns = Split(CoCurr->arena, NonCodePatterns_EndsWith, "|");
Array<String> dirs = {CoCurr->arena};
Add(&dirs, Coro_OpenCodeDir);
for (int diri = 0; diri < dirs.len; diri += 1) {
for (FileIter it = IterateFiles(CoCurr->arena, dirs[diri]); IsValid(it); Advance(&it)) {
bool match = false;
for (int endings_i = 0; endings_i < Lengthof(CodeSkipPatterns); endings_i += 1) {
String ending = CodeSkipPatterns[endings_i];
ForItem (ending, patterns) {
if (EndsWith(it.absolute_path, ending)) {
match = true;
break;
@@ -1394,6 +1394,7 @@ void EvalCommandsLineByLine(BSet set) {
WindowID save_last = LastActiveLayoutWindowID;
WindowID save_active = ActiveWindowID;
WindowID save_next = NextActiveWindowID;
Caret save_caret = set.view->carets[0];
ActiveWindowID = set.window->id;
LastActiveLayoutWindowID = set.window->id;
NextActiveWindowID = set.window->id;
@@ -1411,6 +1412,7 @@ void EvalCommandsLineByLine(BSet set) {
}
Open(string);
}
set.view->carets[0] = save_caret;
LastActiveLayoutWindowID = save_last;
ActiveWindowID = save_active;
NextActiveWindowID = save_next;

View File

@@ -44,6 +44,7 @@ WindowID DocumentSelected = {-1};
WindowID ResizerSelected = {-1};
WindowID ResizerHover = {-1};
Caret DocumentAnchor;
Vec2I MouseMiddleAnchor;
Buffer *GCInfoBuffer;
Buffer *EventBuffer;
@@ -159,3 +160,4 @@ RegisterVariable(String, VCVarsall, "C:/Program Files/Microsoft Visual Studio/20
RegisterVariable(Float, UndoMergeTime, 0.3);
RegisterVariable(Float, JumpHistoryMergeTime, 0.3);
RegisterVariable(String, InternetBrowser, "firefox");
RegisterVariable(String, NonCodePatterns_EndsWith, ".git/|.obj|.o|.pdb|.exe|.ilk|.ttf|.ico|.gif|.jpg|.png|.spall");

View File

@@ -58,6 +58,8 @@ void SetMouseCursor(SDL_SystemCursor id) {
JS_SetMouseCursor("default");
} else if (id == SDL_SYSTEM_CURSOR_TEXT) {
JS_SetMouseCursor("text");
} else if (id == SDL_SYSTEM_CURSOR_MOVE) {
JS_SetMouseCursor("all-scroll");
} else {
InvalidCodepath();
}
@@ -104,6 +106,11 @@ void SetMouseCursor(Event event) {
return;
}
if (MouseMiddleAnchor.x != 0 && MouseMiddleAnchor.y != 0) {
SetMouseCursor(SDL_SYSTEM_CURSOR_MOVE);
return;
}
For(order) {
if (!it->visible) continue;
bool mouse_in_total = AreOverlapping(mouse, it->total_rect);
@@ -315,6 +322,20 @@ void OnCommand(Event event) {
MouseLoadWord(event);
}
{
Vec2I mouse = MouseVec2I();
if (Mouse(MIDDLE)) {
MouseMiddleAnchor = mouse;
} else if (Mouse(MIDDLE_UP)) {
MouseMiddleAnchor = {0, 0};
}
if (MouseMiddleAnchor.x != 0) {
BSet active = GetBSet(ActiveWindowID);
active.view->scroll += mouse - MouseMiddleAnchor;
}
}
if (Ctrl() && Mouse(LEFT)) {
MouseLoadWord(event);
} else if (Mouse(LEFT)) { // Uses Alt and shift

View File

@@ -121,7 +121,8 @@ void CMD_ShowBufferList() {
ResetBuffer(command_bar.buffer);
For (Buffers) {
if (it->special || it->temp) {
if (it->id != NullBufferID) continue;
if (it->id != NullBufferID && it->id != BuildBufferID) continue;
}
RawAppendf(command_bar.buffer, "\n%S", it->name);
}