[ jEdit-devel ] [jedit:patches] #590 patch for correct +line command line behavior

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ jEdit-devel ] [jedit:patches] #590 patch for correct +line command line behavior

Wim West

[patches:#590] patch for correct +line command line behavior

Status: open
Group:
Created: Tue Aug 02, 2016 10:24 AM UTC by Wim West
Last Updated: Tue Aug 02, 2016 10:24 AM UTC
Owner: nobody
Attachments:

Problem:
1. When JEdit is open with one or more buffers and a file is opened via the command line with <file> +line:ll,cc -reuseview then JEdit doesn't scroll to the line,column position in the given file. However the caret is at the right position in the file (but it is not visible).
2. When JEdit is opened first time with command line <file> +line:ll,cc and "Restore previously open files on startup" is checked in Gobal Options - General, then also JEdit doesn't scroll to the line,column position in the given file.

Attached a patch which fixes this.
Potentially related: bug #3414 (2978040)

  1. Problem is in JEdit.OpenFiles. gotoMarker is called within a loop, when +line command line argument is given. Code in gotoMarker is executed in a runAfterIoTasks runnable. gotoMarker code checks whether current view contains newly openen buffer, if not only caret position is set, but no scroll is performed.
    Only after loop is ended, in jEdit.OpenFiles, view is set to the buffer belonging to the file given on the command line. This is too late, apparently runnable code of gotoMarker has already been executed (although one would expect otherwise).
    Fix: after loop with gotoMarker check whether view is current buffer, if not and caret isn't visible then scroll to caret.

  2. Problem is in JEdit.finishStartup. OpenFiles is called with null for view argument.
    Solution: OpenFiles should be called with view as argument.

Remark: I'm not sure whether scrollToCaret(false) or scrollToCaret(true) should be used (concerning doElectricScroll).


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------

--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|

[ jEdit-devel ] [jedit:patches] #590 patch for correct +line command line behavior

Alan Ezust-2
  • assigned_to: Alan Ezust
  • Group: -->

[patches:#590] patch for correct +line command line behavior

Status: open
Group:
Created: Tue Aug 02, 2016 10:24 AM UTC by Wim West
Last Updated: Tue Sep 06, 2016 06:02 PM UTC
Owner: Alan Ezust
Attachments:

Problem:
1. When JEdit is open with one or more buffers and a file is opened via the command line with <file> +line:ll,cc -reuseview then JEdit doesn't scroll to the line,column position in the given file. However the caret is at the right position in the file (but it is not visible).
2. When JEdit is opened first time with command line <file> +line:ll,cc and "Restore previously open files on startup" is checked in Gobal Options - General, then also JEdit doesn't scroll to the line,column position in the given file.

Attached a patch which fixes this.
Potentially related: bug #3414 (2978040)

  1. Problem is in JEdit.OpenFiles. gotoMarker is called within a loop, when +line command line argument is given. Code in gotoMarker is executed in a runAfterIoTasks runnable. gotoMarker code checks whether current view contains newly openen buffer, if not only caret position is set, but no scroll is performed.
    Only after loop is ended, in jEdit.OpenFiles, view is set to the buffer belonging to the file given on the command line. This is too late, apparently runnable code of gotoMarker has already been executed (although one would expect otherwise).
    Fix: after loop with gotoMarker check whether view is current buffer, if not and caret isn't visible then scroll to caret.

  2. Problem is in JEdit.finishStartup. OpenFiles is called with null for view argument.
    Solution: OpenFiles should be called with view as argument.

Remark: I'm not sure whether scrollToCaret(false) or scrollToCaret(true) should be used (concerning doElectricScroll).


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel
Reply | Threaded
Open this post in threaded view
|

[ jEdit-devel ] [jedit:patches] #590 patch for correct +line command line behavior

Alan Ezust-2
In reply to this post by Wim West
  • status: open --> closed-accepted
  • Comment:

Committed revision 24668.


[patches:#590] patch for correct +line command line behavior

Status: closed-accepted
Group:
Created: Tue Aug 02, 2016 10:24 AM UTC by Wim West
Last Updated: Sun Mar 19, 2017 06:40 PM UTC
Owner: Alan Ezust
Attachments:

Problem:
1. When JEdit is open with one or more buffers and a file is opened via the command line with <file> +line:ll,cc -reuseview then JEdit doesn't scroll to the line,column position in the given file. However the caret is at the right position in the file (but it is not visible).
2. When JEdit is opened first time with command line <file> +line:ll,cc and "Restore previously open files on startup" is checked in Gobal Options - General, then also JEdit doesn't scroll to the line,column position in the given file.

Attached a patch which fixes this.
Potentially related: bug #3414 (2978040)

  1. Problem is in JEdit.OpenFiles. gotoMarker is called within a loop, when +line command line argument is given. Code in gotoMarker is executed in a runAfterIoTasks runnable. gotoMarker code checks whether current view contains newly openen buffer, if not only caret position is set, but no scroll is performed.
    Only after loop is ended, in jEdit.OpenFiles, view is set to the buffer belonging to the file given on the command line. This is too late, apparently runnable code of gotoMarker has already been executed (although one would expect otherwise).
    Fix: after loop with gotoMarker check whether view is current buffer, if not and caret isn't visible then scroll to caret.

  2. Problem is in JEdit.finishStartup. OpenFiles is called with null for view argument.
    Solution: OpenFiles should be called with view as argument.

Remark: I'm not sure whether scrollToCaret(false) or scrollToCaret(true) should be used (concerning doElectricScroll).


Sent from sourceforge.net because [hidden email] is subscribed to https://sourceforge.net/p/jedit/patches/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/jedit/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--
-----------------------------------------------
jEdit Developers' List
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jedit-devel