prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  LSP needs a LspJumpBackCommand
  When executing LSP goto definition, 
  and then executing the built in `jump_back` command, 
  the cursor won't be placed in the previous place, as I expect.
  
  To fix this, we can introduce a `LspJumpBackCommand`.
  We can do the same thing as TernForSublime [did](https://github.com/ternjs/tern_for_sublime/blob/91a27a39b1b0a33a9043aa685e1ee48c64a58274/tern.py#L564).  
  
  </issue>
  <code>
  [start of plugin/definition.py]
  1 import sublime
  2 
  3 from .core.registry import client_for_view, LspTextCommand
  4 from .core.protocol import Request, Point
  5 from .core.documents import get_document_position, get_position, is_at_word
  6 from .core.url import uri_to_filename
  7 from .core.logging import debug
  8 try:
  9     from typing import List, Dict, Optional, Any
  10     assert List and Dict and Optional and Any
  11 except ImportError:
  12     pass
  13 
  14 
  15 class LspSymbolDefinitionCommand(LspTextCommand):
  16     def __init__(self, view):
  17         super().__init__(view)
  18 
  19     def is_enabled(self, event=None):
  20         if self.has_client_with_capability('definitionProvider'):
  21             return is_at_word(self.view, event)
  22         return False
  23 
  24     def run(self, edit, event=None) -> None:
  25         client = client_for_view(self.view)
  26         if client:
  27             pos = get_position(self.view, event)
  28             document_position = get_document_position(self.view, pos)
  29             if document_position:
  30                 request = Request.definition(document_position)
  31                 client.send_request(
  32                     request, lambda response: self.handle_response(response, pos))
  33 
  34     def handle_response(self, response: 'Optional[Any]', position) -> None:
  35         window = sublime.active_window()
  36         if response:
  37             location = response if isinstance(response, dict) else response[0]
  38             file_path = uri_to_filename(location.get("uri"))
  39             start = Point.from_lsp(location['range']['start'])
  40             file_location = "{}:{}:{}".format(file_path, start.row + 1, start.col + 1)
  41             debug("opening location", location)
  42             window.open_file(file_location, sublime.ENCODED_POSITION)
  43             # TODO: can add region here.
  44         else:
  45             window.run_command("goto_definition")
  46 
  47     def want_event(self):
  48         return True
  49
  [end of plugin/definition.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/plugin/definition.py b/plugin/definition.py
  --- a/plugin/definition.py
  +++ b/plugin/definition.py
  @@ -5,6 +5,7 @@
   from .core.documents import get_document_position, get_position, is_at_word
   from .core.url import uri_to_filename
   from .core.logging import debug
  +from Default.history_list import get_jump_history_for_view  # type: ignore
   try:
       from typing import List, Dict, Optional, Any
       assert List and Dict and Optional and Any
  @@ -34,6 +35,9 @@
       def handle_response(self, response: 'Optional[Any]', position) -> None:
           window = sublime.active_window()
           if response:
  +            # save to jump back history
  +            get_jump_history_for_view(self.view).push_selection(self.view)
  +
               location = response if isinstance(response, dict) else response[0]
               file_path = uri_to_filename(location.get("uri"))
               start = Point.from_lsp(location['range']['start'])
  
verification_info: {"golden_diff": "diff --git a/plugin/definition.py b/plugin/definition.py\n--- a/plugin/definition.py\n+++ b/plugin/definition.py\n@@ -5,6 +5,7 @@\n from .core.documents import get_document_position, get_position, is_at_word\n from .core.url import uri_to_filename\n from .core.logging import debug\n+from Default.history_list import get_jump_history_for_view  # type: ignore\n try:\n     from typing import List, Dict, Optional, Any\n     assert List and Dict and Optional and Any\n@@ -34,6 +35,9 @@\n     def handle_response(self, response: 'Optional[Any]', position) -> None:\n         window = sublime.active_window()\n         if response:\n+            # save to jump back history\n+            get_jump_history_for_view(self.view).push_selection(self.view)\n+\n             location = response if isinstance(response, dict) else response[0]\n             file_path = uri_to_filename(location.get(\"uri\"))\n             start = Point.from_lsp(location['range']['start'])\n", "issue": "LSP needs a LspJumpBackCommand\nWhen executing LSP goto definition, \r\nand then executing the built in `jump_back` command, \r\nthe cursor won't be placed in the previous place, as I expect.\r\n\r\nTo fix this, we can introduce a `LspJumpBackCommand`.\r\nWe can do the same thing as TernForSublime [did](https://github.com/ternjs/tern_for_sublime/blob/91a27a39b1b0a33a9043aa685e1ee48c64a58274/tern.py#L564).  \n", "before_files": [{"content": "import sublime\n\nfrom .core.registry import client_for_view, LspTextCommand\nfrom .core.protocol import Request, Point\nfrom .core.documents import get_document_position, get_position, is_at_word\nfrom .core.url import uri_to_filename\nfrom .core.logging import debug\ntry:\n    from typing import List, Dict, Optional, Any\n    assert List and Dict and Optional and Any\nexcept ImportError:\n    pass\n\n\nclass LspSymbolDefinitionCommand(LspTextCommand):\n    def __init__(self, view):\n        super().__init__(view)\n\n    def is_enabled(self, event=None):\n        if self.has_client_with_capability('definitionProvider'):\n            return is_at_word(self.view, event)\n        return False\n\n    def run(self, edit, event=None) -> None:\n        client = client_for_view(self.view)\n        if client:\n            pos = get_position(self.view, event)\n            document_position = get_document_position(self.view, pos)\n            if document_position:\n                request = Request.definition(document_position)\n                client.send_request(\n                    request, lambda response: self.handle_response(response, pos))\n\n    def handle_response(self, response: 'Optional[Any]', position) -> None:\n        window = sublime.active_window()\n        if response:\n            location = response if isinstance(response, dict) else response[0]\n            file_path = uri_to_filename(location.get(\"uri\"))\n            start = Point.from_lsp(location['range']['start'])\n            file_location = \"{}:{}:{}\".format(file_path, start.row + 1, start.col + 1)\n            debug(\"opening location\", location)\n            window.open_file(file_location, sublime.ENCODED_POSITION)\n            # TODO: can add region here.\n        else:\n            window.run_command(\"goto_definition\")\n\n    def want_event(self):\n        return True\n", "path": "plugin/definition.py"}]}