8000 Can't find newlines (\n) when regex find isn't enabled · Issue #160 · richrd/suplemon · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Can't find newlines (\n) when regex find isn't enabled #160

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

Open
richrd opened this issue Aug 2, 2016 · 8 comments
Open

Can't find newlines (\n) when regex find isn't enabled #160

richrd opened this issue Aug 2, 2016 · 8 comments

Comments

@richrd
Copy link
Owner
richrd commented Aug 2, 2016

New lines should be findable in all modes.

@richrd richrd self-assigned this Aug 2, 2016
@richrd
Copy link
Owner Author
richrd commented Aug 2, 2016

I've been thinking about this, and UX wise it's not entirely simple. When the user uses the non-regex find, we don't know wether they wan't to use escape sequences like \n, \t or not. Maybe they wan't to find the characters '\n' in their code, or maybe their looking for a new line.

Should we actually just constrain escape sequences to regex search? Now the prompts only support single line input (simple to accept with enter), so inserting an actual new line into the search prompt can't be done if multi line prompts aren't implemented.

Anyway, if escape sequences are to be interpreted I'd probably go with this: http://stackoverflow.com/questions/4020539/process-escape-sequences-in-a-string-in-python

@richrd richrd added the question label Aug 2, 2016
@twolfson
Copy link
Contributor
twolfson commented Aug 2, 2016

Sublime Text doesn't allow for escape sequences. Instead it does the literal representation in the search field (i.e. a new line scrolls the search field/expands the height of the search field)

See "Shift+Enter" inside of "Find" for "Find in File":

selection_235

@richrd
Copy link
Owner Author
richrd commented Aug 2, 2016

Multi line prompts would be nice to have. Only problem is there's no support for "shift-enter" in the termimal :/

@twolfson
Copy link
Contributor
twolfson commented Aug 2, 2016

Damn, is that something that could be fixed by moving to raw mode?

@richrd
Copy link
Owner Author
richrd commented Aug 2, 2016

I wish it helped. We should be in raw mode already https://github.com/richrd/suplemon/blob/master/suplemon/ui.py#L120

Anyway I do think a multi line prompt could be something worth having, but maybe it's not worth it just for this usecase.

Copy link
Contributor
twolfson commented Aug 2, 2016

Ah, I think I missed that transition. I concur with your work to value assessment and maybe there's another solution

@richrd richrd mentioned this issue Aug 4, 2016
13 tasks
@richrd
Copy link
Owner Author
richrd commented Aug 4, 2016

For now I'll keep the behaviour as it is. For regex searches it makes perfect sense for \n etc escape sequences to work. For the basic find it would be ambigious. If (and when) multi line prompts are implemented this could be resolved. Closing for now though.

@richrd richrd closed this as completed Aug 4, 2016
@richrd
Copy link
Owner Author
richrd commented Aug 15, 2016

Let me backtrack a little regarding shift+enter (and other special key combinations). Apparently curses doesn't distinguish between enter and shift+enter when using curses.key_name, and Suplemon relies heavily on that function. But after some testing I found that we actually do receive different key codes for shift+enter and enter. So I'll try and get this (issue #164) fixed for next release, but it'll probably require lots of testing to make sure the solution doesn't break anything.

@richrd richrd reopened this Jun 25, 2019
@richrd richrd added this to the Version 1.0.0 milestone Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0