Improved git pathing
This commit is contained in:
184
build_file.cpp
184
build_file.cpp
@@ -225,68 +225,54 @@ function SkipLineAndColumn(s)
|
|||||||
return line, col, s
|
return line, col, s
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChopLineAndColumn(s)
|
local function SkipSlashes(s)
|
||||||
local line = 1
|
found_slash = false
|
||||||
local col = 1
|
while s:sub(1,1) == '/' or s:sub(1,1) == '\\' do
|
||||||
|
s = s:sub(2)
|
||||||
|
found_slash = true
|
||||||
|
end
|
||||||
|
return s, found_slash
|
||||||
|
end
|
||||||
|
|
||||||
-- filename:line:column
|
local function SkipDrive(s)
|
||||||
local lci, lcj = s:find(":%d+:%d+$")
|
local i, j = s:find("^%a:")
|
||||||
if lci then
|
if not i then return s, nil, true end
|
||||||
local line_and_col = s:sub(lci, lcj)
|
|
||||||
local i, j = line_and_col:find("%d+")
|
local drive = s:sub(i, j)
|
||||||
line = line_and_col:sub(i, j)
|
local new_s = s:sub(j + 1)
|
||||||
col = line_and_col:sub(j + 2, -1)
|
|
||||||
s = s:sub(1, lci - 1)
|
new_s, found_slash = SkipSlashes(new_s)
|
||||||
return line, col, s
|
if not found_slash then return s, drive, false end
|
||||||
else
|
|
||||||
local li, lj = s:find(":%d+$")
|
return new_s, drive, true
|
||||||
if li then
|
end
|
||||||
local line_string = s:sub(li, lj)
|
|
||||||
line = line_string:sub(2, -1)
|
local function SkipPathCell(s)
|
||||||
s = s:sub(1, li - 1)
|
local i, j = s:find("^[%w_%.-% +]+")
|
||||||
return line, col, s
|
if not i then return s, nil, false end
|
||||||
end
|
|
||||||
|
local word = s:sub(i, j)
|
||||||
|
local new_s = s:sub(j + 1)
|
||||||
|
local new_s, found_slash = SkipSlashes(new_s)
|
||||||
|
|
||||||
|
return new_s, word, found_slash
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SkipPath(s)
|
||||||
|
local input_s = s
|
||||||
|
local s, drive, ok = SkipDrive(s)
|
||||||
|
if not ok then return s end
|
||||||
|
|
||||||
|
local cells = {}
|
||||||
|
while true do
|
||||||
|
s, word, slash_eaten = SkipPathCell(s)
|
||||||
|
if word then cells[#cells + 1] = word end
|
||||||
|
if not slash_eaten then break end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- filename(line,col):
|
local skip_size = input_s:len() - s:len()
|
||||||
local lci, lcj = s:find("%(%d+,%d+%):$")
|
local path = input_s:sub(1, skip_size)
|
||||||
if lci then
|
return s, path, drive, cells
|
||||||
local line_and_col = s:sub(lci, lcj)
|
|
||||||
local i, j = line_and_col:find("%d+")
|
|
||||||
line = line_and_col:sub(i, j)
|
|
||||||
col = line_and_col:sub(j + 2, -3)
|
|
||||||
s = s:sub(1, lci - 1)
|
|
||||||
return line, col, s
|
|
||||||
else
|
|
||||||
local li, lj = s:find("%(%d+%):$")
|
|
||||||
if li then
|
|
||||||
local line_string = s:sub(li, lj)
|
|
||||||
line = line_string:sub(2, -3)
|
|
||||||
s = s:sub(1, li - 1)
|
|
||||||
return line, col, s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- filename(line,col)
|
|
||||||
local lci, lcj = s:find("%(%d+,%d+%)$")
|
|
||||||
if lci then
|
|
||||||
local line_and_col = s:sub(lci, lcj)
|
|
||||||
local i, j = line_and_col:find("%d+")
|
|
||||||
line = line_and_col:sub(i, j)
|
|
||||||
col = line_and_col:sub(j + 2, -2)
|
|
||||||
s = s:sub(1, lci - 1)
|
|
||||||
return line, col, s
|
|
||||||
else
|
|
||||||
local li, lj = s:find("%(%d+%)$")
|
|
||||||
if li then
|
|
||||||
local line_string = s:sub(li, lj)
|
|
||||||
line = line_string:sub(2, -2)
|
|
||||||
s = s:sub(1, li - 1)
|
|
||||||
return line, col, s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return 1, 1, s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BufferNameExists(name)
|
function BufferNameExists(name)
|
||||||
@@ -300,76 +286,16 @@ function BufferNameExists(name)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChopColon(s)
|
function MatchWindowsPath(_s)
|
||||||
if s:sub(-1) == ':' then
|
local s, file_path, drive = SkipPath(_s)
|
||||||
s = s:sub(1, -2)
|
if not drive then
|
||||||
|
local d = GetCurrentBufferDir()
|
||||||
|
file_path = d..'/'..file_path
|
||||||
end
|
end
|
||||||
return s
|
local line, col, s = SkipLineAndColumn(s)
|
||||||
end
|
|
||||||
|
|
||||||
function GenericTextFileRule(_s)
|
print("OPEN :: INPUT = ".._s.." KIND = ".."text".." ".."FILE_PATH = "..file_path.."["..line..","..col.."]")
|
||||||
function match_path(s)
|
return {kind = "text", file_path = file_path, line = line, col = col}
|
||||||
-- ./something
|
|
||||||
-- add working directory
|
|
||||||
local working_dir_i, working_dir_j = string.find(s, "^%./.+")
|
|
||||||
if working_dir_j then
|
|
||||||
result = s:sub(3)
|
|
||||||
result = GetCurrentBufferDir().."/"..result
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
-- C:/something
|
|
||||||
local abs_i, abs_j = string.find(s, "^%a:/.+")
|
|
||||||
if abs_i then
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
-- C:\something
|
|
||||||
local abs_i, abs_j = s:find("^%a:\\.+")
|
|
||||||
if abs_i then
|
|
||||||
s = s:gsub("\\", "/")
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
-- /mnt/something
|
|
||||||
local abs_i, abs_j = s:find("^/.*")
|
|
||||||
if abs_i then
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
if BufferNameExists(s) then
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
-- other_random_filename
|
|
||||||
buffer_dir = GetCurrentBufferDir()
|
|
||||||
if buffer_dir:len() == 0 then
|
|
||||||
return s
|
|
||||||
else
|
|
||||||
return buffer_dir..'/'..s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
_s = ChopColon(_s)
|
|
||||||
line, col, _s = ChopLineAndColumn(_s)
|
|
||||||
file_path = match_path(_s)
|
|
||||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
|
||||||
end
|
|
||||||
|
|
||||||
function MatchAgainstIncludes(s)
|
|
||||||
line, col, s = ChopLineAndColumn(s)
|
|
||||||
include_paths = {
|
|
||||||
"C:/Work/text_editor/src",
|
|
||||||
"C:/Work/text_editor/src/text_editor",
|
|
||||||
}
|
|
||||||
for i = 1,#include_paths do
|
|
||||||
file_path = include_paths[i] .. '/' .. s
|
|
||||||
if FileExists(file_path) then
|
|
||||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function MatchGitCommit(s)
|
function MatchGitCommit(s)
|
||||||
@@ -383,8 +309,7 @@ function MatchGitCommit(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Rules = {
|
Rules = {
|
||||||
GenericTextFileRule,
|
MatchWindowsPath,
|
||||||
MatchAgainstIncludes,
|
|
||||||
MatchGitCommit,
|
MatchGitCommit,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,6 +324,7 @@ function ApplyRules(s)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
)==";
|
)==";
|
||||||
|
|
||||||
void GenerateConfig() {
|
void GenerateConfig() {
|
||||||
|
|||||||
@@ -114,68 +114,54 @@ function SkipLineAndColumn(s)
|
|||||||
return line, col, s
|
return line, col, s
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChopLineAndColumn(s)
|
local function SkipSlashes(s)
|
||||||
local line = 1
|
found_slash = false
|
||||||
local col = 1
|
while s:sub(1,1) == '/' or s:sub(1,1) == '\\' do
|
||||||
|
s = s:sub(2)
|
||||||
|
found_slash = true
|
||||||
|
end
|
||||||
|
return s, found_slash
|
||||||
|
end
|
||||||
|
|
||||||
-- filename:line:column
|
local function SkipDrive(s)
|
||||||
local lci, lcj = s:find(":%d+:%d+$")
|
local i, j = s:find("^%a:")
|
||||||
if lci then
|
if not i then return s, nil, true end
|
||||||
local line_and_col = s:sub(lci, lcj)
|
|
||||||
local i, j = line_and_col:find("%d+")
|
local drive = s:sub(i, j)
|
||||||
line = line_and_col:sub(i, j)
|
local new_s = s:sub(j + 1)
|
||||||
col = line_and_col:sub(j + 2, -1)
|
|
||||||
s = s:sub(1, lci - 1)
|
new_s, found_slash = SkipSlashes(new_s)
|
||||||
return line, col, s
|
if not found_slash then return s, drive, false end
|
||||||
else
|
|
||||||
local li, lj = s:find(":%d+$")
|
return new_s, drive, true
|
||||||
if li then
|
end
|
||||||
local line_string = s:sub(li, lj)
|
|
||||||
line = line_string:sub(2, -1)
|
local function SkipPathCell(s)
|
||||||
s = s:sub(1, li - 1)
|
local i, j = s:find("^[%w_%.-% +]+")
|
||||||
return line, col, s
|
if not i then return s, nil, false end
|
||||||
end
|
|
||||||
|
local word = s:sub(i, j)
|
||||||
|
local new_s = s:sub(j + 1)
|
||||||
|
local new_s, found_slash = SkipSlashes(new_s)
|
||||||
|
|
||||||
|
return new_s, word, found_slash
|
||||||
|
end
|
||||||
|
|
||||||
|
local function SkipPath(s)
|
||||||
|
local input_s = s
|
||||||
|
local s, drive, ok = SkipDrive(s)
|
||||||
|
if not ok then return s end
|
||||||
|
|
||||||
|
local cells = {}
|
||||||
|
while true do
|
||||||
|
s, word, slash_eaten = SkipPathCell(s)
|
||||||
|
if word then cells[#cells + 1] = word end
|
||||||
|
if not slash_eaten then break end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- filename(line,col):
|
local skip_size = input_s:len() - s:len()
|
||||||
local lci, lcj = s:find("%(%d+,%d+%):$")
|
local path = input_s:sub(1, skip_size)
|
||||||
if lci then
|
return s, path, drive, cells
|
||||||
local line_and_col = s:sub(lci, lcj)
|
|
||||||
local i, j = line_and_col:find("%d+")
|
|
||||||
line = line_and_col:sub(i, j)
|
|
||||||
col = line_and_col:sub(j + 2, -3)
|
|
||||||
s = s:sub(1, lci - 1)
|
|
||||||
return line, col, s
|
|
||||||
else
|
|
||||||
local li, lj = s:find("%(%d+%):$")
|
|
||||||
if li then
|
|
||||||
local line_string = s:sub(li, lj)
|
|
||||||
line = line_string:sub(2, -3)
|
|
||||||
s = s:sub(1, li - 1)
|
|
||||||
return line, col, s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- filename(line,col)
|
|
||||||
local lci, lcj = s:find("%(%d+,%d+%)$")
|
|
||||||
if lci then
|
|
||||||
local line_and_col = s:sub(lci, lcj)
|
|
||||||
local i, j = line_and_col:find("%d+")
|
|
||||||
line = line_and_col:sub(i, j)
|
|
||||||
col = line_and_col:sub(j + 2, -2)
|
|
||||||
s = s:sub(1, lci - 1)
|
|
||||||
return line, col, s
|
|
||||||
else
|
|
||||||
local li, lj = s:find("%(%d+%)$")
|
|
||||||
if li then
|
|
||||||
local line_string = s:sub(li, lj)
|
|
||||||
line = line_string:sub(2, -2)
|
|
||||||
s = s:sub(1, li - 1)
|
|
||||||
return line, col, s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return 1, 1, s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function BufferNameExists(name)
|
function BufferNameExists(name)
|
||||||
@@ -189,76 +175,16 @@ function BufferNameExists(name)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChopColon(s)
|
function MatchWindowsPath(_s)
|
||||||
if s:sub(-1) == ':' then
|
local s, file_path, drive = SkipPath(_s)
|
||||||
s = s:sub(1, -2)
|
if not drive then
|
||||||
|
local d = GetCurrentBufferDir()
|
||||||
|
file_path = d..'/'..file_path
|
||||||
end
|
end
|
||||||
return s
|
local line, col, s = SkipLineAndColumn(s)
|
||||||
end
|
|
||||||
|
|
||||||
function GenericTextFileRule(_s)
|
print("OPEN :: INPUT = ".._s.." KIND = ".."text".." ".."FILE_PATH = "..file_path.."["..line..","..col.."]")
|
||||||
function match_path(s)
|
return {kind = "text", file_path = file_path, line = line, col = col}
|
||||||
-- ./something
|
|
||||||
-- add working directory
|
|
||||||
local working_dir_i, working_dir_j = string.find(s, "^%./.+")
|
|
||||||
if working_dir_j then
|
|
||||||
result = s:sub(3)
|
|
||||||
result = GetCurrentBufferDir().."/"..result
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
-- C:/something
|
|
||||||
local abs_i, abs_j = string.find(s, "^%a:/.+")
|
|
||||||
if abs_i then
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
-- C:\something
|
|
||||||
local abs_i, abs_j = s:find("^%a:\\.+")
|
|
||||||
if abs_i then
|
|
||||||
s = s:gsub("\\", "/")
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
-- /mnt/something
|
|
||||||
local abs_i, abs_j = s:find("^/.*")
|
|
||||||
if abs_i then
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
if BufferNameExists(s) then
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
|
|
||||||
-- other_random_filename
|
|
||||||
buffer_dir = GetCurrentBufferDir()
|
|
||||||
if buffer_dir:len() == 0 then
|
|
||||||
return s
|
|
||||||
else
|
|
||||||
return buffer_dir..'/'..s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
_s = ChopColon(_s)
|
|
||||||
line, col, _s = ChopLineAndColumn(_s)
|
|
||||||
file_path = match_path(_s)
|
|
||||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
|
||||||
end
|
|
||||||
|
|
||||||
function MatchAgainstIncludes(s)
|
|
||||||
line, col, s = ChopLineAndColumn(s)
|
|
||||||
include_paths = {
|
|
||||||
"C:/Work/text_editor/src",
|
|
||||||
"C:/Work/text_editor/src/text_editor",
|
|
||||||
}
|
|
||||||
for i = 1,#include_paths do
|
|
||||||
file_path = include_paths[i] .. '/' .. s
|
|
||||||
if FileExists(file_path) then
|
|
||||||
return {kind = "text", file_path = file_path, line = line, col = col}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function MatchGitCommit(s)
|
function MatchGitCommit(s)
|
||||||
@@ -272,8 +198,7 @@ function MatchGitCommit(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Rules = {
|
Rules = {
|
||||||
GenericTextFileRule,
|
MatchWindowsPath,
|
||||||
MatchAgainstIncludes,
|
|
||||||
MatchGitCommit,
|
MatchGitCommit,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,6 +214,7 @@ function ApplyRules(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
)==";
|
)==";
|
||||||
void ReloadStyle() {
|
void ReloadStyle() {
|
||||||
ColorText = GetColor("Text", ColorText);
|
ColorText = GetColor("Text", ColorText);
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ int LuaListBuffers(lua_State *L) {
|
|||||||
Scratch scratch;
|
Scratch scratch;
|
||||||
Array<String> strings = {scratch};
|
Array<String> strings = {scratch};
|
||||||
For(Buffers) {
|
For(Buffers) {
|
||||||
if (StartsWith(it.name, "*infobar")) continue;
|
if (StartsWith(it.name, "+Titlebar")) continue;
|
||||||
String string = Format(scratch, "%.*s", FmtString(it.name));
|
String string = Format(scratch, "%.*s", FmtString(it.name));
|
||||||
Add(&strings, string);
|
Add(&strings, string);
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@ int LuaGetBufferList(lua_State *L) {
|
|||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
For(Buffers) {
|
For(Buffers) {
|
||||||
if (StartsWith(it.name, "*infobar")) continue;
|
if (StartsWith(it.name, "+Titlebar")) continue;
|
||||||
lua_pushinteger(L, i++);
|
lua_pushinteger(L, i++);
|
||||||
lua_pushlstring(L, it.name.data, it.name.len);
|
lua_pushlstring(L, it.name.data, it.name.len);
|
||||||
lua_settable(L, -3); /* 3rd element from the stack top */
|
lua_settable(L, -3); /* 3rd element from the stack top */
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ WindowID NullWindowID;
|
|||||||
BufferID NullBufferID;
|
BufferID NullBufferID;
|
||||||
ViewID NullViewID;
|
ViewID NullViewID;
|
||||||
WindowID CommandWindowID;
|
WindowID CommandWindowID;
|
||||||
WindowID InfoBarWindowID;
|
|
||||||
WindowID SearchWindowID;
|
WindowID SearchWindowID;
|
||||||
WindowID PopupWindowID;
|
WindowID PopupWindowID;
|
||||||
WindowID DebugWindowID;
|
WindowID DebugWindowID;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ backwards slash C:\
|
|||||||
go back ../notes
|
go back ../notes
|
||||||
current dir ./notes
|
current dir ./notes
|
||||||
file without slash notes
|
file without slash notes
|
||||||
allows spaces C:\thing and
|
allows spaces C:\Program Files/
|
||||||
multiple slashes C:\\\\\\\\\\\\\\\\\\\\\\\\\thing
|
multiple slashes C:\\\\\\\\\\\\\\\\\\\\\\\\\thing
|
||||||
you can combine the slashes C:\/Work
|
you can combine the slashes C:\/Work
|
||||||
disallowed characters for names * \ / ? > < | : "
|
disallowed characters for names * \ / ? > < | : "
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
- jump history forward
|
|
||||||
- Remove pointers and use ViewIDs (enable array debug while doing this)
|
- Remove pointers and use ViewIDs (enable array debug while doing this)
|
||||||
- try using git grep for search for now, combine with fuzzy search buffer
|
- try using git grep for search for now, combine with fuzzy search buffer
|
||||||
- lua maybe try heuristic matching paths from left?
|
- lua maybe try heuristic matching paths from left?
|
||||||
@@ -8,6 +7,10 @@
|
|||||||
- some split selection commands
|
- some split selection commands
|
||||||
- assign commands or lua functions to F1-F8 keys
|
- assign commands or lua functions to F1-F8 keys
|
||||||
|
|
||||||
|
- Cycle up and down through a list of filenames and jump to every filename listed
|
||||||
|
- A lister which is going to show project without the full path and sorted by recency
|
||||||
|
- Fix fuzzy search look
|
||||||
|
|
||||||
- word complete
|
- word complete
|
||||||
- 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?)
|
- 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?)
|
||||||
- Search and replace
|
- Search and replace
|
||||||
@@ -31,7 +34,6 @@
|
|||||||
- combine glyph and selection rendering
|
- combine glyph and selection rendering
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
- better teminology then 'active' 'last active' 'current'
|
- better teminology then 'active' 'last active' 'current'
|
||||||
- switch to previous view (ctrl + tab)
|
- switch to previous view (ctrl + tab)
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ Window *CreateTitlebar(WindowID parent_window_id) {
|
|||||||
window->deactivate_on_escape = true;
|
window->deactivate_on_escape = true;
|
||||||
window->is_title_bar = true;
|
window->is_title_bar = true;
|
||||||
|
|
||||||
static int InfobarCount;
|
static int TitlebarCount;
|
||||||
Allocator sys_allocator = GetSystemAllocator();
|
Allocator sys_allocator = GetSystemAllocator();
|
||||||
String name = Format(sys_allocator, "*infobar%d", ++InfobarCount);
|
String name = Format(sys_allocator, "+Titlebar%d", ++TitlebarCount);
|
||||||
|
|
||||||
Buffer *b = CreateBuffer(sys_allocator, name);
|
Buffer *b = CreateBuffer(sys_allocator, name);
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
@@ -73,7 +73,7 @@ Int GetTitleBarSize(Window *window) {
|
|||||||
void AddColumnWindow() {
|
void AddColumnWindow() {
|
||||||
Window *window = CreateWindow();
|
Window *window = CreateWindow();
|
||||||
window->is_column = true;
|
window->is_column = true;
|
||||||
View *view = OpenBufferView("*scratch*");
|
View *view = OpenBufferView("+Scratch");
|
||||||
window->active_view = view->id;
|
window->active_view = view->id;
|
||||||
CreateTitlebar(window->id);
|
CreateTitlebar(window->id);
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,7 @@ void AddRowWindow() {
|
|||||||
Window *window = CreateWindow();
|
Window *window = CreateWindow();
|
||||||
WindowID window_id = window->id;
|
WindowID window_id = window->id;
|
||||||
|
|
||||||
View *view = OpenBufferView("*scratch*");
|
View *view = OpenBufferView("+Scratch");
|
||||||
window->active_view = view->id;
|
window->active_view = view->id;
|
||||||
CreateTitlebar(window->id);
|
CreateTitlebar(window->id);
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ String BuffCWD(String string) {
|
|||||||
|
|
||||||
void InitScratchBuffer() {
|
void InitScratchBuffer() {
|
||||||
Allocator sys_allocator = GetSystemAllocator();
|
Allocator sys_allocator = GetSystemAllocator();
|
||||||
Buffer *null_buffer = CreateBuffer(sys_allocator, BuffCWD("*scratch*"));
|
Buffer *null_buffer = CreateBuffer(sys_allocator, BuffCWD("+Scratch"));
|
||||||
View *null_view = CreateView(null_buffer->id);
|
View *null_view = CreateView(null_buffer->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ void InitWindows() {
|
|||||||
WindowID window_id = window->id;
|
WindowID window_id = window->id;
|
||||||
window->is_column = true;
|
window->is_column = true;
|
||||||
// window->draw_line_numbers = false;
|
// window->draw_line_numbers = false;
|
||||||
Buffer *buffer = CreateBuffer(sys_allocator, BuffCWD("*load_text_a*"));
|
Buffer *buffer = CreateBuffer(sys_allocator, BuffCWD("+TestBuffer"));
|
||||||
View *view = CreateView(buffer->id);
|
View *view = CreateView(buffer->id);
|
||||||
// LoadTextA(buffer);
|
// LoadTextA(buffer);
|
||||||
LoadUnicode(buffer);
|
LoadUnicode(buffer);
|
||||||
@@ -157,7 +157,7 @@ void InitWindows() {
|
|||||||
window->absolute_position = true;
|
window->absolute_position = true;
|
||||||
window->dont_save_in_active_window_history = true;
|
window->dont_save_in_active_window_history = true;
|
||||||
|
|
||||||
Buffer *buffer = CreateBuffer(sys_allocator, BuffCWD("*console*"));
|
Buffer *buffer = CreateBuffer(sys_allocator, BuffCWD("+Console"));
|
||||||
// buffer->no_history = true;
|
// buffer->no_history = true;
|
||||||
|
|
||||||
View *view = CreateView(buffer->id);
|
View *view = CreateView(buffer->id);
|
||||||
@@ -180,7 +180,7 @@ void InitWindows() {
|
|||||||
window->visible = false;
|
window->visible = false;
|
||||||
window->z = 2;
|
window->z = 2;
|
||||||
|
|
||||||
Buffer *buffer = CreateBuffer(sys_allocator, BuffCWD("*debug*"));
|
Buffer *buffer = CreateBuffer(sys_allocator, BuffCWD("+Debug"));
|
||||||
DebugBufferID = buffer->id;
|
DebugBufferID = buffer->id;
|
||||||
buffer->no_history = true;
|
buffer->no_history = true;
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ void InitWindows() {
|
|||||||
w->absolute_position = true;
|
w->absolute_position = true;
|
||||||
w->dont_save_in_active_window_history = true;
|
w->dont_save_in_active_window_history = true;
|
||||||
w->deactivate_on_escape = true;
|
w->deactivate_on_escape = true;
|
||||||
Buffer *b = CreateBuffer(sys_allocator, BuffCWD("*commands*"));
|
Buffer *b = CreateBuffer(sys_allocator, BuffCWD("+Commands"));
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
v->fuzzy_search = true;
|
v->fuzzy_search = true;
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@ void InitWindows() {
|
|||||||
w->dont_save_in_active_window_history = true;
|
w->dont_save_in_active_window_history = true;
|
||||||
w->invisible_when_inactive = true;
|
w->invisible_when_inactive = true;
|
||||||
w->deactivate_on_escape = true;
|
w->deactivate_on_escape = true;
|
||||||
Buffer *b = CreateBuffer(sys_allocator, BuffCWD("*search*"));
|
Buffer *b = CreateBuffer(sys_allocator, BuffCWD("+Search"));
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
w->active_view = v->id;
|
w->active_view = v->id;
|
||||||
|
|
||||||
@@ -250,13 +250,13 @@ void InitWindows() {
|
|||||||
w->absolute_position = true;
|
w->absolute_position = true;
|
||||||
w->deactivate_on_escape = true;
|
w->deactivate_on_escape = true;
|
||||||
w->z = 2;
|
w->z = 2;
|
||||||
Buffer *b = CreateBuffer(sys_allocator, BuffCWD("*popup*"));
|
Buffer *b = CreateBuffer(sys_allocator, BuffCWD("+Popup"));
|
||||||
b->no_history = true;
|
b->no_history = true;
|
||||||
View *v = CreateView(b->id);
|
View *v = CreateView(b->id);
|
||||||
w->active_view = v->id;
|
w->active_view = v->id;
|
||||||
|
|
||||||
Window *infobar = CreateTitlebar(window_id);
|
Window *titlebar = CreateTitlebar(window_id);
|
||||||
infobar->z = 2;
|
titlebar->z = 2;
|
||||||
SetVisibility(window_id, false);
|
SetVisibility(window_id, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user