-
Notifications
You must be signed in to change notification settings - Fork 37
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
WIP: Integrate the find-and-replace panel with the Julia Console #187
Conversation
This allows calling "Find" from the Julia Console, using the standard find-and-replace package! :) It's currently just searching a dummy `TextBuffer` that contains `"HI IT'S NATHAN"`. The next step is to hook it up to the actual xterm.js Terminal's search capability.
It currently only does `findNext`, always going forward every time you hit enter (even if you press shift-enter). It also always incorrectly reports just "1 result" (It must return at least one result to allow you to cycle through them.)
Nice works and thanks for the contribution! :) One major problem with reusing Replicating a minimal UI for this should be fairly easy though, I think. I'd be happy to do that though if you don't feel like it ;) |
:D Thanks!
Hmm, but does that matter for us? Is it currently possible to open the Console in a dock on the side? Can you show me how to do that? :)
Yeah, agreed! If you want to do that, I'd appreciate it, yeah! You're right, i guess there's not really a reason to reuse the UI, since we won't ever support the Replace part of That said, there's a fair bit of UI to include: the search term, buttons for Regex, case sensitivity, only in selection, and whole word, and finally find next and find previous. And finally, unfortunately, i'm currently more stuck on integrating with |
This reverts commit 608d3a9. It breaks searching for same-line words, which means it also breaks typing mutliple characters in a row for a long word.
With the config above you can search through the
True. I might get to it tomorrow, but no promises yet.
Yeah, but VSCode makes do with the same API for now so I guess we can too. |
Oh, weird! Your atom looks different than mine.. I don't have the fancy bar on the left, and when i open the Console through the Thanks for showing me that! Yeah you're right that the
Oh cool, i didn't realize. Yeah, makes sense then! I think with a custom UI those above problems won't be as relevant anyway. Thanks. |
Yeah it works great! :) Thanks for putting this together so fast! These two "missing features" i have in the top comment (reproduced here) still apply, but they're due to limitations in
I think this looks great and would be good to merge any time! :) Thanks for the fast work here, @pfitzseb! ❤️❤️❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks! 👍
lib/console2/console.js
Outdated
@@ -3,23 +3,26 @@ | |||
|
|||
import etch from 'etch' | |||
import { Raw } from '../util/etch.js' | |||
import { CompositeDisposable, Emitter } from 'atom' | |||
import { CompositeDisposable, Emitter, TextEditor, TextBuffer, Disposable, MarkerLayer, Range } from 'atom' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can revert these changes as well
import { CompositeDisposable, Emitter, TextEditor, TextBuffer, Disposable, MarkerLayer, Range } from 'atom' | |
import { CompositeDisposable, Emitter } from 'atom' |
import { closest } from './helpers' | ||
import { openExternal } from 'shell' | ||
|
||
export default class TerminalSearchUI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This class actually does the UI /and/ the search functionality. Would like SearchBar
or SearchPanel
or SearchBox
be a reasonable name instead?
-- oh, wait, i guess "UI" doesn't necessarily mean "html-only"... Maybe ignore me. That said, when i first glanced through this PR i scrolled past this file expecting it just to be the HTML/CSS stuff, and expecting the functionality to be implemented somewhere else, so idk if others might have the same thought.
&.nothingfound { | ||
border-color: @background-color-error; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, i'm really impressed how little code this took to add! Good job building up abstractions in this repo so reuse was so easy! :) I'm impressed! 😄
and general code cleanup
And with the new xterm.js release it's possible to find multiple items on the same line. 🎉 |
Looks beatiful! :) Thanks!
Haha woohoo that's awesome! :D :D Perfect timing! :) :D Thanks again for picking this up and doing it so fast! Looking forward to it dropping! XD |
Alright, new release is out! |
Looks great!! :D Thanks again! :) |
Integrates the Julia Console with Atom's built-in
find-and-replace
plugin!Still a work in progress. Some remaining features that are probably necessary:
1
-- which is arbitrary)Finished features:
Some of those missing features will get easier after the refactoring planned here: xtermjs/xterm.js#1833
But still, it's not bad as-is!! It might be already at a stage where it's worth merging after we clean up the code / pare it down to just what's needed, and add unit tests...
Fixes JunoLab/Juno.jl#212.