summaryrefslogtreecommitdiff
path: root/qutebrowser/completion
AgeCommit message (Collapse)Author
2021-08-26Fix style enum accessFlorian Bruhin
2021-08-26Automatically rewrite enumsFlorian Bruhin
See #5904
2021-08-26Blanket PyQt5 -> PyQt6Florian Bruhin
2021-07-13Simplify exception catchingFlorian Bruhin
2021-07-13Handle and test more file path corner casesFlorian Bruhin
2021-07-13Handle UnicodeEncodeError in path completionFlorian Bruhin
2021-06-26Update usages of sql module to use the new class.lufte
2021-03-31Increase vim compatibilityFlorian Bruhin
Vim has this, and it's almost easter, so clearly we should have it too. Also it's from Monty Python, which makes it even more fitting. HEAD KNIGHT: Ni! KNIGHTS: Ni! Ni! Ni! ARTHUR: Who are you? HEAD KNIGHT: We are the Knights Who Say... Ni! ARTHUR: No! Not the Knights Who Say Ni! HEAD KNIGHT: The same! BEDEVERE: Who are they? HEAD KNIGHT: We are the keepers of the sacred words: Ni, Pen, and Ni-wom! RANDOM: Ni-wom! ARTHUR: Those who hear them seldom live to tell the tale! HEAD KNIGHT: The Knights Who Say Ni demand a sacrifice! ARTHUR: Knights of Ni, we are but simple travellers who seek the enchanter who lives beyond these woods. HEAD KNIGHT: Ni! Ni! Ni! Ni! ARTHUR and PARTY: Oh, ow! HEAD KNIGHT: We shall say 'nee' again to you if you do not appease us. ARTHUR: Well, what is it you want? HEAD KNIGHT: We want... a shrubbery! [dramatic chord] ARTHUR: A what? HEAD KNIGHT: Ni! Ni! ARTHUR and PARTY: Oh, ow! ARTHUR: Please, please! No more! We shall find a shrubbery. HEAD KNIGHT: You must return here with a shrubbery or else you will never pass through this wood alive! ARTHUR: O Knights of Ni, you are just and fair, and we will return with a shrubbery. HEAD KNIGHT: One that looks nice. ARTHUR: Of course. HEAD KNIGHT: And not too expensive. ARTHUR: Yes. HEAD KNIGHTS: Now... go! ARTHUR: Old crone! Is there anywhere in this town where we could buy a shrubbery! [dramatic chord] CRONE: Who sent you? ARTHUR: The Knights Who Say Nee. CRONE: Agh! No! Never! We have no shrubberies here. ARTHUR: If you do not tell us where we can buy a shrubbery, my friend and I will say... we will say... `nee'. CRONE: Agh! Do your worst! ARTHUR: Very well! If you will not assist us voluntarily,... Ni! CRONE: No! Never! No shrubberies! ARTHUR: Ni! BEDEVERE: Noo! Noo! ARTHUR: No, no, no, no -- it's not that, it's 'Ni'. BEDEVERE: Noo! ARTHUR: No, no -- 'Ni'. You're not doing it properly. BEDEVERE: Noo! Ni! ARTHUR: That's it, that's it, you've got it. ARTHUR and BEDEVERE: Ni! Ni! ROGER: Are you saying 'Ni' to that old woman? ARTHUR: Um, yes. ROGER: Oh, what sad times are these when passing ruffians can say `Ni' at will to old ladies. There is a pestilence upon this land, nothing is sacred. Even those who arrange and design shrubberies are under considerable economic stress at this period in history. ARTHUR: Did you say `shrubberies'? ROGER: Yes, shrubberies are my trade -- I am a shrubber. My name is Roger the Shrubber. I arrange, design, and sell shrubberies. BEDEVERE: Ni! ARTHUR: No! No, no, no! No! ARTHUR: O, Knights of Ni, we have brought you your shrubbery. May we go now? HEAD KNIGHT: It is a good shrubbery. I like the laurels particularly. But there is one small problem. ARTHUR: What is that? HEAD KNIGHT: We are now... no longer the Knights Who Say Ni. RANDOM: Ni! HEAD KNIGHT: Shh shh. We are now the Knights Who Say Ecky-ecky-ecky- ecky-pikang-zoom-boing-mumble-mumble. RANDOM: Ni! HEAD KNIGHT: Therefore, we must give you a test. ARTHUR: What is this test, O Knights of-- Knights Who 'Til Recently Said Ni? HEAD KNIGHT: Firstly, you must find... another shrubbery! [dramatic chord] ARTHUR: Not another shrubbery! HEAD KNIGHT: Then, when you have found the shrubbery, you must place it here beside this shrubbery, only slightly higher so you get a two-level effect with a little path running down the middle. RANDOM: A path! A path! Ni! HEAD KNIGHT: Then, when you have found the shrubbery, you must cut down the mightiest tree in the forest... with... a herring! [dramatic chord] ARTHUR: We shall do no such thing! HEAD KNIGHT: Oh, please! ARTHUR: Cut down a tree with a herring? It can't be done. KNIGHTS: Aaaaugh! Aaaugh! HEAD KNIGHT: Don't say that word. ARTHUR: What word? HEAD KNIGHT: I cannot tell, suffice to say is one of the words the Knights of Ni cannot hear. ARTHUR: How can we not say the word if you don't tell us what it is? KNIGHTS: Aaaaugh! Aaaugh! ARTHUR: What, `is'? HEAD KNIGHT: No, not `is' -- we couldn't get vary far in life not saying `is'. BEDEVERE: My liege, it's Sir Robin! MINSTREL (singing): Packing it in and packing it up And sneaking away and buggering up And chickening out and pissing about Yes, bravely he is throwing in the sponge ARTHUR: Oh, Robin! ROBIN: My liege! It's good to see you! KNIGHTS: Aaaaugh! HEAD KNIGHT: He said the word! ARTHUR: Surely you've not given up your quest for the Holy Grail? MINSTREL (singing): He is sneaking away and buggering up-- ROBIN: Shut up! No, no no-- far from it. HEAD KNIGHT: He said the word again! ROBIN: I was looking for it. KNIGHTS: Aaaaugh! ROBIN: Uh, here, here in this forest. ARTHUR: No, it is far from-- KNIGHTS: Aaaaugh! HEAD KNIGHT: Aaaaugh! Stop saying the word! ARTHUR: Oh, stop it! KNIGHTS: Aaaaugh! HEAD KNIGHT: Oh! He said it again! ARTHUR: Patsy! HEAD KNIGHT: Aaugh! I said it! I said it! Ooh! I said it again! KNIGHTS: Aaaaugh!
2021-03-23Clean up successful process data after 1hFlorian Bruhin
2021-03-23Sort :process completion manuallyFlorian Bruhin
2021-03-23Fix lint/testsFlorian Bruhin
2021-03-23Add a ProcessOutcome classFlorian Bruhin
2021-03-23Add :processFlorian Bruhin
See #5673
2021-03-18Move completion fallback handling out of CommandParserFlorian Bruhin
This makes CompletionParser.parse simpler and makes ParseResult.cmd and .args non-Optional. Them being Optional would mean we would've to either resort to more complex typing with Literal, or to check whether they are really non-None everywhere. Since fallback=True is only used at one point, let's just handle this at the calling site instead. In theory, this changes the behavior when the cmdstr is empty and self._partial_match is set, because we now raise early and self._completion_match isn't called anymore. In practice, I think this shouldn't make a difference anywhere, and tests seem to agree. If cmdstr is empty and self._partial_match is False, the behavior should be the same, because objects.commands[''] will raise KeyError.
2021-03-03Merge remote-tracking branch 'origin/pr/5967' into devFlorian Bruhin
2021-01-26doc: Switch URLs to httpsFlorian Bruhin
2021-01-20Bump copyright yearsFlorian Bruhin
Closes #6015
2021-01-20Rename :buffer to :tab-selectFlorian Bruhin
See #6022
2021-01-20completion: Avoid pathlib in filepathcategoryFlorian Bruhin
On GitHub Actions, it looks like there's a situation where os.path.expanduser and pathlib.Path.expanduser disagree. When in test_filesystem_completion_hypothesis the completion gets '~' as input, it fails with: tests/unit/completion/test_models.py:469: in test_filesystem_completion_hypothesis model.set_pattern(text) qutebrowser/completion/models/filepathcategory.py:88: in set_pattern self._paths = sorted(self._contract_user(val, path) for path in paths) qutebrowser/completion/models/filepathcategory.py:88: in <genexpr> self._paths = sorted(self._contract_user(val, path) for path in paths) qutebrowser/completion/models/filepathcategory.py:52: in _contract_user return str(head / pathlib.Path(path).relative_to(head.expanduser())) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = PosixPath('/home/runneradmin'), other = (PosixPath('/home/runner'),) parts = ['/', 'home', 'runneradmin'], drv = '', root = '/' def relative_to(self, *other): [...] E ValueError: '/home/runneradmin' does not start with '/home/runner' Let's use os.path everywhere, so we can be sure the two code paths agree with each other.
2021-01-20Handle null bytes in filepath completionFlorian Bruhin
2021-01-20Update docsFlorian Bruhin
2021-01-20Refactor FilePathCategoryFlorian Bruhin
2021-01-20Minor reformatFlorian Bruhin
2021-01-20Merge remote-tracking branch 'origin/pr/6038' into devFlorian Bruhin
2021-01-19Add some testsAndrew MacFie
2021-01-19Add favorite_paths as settingAndrew MacFie
2021-01-19Remove config import for nowAndrew MacFie
2021-01-19Fix name from QtAndrew MacFie
2021-01-19Fix method implementationAndrew MacFie
2021-01-19Add filesystem completion to defaultAndrew MacFie
2021-01-19Leave prefix as user typed itAndrew MacFie
2021-01-19Fix some stuffAndrew MacFie
2021-01-19Update qutebrowser/completion/models/filepathcategory.pyAndrew
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-19Update qutebrowser/completion/models/filepathcategory.pyAndrew
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-19Update qutebrowser/completion/models/filepathcategory.pyAndrew
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-19Update qutebrowser/completion/models/filepathcategory.pyAndrew
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2021-01-14Fix c/p'ed docstringAndrew MacFie
2021-01-14Remove lint (whoops)Andrew MacFie
2021-01-14Support file protocol in filename completionAndrew MacFie
2021-01-14Add file path completionAndrew MacFie
2021-01-13Remove unused importsFlorian Bruhin
2021-01-13dataclasses: Initial mypy fixFlorian Bruhin
See #6023
2021-01-13dataclasses: Initial switchFlorian Bruhin
See #6023
2021-01-06Eliminate parser dependency on config.Ryan Roden-Corrent
commands.runners depends on config.config to get aliases and the best_match setting, while config.config depends on commands.runners to split commands. Eliminate this circular dependency by: - Moving CommandParser from commands.runners into its a new commands.parser module - Pass aliases/config settings into CommandParser as arguments
2021-01-02pylint: Make config check more intelligentFlorian Bruhin
2020-12-30Fix lintFlorian Bruhin
2020-12-30Show renderer process PID in :buffer completionFlorian Bruhin
2020-12-30Merge remote-tracking branch 'origin/pr/5992'Florian Bruhin
2020-12-28Trim long patterns rather than clearing them.Ryan Roden-Corrent
Fixes #5973.
2020-12-28Use f-string for log line.Ryan Roden-Corrent
Co-authored-by: Florian Bruhin <me@the-compiler.org>