qannotate: implement "search" and "search next"

Bug #215256 reported by Kostja Osipov
6
Affects Status Importance Assigned to Milestone
Bazaar
Invalid
Undecided
Unassigned
QBzr
Fix Released
High
Gary van der Merwe

Bug Description

It seems there is no way to search for a line of code in bzr qannotate.
I can only jump to a line number by entering it.
Please implement search functionality and provide access to it either
by a keybinding or a menu item/button.

Related branches

Kostja Osipov (kostja)
description: updated
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: bzr qannotate: implement "search" and "search next"

this bug related to QBzr not to bzr itself.

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 215256] [NEW] bzr qannotate: implement "search" and "search next"

This is a bug in qbzr.

  affects bzr
  status invalid

  affects qbzr
  status unconfirmed
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is a bug in qbzr.

  affects bzr
  status invalid

  affects qbzr
  status new
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Changed in qbzr:
importance: Undecided → Wishlist
status: New → Confirmed
Changed in qbzr:
assignee: nobody → garyvdm
Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote : Re: bzr qannotate: implement "search" and "search next"

Yes, lack of search here is annoying. On the command line, I frequently pipe the output from 'bzr annotate' into less and search around for the method/class/whatever I'm investigating. In qannotate, I type "Ctrl-F" (ala Firefox) and nothing happens. :-(

Revision history for this message
John A Meinel (jameinel) wrote :

Going further, typing the number isn't very obvious that it is actually going to do anything (I expected Ctrl-G as 'goto line'.)

Having an upper menu letting you select these sort of things would also be more discoverable. I didn't know numbers worked until I read this page.

Revision history for this message
John A Meinel (jameinel) wrote :

Oh, and because of how it is implemented, if you are currently on line "250" it doesn't let you go to line "25". Typing 2 takes you to line 251, and typing "25" leaves you there.
Typing 025 doesn't seem to reset the pointer, etc.

I think typing: 250 1 25 does get me back there, but it is a rather strange process.

Revision history for this message
Alexandre Garnier (zigarn) wrote :

Same for qdiff : have a search feature

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 215256] Re: bzr qannotate: implement "search" and "search next"

Just as a workaround, I'll mention that bzr gannotate does support
Ctrl-F for find, though (last time I checked) there was no menu item
so it was not very discoverable.

Changed in qbzr:
importance: Wishlist → Medium
Revision history for this message
Gary van der Merwe (garyvdm) wrote : Re: bzr qannotate: implement "search" and "search next"

The thing that is preventing us from implementing find (not goto line) is that we can to text selections in a QTreeView, which qannotate uses to display the file. To fix this, we need a QTextBrowser that has margins that we can display the line number and annotate, and allow for column resizing.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

Should read: is that we *can't* to text selections in a QTreeView

Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

>>To fix this, we need a QTextBrowser that has margins that we can display the line number and annotate, and allow for column resizing.

If a QTextBrowser is used, then maybe it can be reused in qdiff for adding line numbers to it etc.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 215256] Re: bzr qannotate: implement "search" and "search next"

Gary van der Merwe пишет:
> Should read: is that we *can't* to text selections in a QTreeView

Gary, I think in first iteration it will enough to just select entire
line when search matches part of line. IMO it will satisfy the user
needs on 80%.

Changed in qbzr:
importance: Medium → High
tags: added: qannotate
summary: - bzr qannotate: implement "search" and "search next"
+ qannotate: implement "search" and "search next"
tags: added: feature-request
tags: added: feature
removed: feature-request
Changed in qbzr:
assignee: Gary van der Merwe (garyvdm) → nobody
Changed in qbzr:
assignee: nobody → Gary van der Merwe (garyvdm)
status: Confirmed → In Progress
Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

Some feedback on the work in progress:
Short cuts like ctrl+F (search) and ctrl+L (goto line) would be awesome.
When the user types in text and presses "Enter" it should goto the line, rather than him having to press the goto button.
On goto, can you have it centered on the page rather than showing it at the bottom of the page. (Obviously, If there is space)

BTW, its looking good.

