Update todo, add indent size option

This commit is contained in:
Krzosa Karol
2024-08-03 07:26:37 +02:00
parent 4c7f6340d6
commit f79fce83ca
5 changed files with 41 additions and 51 deletions

View File

@@ -297,7 +297,7 @@ end
-- function RuleFindExistingBuffer(_s)
-- line, col, _s = ExtractLineAndColumn(_s)
--
--
-- buffers = list_buffers_object()
-- for i = 1,#buffers do
-- buff = buffers[i]
@@ -305,7 +305,7 @@ end
-- return {kind = "text", file_path = buff, line = line, col = col}
-- end
-- end
--
--
-- return nil
-- end
@@ -394,8 +394,9 @@ void GenerateConfig() {
colors.add({"TitleBarSelection", "GruvboxLight3"});
Array<Var> style = {};
style.add({"DrawLineNumbers", "0"});
style.add({"DrawScrollbar", "0"});
style.add({"DrawLineNumbers", "1"});
style.add({"DrawScrollbar", "1"});
style.add({"IndentSize", "2"});
{
MA_Scratch scratch;

View File

@@ -67,11 +67,12 @@ void Command_IndentSelectedLines(View *view, bool shift = false) {
Range pos_range_of_line = GetLineRange(*buffer, i);
if (!shift) {
AddEdit(&edits, {pos_range_of_line.min, pos_range_of_line.min}, L" ");
String16 whitespace_string = {L" ", StyleIndentSize};
AddEdit(&edits, {pos_range_of_line.min, pos_range_of_line.min}, whitespace_string);
} else {
String16 string = GetString(*buffer, pos_range_of_line);
Int whitespace_len = 0;
for (Int i = 0; i < 4 && i < string.len && string.data[i] == ' '; i += 1) {
for (Int i = 0; i < StyleIndentSize && i < string.len && string.data[i] == ' '; i += 1) {
whitespace_len += 1;
}

View File

@@ -54,8 +54,9 @@ Color.TitleBarText = GruvboxDark2
Color.TitleBarBackground = GruvboxLight1
Color.TitleBarSelection = GruvboxLight3
Style = {}
Style.DrawLineNumbers = 0
Style.DrawScrollbar = 0
Style.DrawLineNumbers = 1
Style.DrawScrollbar = 1
Style.IndentSize = 2
-- @todo: should we rewrite linux paths to windows on windows and vice-versa?
@@ -164,7 +165,7 @@ end
-- function RuleFindExistingBuffer(_s)
-- line, col, _s = ExtractLineAndColumn(_s)
--
--
-- buffers = list_buffers_object()
-- for i = 1,#buffers do
-- buff = buffers[i]
@@ -172,7 +173,7 @@ end
-- return {kind = "text", file_path = buff, line = line, col = col}
-- end
-- end
--
--
-- return nil
-- end
@@ -213,4 +214,5 @@ void ReloadStyle() {
ColorTitleBarSelection = GetColor("TitleBarSelection", ColorTitleBarSelection);
StyleDrawLineNumbers = GetStyle("DrawLineNumbers", StyleDrawLineNumbers);
StyleDrawScrollbar = GetStyle("DrawScrollbar", StyleDrawScrollbar);
StyleIndentSize = GetStyle("IndentSize", StyleIndentSize);
}

View File

@@ -51,5 +51,6 @@ Color ColorScrollbarScrollerSelected = GruvboxLight0Hard;
Color ColorTitleBarText = GruvboxDark2;
Color ColorTitleBarBackground = GruvboxLight1;
Color ColorTitleBarSelection = GruvboxLight3;
Int StyleDrawLineNumbers = 0;
Int StyleDrawScrollbar = 0;
Int StyleDrawLineNumbers = 1;
Int StyleDrawScrollbar = 1;
Int StyleIndentSize = 2;

View File

@@ -3,31 +3,39 @@
- scrolling when clicking on scroller is busted
- page up and down should also scroll and leave you in exactly same scroll
- something about mouse stuff is busted and it randomly does big selections and stuff like that
- I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection)
- don't trim lines with cursor or selection on it
- search backwards
- underline the word which can be loaded / executed
- load selected string or auto enclosed word when midclick?, ctrl + click, ctrl + e?
- 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
- I think the way sublime text and we display line highlights is confusing with multiple cursors (line highlight can be confused with selection)
- Ctrl + G should select the line number in bar
- auto register commands, but we need to figure out how to properly structure lua stuff
- command window should close on esacpe but make it more coherent
- make the editor replayable, store events and then replay, be careful about globals
- plumbing: look for raw buffer name then for filename with path
- try using buffer path for opening files
- maybe also add cursor selection to buffer name area
- 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
- Search all buffers in 10X style, incrementally searched results popping up on every key press (maybe we need coroutine library in C so this is easier?)
- Implement shell interaction (here we also could use the coroutine library)
- word complete
- Colored strings
- Set scroll centered
- font cache and on demand unicode loads
- Search and replace
- Search result buffer
- yeet sheet
- commands:
- trim whitespace
- Ctrl + G should select the line number in bar
- How to make search into bar?
- command window should close on esacpe but make it more coherent
- auto register commands
- simulation:
- make the editor replayable, store events and then replay
- be careful about globals
- Windows
- layout using a tree!!
- search as part of title window?
- I don't think we need WindowIDs
- layouting, resize windows
- maybe we can use first line number to use the window?
- try to incorporate the acme square which allows you to put windows wherever and also scale the border
- window borders as flag
- Modify error popups to not focus, introduce a interaction timer which after some time will make window invisible
- Implement shell interaction in a console buffer
- files
- load directory
@@ -35,26 +43,3 @@
- commands should run in a directory specified by buffer so you don't have to specify whole path
- each buffer would need a directory even the special ones: C:\a\b\c\+errors
- this could be used for storing the path in the command window
- plumbing
- add rule which first tries to look for open buffers and then if that fails we go look for files
- move all logic to config files
- execution
- experiment with using multiple cursors to select command and it's input
- mouse
- open selected string or auto enclosed word when right clicking or middle (this needs to be also handled on keyboard level)
- word completion
- Colored strings
- Set scroll centered
- font cache and on demand unicode loads
- Search all buffers
- Search and replace
- Search result buffer
- yeet sheet