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

Improvements to newfile dialog, open links, other fixes #2277

Merged
merged 12 commits into from
May 19, 2024

Conversation

harshad1
Copy link
Collaborator

@harshad1 harshad1 commented May 5, 2024

In this PR I have added the ability to format at new file title similarly to how we format snippets.

Additionally, we now remember template and name format per file type.

This should

EDIT:
I have merged in my open links in tags PR so more things have been pulled in here:

  1. Open any link in an html tag (such as our audio attachment format)
  2. Fixes for new files not showing when newfile dialog rotated
  3. Tweaks to prevent screen flashing when file opened in view mode

@harshad1
Copy link
Collaborator Author

harshad1 commented May 5, 2024

image


public static class Format {
public final @StringRes int format, name;
public final String ext;
Copy link
Owner

@gsantner gsantner May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion please make ext / it's handling as regex instead

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just meant to be a source of truth, not used for matching etc. i.e. this says ' The canonical extension for markdown is ".md" '

Format and FORMATS is not meant to match or detect formats - that is left to the isFileOutOfThisFormat as before.

@@ -19,7 +20,7 @@ public class TodoTxtAutoTextFormatter implements InputFilter {
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
try {
if (start < source.length() && dstart <= dest.length() && TextViewUtils.isNewLine(source, start, end)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved some functions from TextViewUtils to GsTextUtils

@@ -119,6 +121,8 @@ public static class Options {

public Collection<File> favouriteFiles, recentFiles, popularFiles = null;
public GsCallback.a1<CharSequence> setTitle = null, setSubtitle = null;

public GsCallback.a0 refresh = null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted back to just having collections and added a refresh callback here. The refresh callback is called in loadFolder() and can be used to do whatever.

opts.recentFiles = appSettings.getRecentFiles();
opts.popularFiles = appSettings.getPopularFiles();
};
opts.refresh.callback();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the refresh callback to update sorting, fav file lists etc etc.

@gsantner gsantner added this to the Markor v2.13 milestone May 19, 2024
@gsantner gsantner merged commit f35383a into gsantner:master May 19, 2024
1 check passed
gsantner added a commit that referenced this pull request May 19, 2024
@gsantner
Copy link
Owner

Broke a few things -> #2297

@harshad1 harshad1 deleted the improvements_to_newfile_dialog branch August 18, 2024 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment