Skip to content

Commit

Permalink
fix errors caused by merging
Browse files Browse the repository at this point in the history
  • Loading branch information
guanglinn committed Dec 14, 2024
1 parent 7dc2f2d commit 4d43aaf
Showing 1 changed file with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import android.text.Layout;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.util.Log;
import android.view.ActionMode;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -131,7 +131,6 @@ public boolean onPreDraw() {

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
try {
super.onDraw(canvas);
} catch (Exception e) {
Expand Down Expand Up @@ -216,7 +215,9 @@ public void setDynamicHighlightingEnabled(final boolean enable) {
recomputeHighlighting();
}

// public boolean isDynamicHighlightingEnabled() { return _isDynamicHighlightingEnabled; }
public boolean isDynamicHighlightingEnabled() {
return _isDynamicHighlightingEnabled;
}

public void setHighlighter(final SyntaxHighlighterBase newHighlighter) {
if (_hl != null) {
Expand Down Expand Up @@ -558,4 +559,37 @@ public int moveCursorToBeginOfLine(int offset) {
public boolean indexesValid(int... indexes) {
return GsTextUtils.inRange(0, length(), indexes);
}

private void setupCustomOptions() {
setCustomSelectionActionModeCallback(new ActionMode.Callback() {
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
// Add custom items programmatically
menu.add(0, R.string.option_select_lines, 0, "☰");
return true;
}

@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
// Modify menu items here if necessary
return true;
}

@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()) {
case R.string.option_select_lines:
HighlightingEditor.this.selectLines();
return true;
default:
return false;
}
}

@Override
public void onDestroyActionMode(ActionMode mode) {
// Cleanup if needed
}
});
}
}

0 comments on commit 4d43aaf

Please sign in to comment.