Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3225)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3226)
@@ -71,6 +71,7 @@
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Label;
@@ -314,6 +315,9 @@
 	@Parameter(key = ConcordancePreferences.RIGHT_CONTEXT_SIZE)
 	private Spinner rightSizeSpinner;
 	
+	@Parameter(key = ConcordancePreferences.TARGET_STRATEGY)
+	private Combo targetStrategyCombo;
+	
 	private TableViewerColumn leftColumnViewer;
 	
 	private TableViewerColumn keywordColumnViewer;
@@ -1311,6 +1315,15 @@
 			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
 		
+//		Label l = new Label(navigationArea, SWT.NONE);
+//		l.setText("Target strategy");
+//		l.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
+//		
+//		targetStrategyCombo = new Combo(navigationArea, SWT.READ_ONLY);
+//		targetStrategyCombo.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, false));
+//		targetStrategyCombo.setItems(Concordance.TARGET_SELECT, Concordance.TARGET_SHOW, Concordance.TARGET_KEEPLEFT, Concordance.TARGET_KEEPRIGHT);
+//		targetStrategyCombo.select(0);
+		
 		// Navigation Area: infoLine and buttons
 		GLComposite navigationAreaComposite = getBottomToolbar().installGLComposite(ConcordanceUIMessages.navigation, 1, false);
 		navigationAreaComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/BackToText.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/BackToText.java	(revision 3225)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/BackToText.java	(revision 3226)
@@ -53,8 +53,7 @@
 	 * @param window the window
 	 * @param concordanceEditor the concordance editor
 	 */
-	public BackToText(IWorkbenchWindow window,
-			ConcordanceEditor concordanceEditor) {
+	public BackToText(IWorkbenchWindow window, ConcordanceEditor concordanceEditor) {
 		this.window = window;
 		this.concordanceEditor = concordanceEditor;
 		setId(ID);
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java	(revision 3225)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java	(revision 3226)
@@ -2,6 +2,7 @@
 
 
 import org.osgi.service.prefs.Preferences;
+import org.txm.concordance.core.functions.Concordance;
 import org.txm.core.preferences.TXMPreferences;
 
 /**
@@ -74,5 +75,7 @@
 		preferences.put(SORT_REFERENCE_PATTERN, "*"); //$NON-NLS-1$
 		
 		preferences.put(LIMIT_CQL, "<text>[]"); //$NON-NLS-1$
+		
+		preferences.put(TARGET_STRATEGY, Concordance.TARGET_SELECT); //$NON-NLS-1$
 	}
 }
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 3225)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 3226)
@@ -81,6 +81,11 @@
  */
 public class Concordance extends TXMResult {
 	
+	public static final String TARGET_SELECT = "Select";
+	public static final String TARGET_SHOW = "Show";
+	public static final String TARGET_KEEPLEFT = "Keep left";
+	public static final String TARGET_KEEPRIGHT = "Keep right";
+	
 	/** The noconc. */
 	protected static int noconc = 1;;
 	
@@ -170,6 +175,10 @@
 	@Parameter(key = ConcordancePreferences.RIGHT_VIEW_PROPERTIES)
 	protected List<WordProperty> pViewRightProperties;
 	
+	/** The right c view properties. */
+	@Parameter(key = ConcordancePreferences.TARGET_STRATEGY)
+	protected String pTargetStrategy;
+	
 	/**
 	 * Optional parameterQuery result already resolved. If set the pQuery is optional
 	 */
@@ -331,6 +340,7 @@
 		}
 		
 		this.pTopIndex = 0;
+		
 		this.nLines = queryResult.getNMatch();
 		this.lines = new ArrayList<>(Collections.nCopies(nLines, (Line) null));// lines are lazily fetched; we force an
 		
@@ -391,7 +401,7 @@
 				+ ", rightcontext=" + this.pRightContextSize //$NON-NLS-1$
 				// + ", query=\""+this.query.getQueryString()+"\""
 				+ ")"); //$NON-NLS-1$
-				
+		
 		return symbol;
 	}
 	