Revision history for this message
Gary van der Merwe (garyvdm) wrote : Re: [Bug 215256] Re: qannotate: implement "search" and "search next"

Thanks for the feed back.

On 26/02/2010 09:07, Craig Hewetson wrote:
> Short cuts like ctrl+F (search) and ctrl+L (goto line) would be
> awesome.

It allready has Ctrl-f and ctrl-g. If they don't work, it's a bug.

I'll add ctrl+L, so goto line will have 2 shortcuts.

> When the user types in text and presses "Enter" it should goto the
> line, rather than him having to press the goto button.

Works for me. If it doesnot work for you, its a bug.

> On goto, can you have it centered on the page rather than showing it
> at the bottom of the page. (Obviously, If there is space)

I'll change that.

> BTW, its looking good.

Good. How do you fell about the ui? Do you think that the ui changes
(toolbar, rather that buttons at the bottom) will work on the other
browse windows (browse, log, diff, cat)

Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

Sorry the short cuts ctrl+G and ctrl+F works.

Hitting enter when using the goto doesn't work for me.

When using ctrl+F i think the "next" button should have focus, so when i hit "enter" again it goes to the "next" match. The same way gedit and firefox works.

>>Good. How do you fell about the ui? Do you think that the ui changes(toolbar, rather that buttons at the bottom) will work on the other browse windows (browse, log, diff, cat)
Yes, I think the toolbar will work nicely on the "browse" type dialogs. This will help when more features get included to these dialogs.

Revision history for this message
Gary van der Merwe (garyvdm) wrote :

From http://irclogs.ubuntu.com/2010/03/17/%23bzr.txt :

[17:05] <GaryvdM> vila: lp:~garyvdm/qbzr/annotate_find
[17:06] <GaryvdM> vila: wip
[17:08] <GaryvdM> vila: wip because I want to make that ui change to all browse dialogs before I land it. If you don't mind that, It is compleatly usable.
[17:10] <vila> GaryvdM: I'll try it (and hope I'll remember to track when it lands...) that's my most wanting feature
[17:10] <vila> GaryvdM: well, that and being able to do bzr qblame <file> <linenumber> :-P
[17:12] <GaryvdM> vila: That branch also has a gotoline (ctrl-g), but no command line option.
[17:12] <vila> GaryvdM: I see that, cute :)
[17:13] <vila> err, I can't type anything in Goto Line box
[17:13] * GaryvdM looks
[17:14] <vila> .. but got a nice error dialog if I press the Go button about: invalid literal for int() with base 10: '' :-D
[17:14] <vila> incremental search.... rhaaaa lovely
[17:15] <vila> hmm, no short-cut for previous/next ?
[17:18] <GaryvdM> vila: For me I can type numbers into the goto line box.
[17:18] <GaryvdM> vila: I get that error I type nothing in.
[17:18] <vila> GaryvdM: Do you have a numeric keypad or are you typing from the upper row ?
[17:19] <vila> neither works in my case anyway
[17:19] <GaryvdM> :-( Keypad does not work. Using upper row.
[17:19] <vila> weird
[17:20] <vila> GaryvdM: you checked your num-lock right ?
[17:21] <vila> pasting doesn't work either, that kind of rules out a keyboard problem
[17:21] <GaryvdM> vila: I'm just doing :
[17:21] <GaryvdM> self.line_edit.setValidator(QtGui.QIntValidator(1, sys.maxint, self.line_edit))
[17:22] <vila> GaryvdM: Anyway, it's already useful as-is, I usually *know* the line number because it's there in an emacs buffer but generally I'm searching for some text, so incremental search is a real plus
[17:22] <GaryvdM> vila: I'll make a note about that.
[17:23] <vila> GaryvdM: commeting this line is enough to make it work ;)
[17:24] <vila> But you should also bind <return> to the Go button ;)
[17:24] <GaryvdM> Yes
[17:26] <GaryvdM> Hmm, I have go.setShortcut((QtCore.Qt.Key_Enter)) , but it's not working
[17:29] <vila> hmm, I think you should do that on text entry

Changed in qbzr:
milestone: none → 0.19b2
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.