Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d482cea
Remove debug bug
makuke1234 Jun 22, 2023
d852b0a
Start adding language support
makuke1234 May 2, 2024
2e13b51
make array unicode
makuke1234 May 2, 2024
f76e9ec
Adhere to consistent naming convention
makuke1234 May 2, 2024
eb406ef
Begin JSON parsing
makuke1234 May 2, 2024
86cd24e
Add primitive language support
makuke1234 May 3, 2024
c7c5319
Update copyright string
makuke1234 May 3, 2024
1733c83
Some basic language tokens with Estonian support
makuke1234 May 3, 2024
4b40066
New language tokens #2
makuke1234 May 4, 2024
55ae7cc
Language tokens #3
makuke1234 May 4, 2024
18ee4ae
New settings
makuke1234 May 4, 2024
a97a502
add a couple of C++ keywords
makuke1234 Dec 1, 2024
adb62a8
Merge branch '49-feature-shift+homeend-selection' of https://github.c…
makuke1234 Dec 1, 2024
6ab5bb4
fix tests
makuke1234 Nov 19, 2025
1f60dd0
fix
makuke1234 Nov 19, 2025
ddb9fd3
fix scrolling crash and improve page up/down
makuke1234 Nov 25, 2025
76eace2
Fix more bugs
makuke1234 Nov 25, 2025
62fb51c
Make mouse scrolling nicer
makuke1234 Nov 25, 2025
2cbeafe
Merge branch 'mouse-bug' of https://github.com/makuke1234/femto into dev
makuke1234 Nov 25, 2025
404bb67
trash commit
makuke1234 Nov 25, 2025
f62fc74
fix horizontal scrolling to left
makuke1234 Nov 26, 2025
0374e36
Implement Shift+Home/End/PgUp/PgDn selection
makuke1234 Nov 28, 2025
0c6a4f4
Implement Ctrl+Left/Right arrow word hopping
makuke1234 Dec 3, 2025
5bce99c
Merge pull request #55 from makuke1234/49-feature-shift+homeend-selec…
makuke1234 Dec 3, 2025
c61c532
Fix C++ token hashmap size
makuke1234 Dec 3, 2025
753296d
Make Ctrl-hopping start from index 0
makuke1234 Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ Have a look at the provided [settings file](./settings.json) to get a better und
* [x] Shows current line & column when typing/moving cursor around
* [x] Shows current tab number and number of tabs on the title bar
* [x] Correct relative line number rendering
* [ ] Support translations through settings.json
* [ ] Advanced theming support, load themes from separate files
* [ ] Advanced undo/redo, choose which way to redo

Expand Down
1 change: 1 addition & 0 deletions dok.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Uus dokument## Teise astme pealkiri### Kolmanda astme pealkiri- [x] asdasdasd* asdasdasd asd_asdasd_ __asdas__ **asd** ___asdasd___ ~~asdasd~~ `asdasdasdasd` [asdasd](aasdasd)> quote
Expand Down
Empty file added dok2.md
Empty file.
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CC=gcc
WARN=-Wall -Wextra -Wpedantic -Wconversion -Wunused-variable -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wdouble-promotion -Waggregate-return -Wunused-function -Wunused-result
CDEFFLAGS=-std=c99 $(WARN) -municode -D UNICODE -D _UNICODE -D LOGGING_ENABLE=1
CFLAGS=-O3 -Wl,--strip-all,--build-id=none,--gc-sections -fno-ident -D NDEBUG
CFLAGSD=-g -Og
CFLAGSD=-g -Og -D _DEBUG
LIB=-static -ljsonlite2


Expand Down Expand Up @@ -56,7 +56,7 @@ objs_d += $(RSC_OBJ_D)
objs_r += $(jsonlite2_obj)
objs_r += $(RSC_OBJ_R)

objs_test = $(subst $(OBJD)/main.c.o,,$(objs_d))
objs_test = $(subst $(OBJD)/fMain.c.o,,$(objs_d))

$(jsonlite2_lib): $(JSONLITE2_SRC)
$(MAKE) -C $(JSONLITE2_SRC)
Expand Down
82 changes: 82 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,87 @@
"XMLid": "",
"CSSselector": "",
"CSSproperty": ""
},

"language": "estonian",
"languages":
{
"estonian":
{
"general": "\nYldine (general):\n\n --h Kuvab seda lehte\n",
"indent": "\nTaane (indentation):\n\n --tabsToSpaces=[v22rtus] true/false, 1/0\n",
"aesthetics": "\nEsteetika (aesthetics):\n\n --whitespaceVisible=[v22rtus] true/false, 1/0\n",
"misc": "\nMuu (miscellaneous):\n\n --log=[v22rtus] M22rab logimisreziimi kasutuse\n",
"clue": "K6ikide saadaval olevate k2skluste kuvamiseks kirjuta",
"keyword": "Abi m2rks6na",
"categories": "Kategooriate kaupa",
"usage": "Kasutamine:",

"file": "Fail",
"untitled": "nimetu",
"unsaved-files": "Salvestamata fail(id)",
"is-unsaved": "on salvestamata",
"press": "Vajutage",
"confirm-close": "sulgemise kinnitamiseks",
"confirm-exit": "väljumise kinnitamiseks",
"confirm-reload": "Tuvastati salvestamata töö. Vajutage Ctrl+Shift+R uuesti laadimise kinnitamiseks",
"closed-tab": "Suleti vahekaart",
"opt-file": "[valikud] [fail]",
"nothing-new": "Pole midagi uut salvestada",
"open-error": "Faili avamise viga!",
"write-error": "Faili kirjutamise viga!",
"mem-error": "Mälu allokeerimise viga!",
"wrote": "Kirjutati",
"bytes": "baiti",
"bytes-to": "baiti faili",
"unknown-comb": "Tundmatu klahvikombinatsioon!",
"caps-on": "'SUUR.LUKK' sees",
"caps-off": "'SUUR.LUKK' väljas",
"load": "Fail edukalt laetud!",
"reload": "Fail edukalt taaslaetud!",
"eol": "realõpu järgnevused",
"eol-wait": "Ootan realõpu kombinatsiooni (F = CRLF, L = LF, C = CR)",
"cut-error": "Lõikamise viga!",
"cut": "Lõika",
"cut-nothing": "Pole midagi lõigata",
"copy-error": "Kopeerimise viga!",
"copy": "Kopeeri",
"copy-nothing": "Pole midagi kopeerida",
"paste": "Kleebi",
"paste-error": "Kleepimise viga!",
"prev-tab": "Eelmine vahekaart",
"next-tab": "Järgmine vahekaart",
"tab": "TAANE",
"new-tab": "uus vahekaart",
"syntax": "Süntaks",
"settings": "Sätetefail",
"open-fail": "Viga, kui prooviti avada",
"opened": "Avati",
"successfully": "edukalt",
"found": "Leitud",
"saveas": "Salvesta kui",
"save-cancel": "Kasutaja loobus faili salvestamisest",
"search-noterm": "Otsingusõne pole sisestatud",
"search-nolines": "Pole ridu mida otsida",
"search-end": "Otsitulemused otsas",
"search-forward": "Otsi edaspidi",
"search-backward": "Otsi tagurpidi",
"search-cancel": "Kasutaja loobus otsingust",
"eol-unknown": "Tundmatu realõpu kombinatsioon!",
"using": "Kasutab",
"open-cancel": "Kasutaja loobus faili avamisest",
"mouse-left": "V.KLIKK",
"mouse-right": "P.KLIKK",
"move": "LIIGU",
"open": "Ava",
"numlock-on": "'NUM.LUKK' sees",
"numlock-off": "'NUM.LUKK' väljas",
"scrlock-on": "'KER.LUKK' sees",
"scrlock-off": "'KER.LUKK' väljas",
"btn-home": "'ALGUS'",
"btn-end": "'LÕPP'",
"btn-pgup": "'LEHT.YLES'",
"btn-pgdn": "'LEHT.ALLA'",
}
}
}
3 changes: 2 additions & 1 deletion src/bulk/bulk.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
#include "../fSettings.c"
#include "../fStatHashmap.c"
#include "../fSyntax.c"
#include "../winarr.c"
#include "../fLang.c"
#include "../winarr.c"
44 changes: 19 additions & 25 deletions src/fArg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
bool fArg_strToBool(fArg_t arg)
{
assert(arg.begin != NULL);
assert(arg.end != NULL);
assert(arg.end != NULL);

if (((arg.end - arg.begin) >= 4) && (wcsnicmp(arg.begin, L"true", 4) == 0))
{
Expand All @@ -22,16 +22,14 @@ bool fArg_strToBool(fArg_t arg)
wchar fArg_strToCh(fArg_t arg)
{
assert(arg.begin != NULL);
assert(arg.end != NULL);
assert(arg.end != NULL);

return ((arg.end - arg.begin) >= 1) ? arg.begin[0] : L'\0';
}


usize fArg_fetch(
const wchar * restrict rawStr, isize maxStr,
const wchar * restrict argMatch, usize maxParams, ...
)
const wchar *restrict rawStr, isize maxStr,
const wchar *restrict argMatch, usize maxParams, ...)
{
assert(rawStr != NULL);
assert(argMatch != NULL);
Expand All @@ -45,9 +43,8 @@ usize fArg_fetch(
return result;
}
usize fArg_vfetch(
const wchar * restrict rawStr, isize maxStr,
const wchar * restrict argMatch, usize maxParams, va_list ap
)
const wchar *restrict rawStr, isize maxStr,
const wchar *restrict argMatch, usize maxParams, va_list ap)
{
assert(rawStr != NULL);
assert(argMatch != NULL);
Expand All @@ -61,16 +58,16 @@ usize fArg_vfetch(
* -option
* /option
* /-option <- also, this f'ed up combination works cause I'm lazy af
*
*
* Values:
* --option=value1,value2,value3
* --option=value1;value2;value3
* --option=value1?value2?value3
* --option=value1 value2 value3
*
*
*/
const wchar * restrict rawIt = rawStr;
const wchar * restrict endp = rawIt + len;
const wchar *restrict rawIt = rawStr;
const wchar *restrict endp = rawIt + len;
// scan for a '-', '--' or '/' or '/-'
if ((len > 1) && ((*rawIt == L'-') || (*rawIt == L'/')))
{
Expand Down Expand Up @@ -110,7 +107,7 @@ usize fArg_vfetch(
// Search for arguments
usize numArgs = 0;

const wchar * restrict argStart = rawIt;
const wchar *restrict argStart = rawIt;

for (; rawIt != endp; ++rawIt)
{
Expand All @@ -123,12 +120,12 @@ usize fArg_vfetch(
{
if (numArgs < maxParams)
{
fArg_t * arg = va_arg(ap, fArg_t *);
fArg_t *arg = va_arg(ap, fArg_t *);
++numArgs;

// Set argument settings
arg->begin = argStart;
arg->end = rawIt + ((rawIt + 1) == endp);
arg->end = rawIt + ((rawIt + 1) == endp);

// Set new argument start position
if ((rawIt + 1) != endp)
Expand All @@ -153,28 +150,25 @@ usize fArg_vfetch(
}
}


usize fArg_fetchArgv(
int argc, const wchar ** restrict argv,
const wchar * restrict argMatch, int * restrict matchedIndex, usize maxParams, ...
)
int argc, const wchar **restrict argv,
const wchar *restrict argMatch, int *restrict matchedIndex, usize maxParams, ...)
{
assert(argv != NULL);
assert(argMatch != NULL);
assert(matchedIndex != NULL);

va_list ap;
va_start(ap, maxParams);

const usize result = fArg_vfetchArgv(argc, argv, argMatch, matchedIndex, maxParams, ap);

va_end(ap);
return result;
}
usize fArg_vfetchArgv(
int argc, const wchar ** restrict argv,
const wchar * restrict argMatch, int * restrict matchedIndex, usize maxParams, va_list ap
)
int argc, const wchar **restrict argv,
const wchar *restrict argMatch, int *restrict matchedIndex, usize maxParams, va_list ap)
{
assert(argv != NULL);
assert(argMatch != NULL);
Expand Down
36 changes: 15 additions & 21 deletions src/fArg.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@

typedef struct fArg
{
const wchar * begin, * end;
const wchar *begin, *end;

} fArg_t;

/**
* @brief Convert string to boolean
*
*
* @param arg String wrapper
*/
bool fArg_strToBool(fArg_t arg);
/**
* @brief Convert string to UTF-16 character
*
*
* @param arg String wrapper
*/
wchar fArg_strToCh(fArg_t arg);


/**
* @brief Fetches individual parameters from raw command-line argument
*
*
* @param rawStr Raw argument string, e.g argv[1]
* @param maxStr Maximum amount of characters to scan, -1 implies the string is null-terminated
* @param argMatch Argument to match against
Expand All @@ -35,12 +34,11 @@ wchar fArg_strToCh(fArg_t arg);
* 0 if none were found or argMatch doesn't match
*/
usize fArg_fetch(
const wchar * restrict rawStr, isize maxStr,
const wchar * restrict argMatch, usize maxParams, ...
);
const wchar *restrict rawStr, isize maxStr,
const wchar *restrict argMatch, usize maxParams, ...);
/**
* @brief Fetches individual parameters from raw command-line argument, takes va_list
*
*
* @param rawStr Raw argument string, e.g argv[1]
* @param maxStr Maximum amount of characters to scan, -1 implies the string is null-terminated
* @param argMatch Argument to match against
Expand All @@ -50,14 +48,12 @@ usize fArg_fetch(
* 0 if none were found or argMatch doesn't match
*/
usize fArg_vfetch(
const wchar * restrict rawStr, isize maxStr,
const wchar * restrict argMatch, usize maxParams, va_list ap
);

const wchar *restrict rawStr, isize maxStr,
const wchar *restrict argMatch, usize maxParams, va_list ap);

/**
* @brief Fetches individual parameters from argc and argv normally given to wmain()
*
*
* @param argc Argument count
* @param argv Argument vector
* @param argMatch Argument to match against
Expand All @@ -69,12 +65,11 @@ usize fArg_vfetch(
* 0 if none were found or argMatch doesn't match
*/
usize fArg_fetchArgv(
int argc, const wchar ** restrict argv,
const wchar * restrict argMatch, int * restrict matchedIndex, usize maxParams, ...
);
int argc, const wchar **restrict argv,
const wchar *restrict argMatch, int *restrict matchedIndex, usize maxParams, ...);
/**
* @brief Fetches individual parameters from argc and argv normally given to wmain(), takes va_list
*
*
* @param argc Argument count
* @param argv Argument vector
* @param argMatch Argument to match against
Expand All @@ -86,8 +81,7 @@ usize fArg_fetchArgv(
* 0 if none were found or argMatch doesn't match
*/
usize fArg_vfetchArgv(
int argc, const wchar ** restrict argv,
const wchar * restrict argMatch, int * restrict mathedIndex, usize maxParams, va_list ap
);
int argc, const wchar **restrict argv,
const wchar *restrict argMatch, int *restrict mathedIndex, usize maxParams, va_list ap);

#endif
Loading