@@ -455,19 +465,19 @@
 			buf.append("Concordance:\n"); //$NON-NLS-1$
 			buf.append("\tCorpus: " + this.getCorpus() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tQuery: " + this.getQuery() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tQuery: " + this.getQuery() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tLeft Context View property: " + this.getLeftViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tLeft Context View property: " + this.getLeftViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tKeyword View property: " + this.getKeywordViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tKeyword View property: " + this.getKeywordViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tRight Context View property: " + this.getRightViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tRight Context View property: " + this.getRightViewProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tLeft Context Sort property: " + this.getLeftAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tLeft Context Sort property: " + this.getLeftAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tKeyword Sort property: " + this.getKeywordAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tKeyword Sort property: " + this.getKeywordAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf
-					.append("\tRight Context Sort property: " + this.getRightAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			.append("\tRight Context Sort property: " + this.getRightAnalysisProperties() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf.append("\tReference View Pattern: " + this.getRefViewPattern() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			buf.append("\tReference Sort Pattern: " + this.getRefAnalysePattern() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			return buf.toString();
@@ -593,6 +603,13 @@
 		if (to >= nLines) to = nLines - 1;
 		
 		List<? extends Match> matches = queryResult.getMatches(from, to);
+//		boolean hasTarget = false;
+//		for (Match m : matches) {
+//			if (m.getTarget() >= 0) {
+//				hasTarget = true;
+//				break;
+//			}
+//		}
 		
 		// System.out.println("cqllimit="+cql_limit);
 		// System.out.println("CQLLimitStarts="+CQLLimitStarts);
@@ -638,18 +655,35 @@
 				List<Integer> lengthOfLeftCtx = new ArrayList<>(j - i);
 				
 				// get all first token and last token of all lines
-				int currentKeywordPos;// = matches.get(0).getStart();
+				int currentKeywordPos, currentKeywordEndPos;// = matches.get(0).getStart();
 				// currentText = previousPivotText;
 				
-				ArrayList<Match> subsetMatch = new ArrayList<>();
+				//ArrayList<Match> subsetMatch = new ArrayList<>();
 				
 				for (int k = 0; k < j - i; k++) {
 					Match match = matches.get(i - from + k);
-					subsetMatch.add(match);
+					//subsetMatch.add(match);
 					// System.out.println("match: "+match);
 					// 1) find current text using keyword position
 					currentKeywordPos = match.getStart();
+					currentKeywordEndPos = match.getEnd();
 					
+//					if (hasTarget) {
+//						if (Concordance.TARGET_SELECT.equals(pTargetStrategy)) {
+//							currentKeywordPos = match.getTarget();
+//							currentKeywordEndPos = match.getTarget();
+//						} else if (Concordance.TARGET_KEEPLEFT.equals(pTargetStrategy)) {
+//							currentKeywordPos = match.getStart();
+//							currentKeywordEndPos = match.getTarget();
+//						} else if (Concordance.TARGET_KEEPRIGHT.equals(pTargetStrategy)) {
+//							currentKeywordPos = match.getTarget();
+//							currentKeywordEndPos = match.getEnd();
+//						} else if (Concordance.TARGET_SHOW.equals(pTargetStrategy)) {
+//							currentKeywordPos = match.getStart();
+//							currentKeywordEndPos = match.getEnd();
+//						}
+//					}
+					
 					if (CQLLimitStarts != null && currentCQLLimit < CQLLimitStarts.length) {
 						while (currentCQLLimit < CQLLimitStarts.length && CQLLimitStarts[currentCQLLimit] <= currentKeywordPos) { // find the match's text
 							currentCQLLimit++; // matches are ordered
@@ -669,41 +703,48 @@
 						}
 					}
 					beginingOfLeftCtxPositions.add(ctxPosition);
-					lengthOfLeftCtx.add(match.getStart() - ctxPosition); // distance between let context start position and keyword position
+					lengthOfLeftCtx.add(currentKeywordPos - ctxPosition); // distance between let context start position and keyword position
 					// System.out.println("left: "+ctxPosition+ "len: "+(match.getStart() - ctxPosition));
 					
 					// KEYWORD LIMITS
-					beginingOfKeywordsPositions.add(match.getStart());
-					lengthOfKeywords.add(match.getEnd() - match.getStart() + 1);
+					beginingOfKeywordsPositions.add(currentKeywordPos);
+					lengthOfKeywords.add(currentKeywordEndPos - currentKeywordPos + 1);
 					
 					// TARGET POSITION
-					targetPositions.add(match.getTarget());
 					
+					
+//					if (Concordance.TARGET_SELECT.equals(pTargetStrategy) || Concordance.TARGET_KEEPLEFT.equals(pTargetStrategy) || Concordance.TARGET_KEEPRIGHT.equals(pTargetStrategy)) {
+//						targetPositions.add(match.getTarget());
+//					} else if (Concordance.TARGET_SHOW.equals(pTargetStrategy)) {
+						targetPositions.add(match.getTarget());
+//					}
+					
 					// check if the end of keyword pass a text limit
-					currentKeywordPos = match.getEnd();
+					currentKeywordPos = currentKeywordEndPos;
 					
 					if (CQLLimitStarts != null)
 						if (currentCQLLimit < CQLLimitStarts.length) {
-						while (currentCQLLimit < CQLLimitStarts.length && CQLLimitStarts[currentCQLLimit] <= currentKeywordPos) { // find the match's text
-						currentCQLLimit++; // matches are ordered
+							while (currentCQLLimit < CQLLimitStarts.length && CQLLimitStarts[currentCQLLimit] <= currentKeywordPos) { // find the match's text
+								currentCQLLimit++; // matches are ordered
+							}
+							if (currentCQLLimit > 0) {
+								currentCQLLimit--; // get the previous text
+							}
 						}
-						if (currentCQLLimit > 0)
-							currentCQLLimit--; // get the previous text
-						}
 					// find the right limit
-					ctxPosition = match.getEnd() + pRightContextSize;
+					ctxPosition = currentKeywordEndPos + pRightContextSize;
 					
 					if (CQLLimitStarts != null)
 						if (currentCQLLimit + 1 < CQLLimitStarts.length) {
-						if (CQLLimitStarts[currentCQLLimit + 1] < ctxPosition) { // test if the right context last position is in the same text as the pivot
-						ctxPosition = CQLLimitStarts[currentCQLLimit + 1] - 1; // the context end is the next text start position
+							if (CQLLimitStarts[currentCQLLimit + 1] < ctxPosition) { // test if the right context last position is in the same text as the pivot
+								ctxPosition = CQLLimitStarts[currentCQLLimit + 1] - 1; // the context end is the next text start position
+							}
 						}
-						}
-						
+					
 					// if (ctxPosition > corpus.getSize()) ctxPosition = corpus.getSize();
 					
-					beginingOfRightCtxPositions.add(match.getEnd() + 1);
-					lengthOfRightCtx.add(ctxPosition - match.getEnd());
+					beginingOfRightCtxPositions.add(currentKeywordEndPos + 1);
+					lengthOfRightCtx.add(ctxPosition - currentKeywordEndPos);
 					// System.out.println("right: "+ctxPosition+" len: "+(ctxPosition - match.getEnd() + 1)+"\n");
 				}
 				
@@ -717,12 +758,10 @@
 							lengthOfLeftCtx));
 				}
 				for (Property property : pViewRightProperties) {
-					rightCtxViewPropValues.put(property, cqiClient.getData(property, beginingOfRightCtxPositions,
-							lengthOfRightCtx));
+					rightCtxViewPropValues.put(property, cqiClient.getData(property, beginingOfRightCtxPositions, lengthOfRightCtx));
 				}
 				for (Property property : pViewKeywordProperties) {
-					keywordsViewPropValues.put(property, cqiClient.getData(property, beginingOfKeywordsPositions,
-							lengthOfKeywords));
+					keywordsViewPropValues.put(property, cqiClient.getData(property, beginingOfKeywordsPositions, lengthOfKeywords));
 				}
 				
 				// get all analysis property values of all lines
@@ -764,8 +803,7 @@
 					/** The occurrences Ids&Text => BackToText */
 					keywordsIdValues = cqiClient.getData(id, beginingOfKeywordsPositions, lengthOfKeywords);
 					keywordsTextValues = cqiClient.getData(text_id, beginingOfKeywordsPositions,
-							Collections.nCopies(beginingOfKeywordsPositions
-									.size(), 1));
+							Collections.nCopies(beginingOfKeywordsPositions.size(), 1));
 				}
 				else {
 					keywordsTextValues = null;
@@ -798,16 +836,13 @@
 					Map<Property, List<String>> lineKeywordsViewPropValue = new HashMap<>();
 					Map<Property, List<String>> lineRightCtxViewPropValue = new HashMap<>();
 					for (Property property : pViewLeftProperties) {
-						lineLeftCtxViewPropValue.put(property,
-								leftCtxViewPropValues.get(property).get(k));
+						lineLeftCtxViewPropValue.put(property, leftCtxViewPropValues.get(property).get(k));
 					}
 					for (Property property : pViewRightProperties) {
-						lineRightCtxViewPropValue.put(property,
-								rightCtxViewPropValues.get(property).get(k));
+						lineRightCtxViewPropValue.put(property, rightCtxViewPropValues.get(property).get(k));
 					}
 					for (Property property : pViewKeywordProperties) {
-						lineKeywordsViewPropValue.put(property,
-								keywordsViewPropValues.get(property).get(k));
+						lineKeywordsViewPropValue.put(property, keywordsViewPropValues.get(property).get(k));
 					}
 					
 					// get the kth line reference values
@@ -836,7 +871,6 @@
 					
 					int targetpos = targetPositions.get(k);
 					
-					
 					Match match = matches.get(i - from + k);
 					
 					Line line = new Line(this, wordids, TextId,
@@ -1647,16 +1681,16 @@
 			keyColSeparator = "";
 			writer.write(
 					txtseparator + ConcordanceCoreMessages.reference + txtseparator
-							+ colseparator + txtseparator + ConcordanceCoreMessages.context + txtseparator
-							+ "\n"); //$NON-NLS-1$
+					+ colseparator + txtseparator + ConcordanceCoreMessages.context + txtseparator
+					+ "\n"); //$NON-NLS-1$
 		}
 		else {
 			writer.write(
 					addTxtSep(ConcordanceCoreMessages.reference, txtseparator) + colseparator
-							+ addTxtSep(ConcordanceCoreMessages.leftContext, txtseparator) + colseparator
-							+ addTxtSep(ConcordanceCoreMessages.keyword, txtseparator) + colseparator
-							+ addTxtSep(ConcordanceCoreMessages.rightContext, txtseparator)
-							+ "\n"); //$NON-NLS-1$
+					+ addTxtSep(ConcordanceCoreMessages.leftContext, txtseparator) + colseparator
+					+ addTxtSep(ConcordanceCoreMessages.keyword, txtseparator) + colseparator
+					+ addTxtSep(ConcordanceCoreMessages.rightContext, txtseparator)
+					+ "\n"); //$NON-NLS-1$
 		}
 		
 		// write lines
@@ -1671,10 +1705,10 @@
 			for (Line line : sublines) {
 				writer.write(
 						addTxtSep(line.getViewRef().toString(), txtseparator)
-								+ colseparator + addTxtSep(line.leftContextToString(), txtseparator)
-								+ keyColSeparator + addTxtSep(line.keywordToString(), txtseparator)
-								+ keyColSeparator + addTxtSep(line.rightContextToString(), txtseparator)
-								+ "\n"); //$NON-NLS-1$
+						+ colseparator + addTxtSep(line.leftContextToString(), txtseparator)
+						+ keyColSeparator + addTxtSep(line.keywordToString(), txtseparator)
+						+ keyColSeparator + addTxtSep(line.rightContextToString(), txtseparator)
+						+ "\n"); //$NON-NLS-1$
 				writer.flush();
 			}
 			// println "Lines1: "+lines
