Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional file extension support #2

Open
4 tasks done
clach04 opened this issue Feb 11, 2024 · 3 comments
Open
4 tasks done

Additional file extension support #2

clach04 opened this issue Feb 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@clach04
Copy link
Owner

clach04 commented Feb 11, 2024

For example .md files for text files in Markdown format. Does not imply any sort of Markdown functionality but should be able to:

  • See filename
  • open for viewing
  • open for editing/save
  • search and include in results.

Related #1 for additional/alternative encryption formats.

TEST build https://github.com/clach04/tombo/releases/tag/2.0b5_md_file_extension_test
New files and renaming (titles) results in new filename ending in .txt.

@clach04 clach04 added the enhancement New feature or request label Feb 11, 2024
@clach04
Copy link
Owner Author

clach04 commented Nov 23, 2024

GitHub code search appears to be broken and only shows one line change https://github.com/search?q=repo%3Aclach04%2Ftombo+.txt+language%3AC%2B%2B&type=code&l=C%2B%2B,

if (_tcsicmp(p, TEXT(".txt")) == 0 ||

However

if (_tcsicmp(p, TEXT(".txt")) == 0) {

Not a goal, changing default likely

return TEXT(".txt");

C:\code\c\tombo>rg \".txt\"
Src\RepositoryImpl.cpp
379:                    if (_tcsicmp(p, TEXT(".txt")) == 0 ||

Src\MemoNote.cpp
188:    if (!GetHeadLinePath(pTopDir, sMemoDir.Get(), sHeadLine.Get(), TEXT(".txt"),
246:    return TEXT(".txt");
501:    if (_tcsicmp(p, TEXT(".txt")) == 0) {

iOS\Tombo\Tombo\Storage.m
335:    [newPath appendString:@".txt"];

@clach04
Copy link
Owner Author

clach04 commented Nov 24, 2024

Turns out there is a lot of code that makes the assumption file extensions are 4 bytes, ".ABC" does an efficient subtract 4 math on filenames. Supporting less than 4 bytes (including period/dot) will require changes in a few different places and support for either finding the right-most "." rindex() / strrchr() or right-most (backwards) string compare.

NOTE case sensitive.

@clach04
Copy link
Owner Author

clach04 commented Nov 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant