Skip to content

Commit

Permalink
md::moduleaction end line with 2 spaces (closes gsantner#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Mar 18, 2018
1 parent 3bf25ef commit 98b0ddb
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### v0.3.3
- Allow to set document folder outside of internal storage
- Fix import dialog orientation crash
- Add option to start editing on bottom
- Improve project icon
- Trim share-into text
- Improved exporting/sharing


### v0.3.2
- Todotxt: Support delete, archive tasks
- Todotxt: Try to keep cursor position
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ android {

applicationId "net.gsantner.markor"
versionName "0.3.2"
versionCode 16
versionCode 17
}

productFlavors {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,12 @@ private void checkReloadDisk() {
@Override
public void onFragmentFirstTimeVisible() {
AppSettings as = new AppSettings(getContext());
if (as.isEditorStartOnBotttom() && (_savedInstanceState == null || !_savedInstanceState.containsKey(SAVESTATE_CURSOR_POS))) {
_hlEditor.requestFocus();
_hlEditor.setSelection(_hlEditor.length());
if (_savedInstanceState == null || !_savedInstanceState.containsKey(SAVESTATE_CURSOR_POS)) {
// TODO
if (as.isEditorStartOnBotttom() && _hlEditor.length() > 0) {
_hlEditor.requestFocus();
_hlEditor.setSelection(_hlEditor.length());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ else if (((selectionEnd <= (_hlEditor.length() - _action.length())) &&

private static final int[][] KEYBOARD_EXTRA_ACTIONS_ICONS = {
{R.drawable.format_link, 1}, {R.drawable.format_image, 2},
{CommonTextModuleActions.ACTION_SPECIAL_KEY__ICON, 3}
{CommonTextModuleActions.ACTION_SPECIAL_KEY__ICON, 3},
{R.drawable.ic_keyboard_return_black_24dp, 4},
};
private static final Pattern LINK_PATTERN = Pattern.compile("(?m)\\[(.*?)\\]\\((.*?)\\)");

Expand All @@ -213,6 +214,17 @@ public void onClick(View view) {
new CommonTextModuleActions(_activity, _document, _hlEditor).runAction(CommonTextModuleActions.ACTION_SPECIAL_KEY);
break;
}
case 4: {
if (_hlEditor.length() > 1) {
int start = _hlEditor.getSelectionStart();
String text = _hlEditor.getText().toString();
int insertPos = text.indexOf('\n', start);
insertPos = insertPos < 1 ? text.length() : insertPos;
_hlEditor.getText().insert(insertPos, " " + (text.endsWith("\n") ? "" : "\n"));
_hlEditor.setSelection(insertPos + 3);
}
break;
}
default: {
getAlertDialog(_action);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class FilesystemDialogCreator {
opts.searchHint = R.string.search_documents;
opts.searchButtonImage = R.drawable.ic_action_search;
opts.homeButtonImage = R.drawable.ic_home_black_24dp;
opts.upButtonImage = R.drawable.ic_arrow_back_white_24dp;
opts.upButtonImage = R.drawable.ic_arrow_upward_black_24dp;
opts.selectedItemImage = R.drawable.ic_check_black_24dp;
opts.upButtonEnable = true;
opts.homeButtonEnable = true;
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_arrow_upward_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M4,12l1.41,1.41L11,7.83V20h2V7.83l5.58,5.59L20,12l-8,-8 -8,8z"/>
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_keyboard_return_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M19,7v4H5.83l3.58,-3.59L8,6l-6,6 6,6 1.41,-1.41L5.83,13H21V7z"/>
</vector>
4 changes: 2 additions & 2 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<string-array name="textmoduleactions_press_key__text" translatable="false">
<item translatable="false">@string/key_page_up</item>
<item translatable="false">@string/key_page_down</item>
<item translatable="false">@string/key_pos_1_document</item>
<item translatable="false">@string/key_pos_end_document</item>
<item translatable="false">@string/key_pos_1</item>
<item translatable="false">@string/key_pos_end</item>
<item translatable="false">@string/key_pos_1_document</item>
<item translatable="false">@string/key_pos_end_document</item>
<item translatable="false">@string/key_ctrl_a</item>
<item translatable="false">@string/key_tab</item>
</string-array>
Expand Down

0 comments on commit 98b0ddb

Please sign in to comment.