Documentation does not appear correctly in editor
### Expected Behavior

When I'm writing a task, I should be able to see the task documentation (if doc view is selected) 

### Actual Behaviour

If my cursor is at the end of the task, documentation is not displayed
![image](https://github.com/kestra-io/kestra/assets/37600690/09f74e16-1dc3-4827-a4c0-c46c504e479f)


### Steps To Reproduce

_No response_

### Environment Information

- Kestra Version: 0.8.1


### Example flow

_No response_
ui/src/utils/yamlUtils.js
ui/src/utils/yamlUtils.js
diff --git a/ui/src/utils/yamlUtils.js b/ui/src/utils/yamlUtils.js
index 23c3c184c5..fdd6cda190 100644
--- a/ui/src/utils/yamlUtils.js
+++ b/ui/src/utils/yamlUtils.js
@@ -163,7 +163,7 @@ export default class YamlUtils {
     static getTaskType(source, position) {
         const lineCounter = new LineCounter();
         const yamlDoc = yaml.parseDocument(source, {lineCounter});
-        if (yamlDoc.contents && yamlDoc.contents.items && yamlDoc.contents.items.find(e => e.key.value === "tasks")) {
+        if (yamlDoc.contents && yamlDoc.contents.items && yamlDoc.contents.items.find(e => ["tasks", "triggers", "errors"].includes(e.key.value))) {
             const cursorIndex = lineCounter.lineStarts[position.lineNumber - 1] + position.column;
             if (yamlDoc.contents) {
                 for (const item of yamlDoc.contents.items) {
@@ -179,14 +179,16 @@ export default class YamlUtils {
     static _getTaskType(element, cursorIndex, previousTaskType) {
         let taskType = previousTaskType
         for (const item of element.items) {
+            // Every -1 & +1 allows catching cursor
+            // that is just behind or just after a task
             if (item instanceof Pair) {
-                if (item.key.value === "type" && element.range[0] <= cursorIndex && element.range[1] >= cursorIndex) {
+                if (item.key.value === "type" && element.range[0]-1 <= cursorIndex && element.range[1]+1 >= cursorIndex) {
                     taskType = item.value.value
                 }
-                if ((item.value instanceof YAMLSeq || item.value instanceof YAMLMap) && item.value.range[0] <= cursorIndex && item.value.range[1] >= cursorIndex) {
+                if ((item.value instanceof YAMLSeq || item.value instanceof YAMLMap) && item.value.range[0]-1 <= cursorIndex && item.value.range[1]+1 >= cursorIndex) {
                     taskType = this._getTaskType(item.value, cursorIndex, taskType)
                 }
-            } else if (item.range[0] <= cursorIndex && item.range[1] >= cursorIndex) {
+            } else if (item.range[0]-1 <= cursorIndex && item.range[1]+1 >= cursorIndex) {
                 if (item.items instanceof Array) {
                     taskType = this._getTaskType(item, cursorIndex)
                 }
