Fix outside of buffer access and add docs
This commit is contained in:
@@ -415,8 +415,7 @@ API Int OnCharClassBoundary_GetNextWordEnd(Buffer *buffer, Int pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
API Int OnCharClassBoundary_GetPrevWordStart(Buffer *buffer, Int pos) {
|
API Int OnCharClassBoundary_GetPrevWordStart(Buffer *buffer, Int pos) {
|
||||||
pos = Clamp(pos, (Int)0, buffer->len);
|
Int i = Clamp(pos - 1, (Int)0, buffer->len);
|
||||||
Int i = pos - 1;
|
|
||||||
|
|
||||||
if (i >= 0 && GetCharClass(buffer->str[i]) == CharClass_Whitespace) {
|
if (i >= 0 && GetCharClass(buffer->str[i]) == CharClass_Whitespace) {
|
||||||
i -= 1;
|
i -= 1;
|
||||||
|
|||||||
@@ -217,6 +217,41 @@ bool IsOpenBoundary(char c) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Variables that control the default shell for '!' commands
|
||||||
|
DefaultShellWindows - "cmd"
|
||||||
|
DefaultShellUnix - "bash | sh"
|
||||||
|
|
||||||
|
Variables:
|
||||||
|
@ProjectDirectory/build/te
|
||||||
|
@(ProjectDirectory)/build/te
|
||||||
|
|
||||||
|
Start of string matchers:
|
||||||
|
! Execute with default shell
|
||||||
|
!! Execute hidden with default shell
|
||||||
|
:Command Execute editor command
|
||||||
|
:Set Special case for config stuff
|
||||||
|
http://
|
||||||
|
https://
|
||||||
|
commit
|
||||||
|
py: @todo, execute in python shell, this will use the python3 shell and pass the rest to it's stdin or maybe as a file
|
||||||
|
|
||||||
|
More comprehensive syntax for commands:
|
||||||
|
!{/usr/bin/python,Hidden,Input:Clipboard,Output:Clipboard,WorkingDirectory:@ProjectDirectory,Env:{Thing:asd}}
|
||||||
|
|
||||||
|
Otherwise it does filepath parsing:
|
||||||
|
C:/windows/path
|
||||||
|
/unix/path
|
||||||
|
./it/also/does/linenums:32:3
|
||||||
|
/as/well/as/this/format(111,1)
|
||||||
|
./thing(10)
|
||||||
|
|
||||||
|
|
||||||
|
TODO: need to add '~', but where?
|
||||||
|
TODO: on linux find shell on first command and set as default
|
||||||
|
|
||||||
|
*/
|
||||||
ResolvedOpen ResolveOpen(Allocator alo, Window *window, String path, ResolveOpenMeta meta) {
|
ResolvedOpen ResolveOpen(Allocator alo, Window *window, String path, ResolveOpenMeta meta) {
|
||||||
ResolvedOpen result = {};
|
ResolvedOpen result = {};
|
||||||
path = Trim(path);
|
path = Trim(path);
|
||||||
|
|||||||
Reference in New Issue
Block a user