зеркало из https://github.com/mozilla/pjs.git
when replacing the text of the urlbar (with, say, a bookmark), put the
insertion point at the end instead of leaving it at the beginning.
This commit is contained in:
Родитель
4d4d0d8c29
Коммит
ac7f9b459d
|
@ -472,8 +472,15 @@ NS_IMPL_ISUPPORTS1(AutoCompleteListener, nsIAutoCompleteListener)
|
|||
// need to use one of its routines to update the autocomplete status or
|
||||
// we could find ourselves with stale results and the popup still open. If
|
||||
// it doesn't have focus, we can bypass all that and just use normal routines.
|
||||
if ( [[self window] firstResponder] == [self fieldEditor] )
|
||||
if ( [[self window] firstResponder] == [self fieldEditor] ) {
|
||||
[self setStringUndoably:aURI fromLocation:0]; // updates autocomplete correctly
|
||||
|
||||
// set insertion point to the end of the url. setStringUndoably:fromLocation:
|
||||
// will leave it at the beginning of the text field for this case and
|
||||
// that really looks wrong.
|
||||
int len = [[[self fieldEditor] string] length];
|
||||
[[self fieldEditor] setSelectedRange:NSMakeRange(len, len)];
|
||||
}
|
||||
else
|
||||
[self setStringValue:aURI];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче