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

Notes app reformats whole document #24

Open
abdullah8a0 opened this issue Sep 21, 2022 · 4 comments
Open

Notes app reformats whole document #24

abdullah8a0 opened this issue Sep 21, 2022 · 4 comments

Comments

@abdullah8a0
Copy link

Going into Normal mode and deleting a character in the body turns the whole Note into Title, i.e boldface and bigger font.
Screen Shot 2022-09-21 at 12 56 43 PM

Deleted a character in the highlighted line

@daxmate
Copy link

daxmate commented Nov 25, 2022

I have the same problem.

@FelixKratz
Copy link
Owner

This might be connected to #15 and could probably be solved by replacing the current text replacement approach (which replaces the entire text of a field on a change):

SketchyVim/src/ax.c

Lines 77 to 91 in 010426a

static inline bool ax_set_text(struct ax* ax) {
if (!ax->is_supported || !ax->buffer.raw) return false;
if (!ax->buffer.did_change) return true;
CFStringRef text_ref = CFStringCreateWithCString(NULL,
ax->buffer.raw,
kCFStringEncodingUTF8);
AXError error = AXUIElementSetAttributeValue(ax->selected_element,
kAXValueAttribute,
text_ref );
CFRelease(text_ref);
return error == kAXErrorSuccess;
}

with an atomic approach, only replacing lines that have changed.
As I already stated in #15 I would accept pull requests regarding this, since it is not something that I encounter in my personal workflow but could be changed fairly easily.

@mickael-menu
Copy link

mickael-menu commented Jan 3, 2023

I've been trying to use SketchyVim with Xcode to replace the subpar Vim Xcode implementation (no dot command...) and faced a similar issue. When doing any change, the top of the editor is shifting to the line that was modified, as shown in this screencast. My C is really rusty, but maybe I could contribute this fix with some guidance. kAXValueAttribute changes the whole content of the element, did you have an API in mind to perform atomic changes?

xcode.mov

@sahewat
Copy link

sahewat commented Nov 29, 2023

I'd be potentially interested in fixing this but don't know much about the system APIs. @FelixKratz, how would you recommend going about it?

Major annoyance when using it. Find every other or so text field unexpectedly is deleted when using the tool.

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

No branches or pull requests

5 participants